I have a "Queuing Theory" problem where following are to be done:
However, I find that Queue is always building up (running on two systems - client and server PCs/Laptops),
Note: When I run the processes on the same system, then Queue doesnt build and most of the time, it is down close to 1 - 20 packets.
Need someone to check/review my code.
Code is pasted here:
Client (Single Class):
Server (Multiple Class files Package: serverClasses:
Sample Graph for "QUEUE_LEN Vs. #PACKETS" for 10MBps and 10000 Byte sized packets for a duration of 30 - 35 secs
Switch to Externalizable and write the minimal data required to capture object state for wire transfer. 2) Compress the data that is sent from server to client. Beyond object state in (1), you should also reduce the data blobs ("files") that you are moving around the net.
Disadvantages of Client Server Computing If all the clients simultaneously request data from the server, it may get overloaded. This may lead to congestion in the network. If the server fails for any reason, then none of the requests of the clients can be fulfilled. This leads of failure of the client server network.
The following factors can affect server performance: CPU usage. Disk I/O relating to database, before-image, and after-image I/O. Record locking.
Gurobi Remote Services allow you to offload optimization computations from one or more client programs onto a cluster of servers. We provide a number of different configuration options.
On the client it looks to me that the timeinterval
is always going to be 0. Was that the intension? You say seconds in the code but you are missing the * 1000
.
timeInterval = 1 / ( noOfPacketsToBeSent );
And then you call Thread.sleep((long) timeinterval)
. Since sleep()
takes long
then this will at most sleep 1ms and usually (I suspect) sleep 0ms. Sleep only has a millisecond resolution. If you want nanoseconds resolution then you'll have to do something like:
TimeUnit timeUnit = TimeUnit.NANOSECONDS;
...
timeUnit.sleep(50);
I suspect that your CPU is limiting your runs when both the client and the server are on the same box. When they are on different boxes then things back up because the client is in effect flooding the server because of the improper sleep times.
That's my best guess at least.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With