TCP connection hang problem



I'm running a simulation with one client machine and four server
machines (all in the same LAN and running Fedora Core 2 with kernel
2.6.5-1.358smp). The client sends about 1.2 million requests (each of
size 432 bytes) through a TCP connection to server and server reads it.


In my first simulation, the client randomly distribute each request to
one of the four servers and it works fine. However, in my 2nd
simulation, where the clients sends all the requests to a central
distributor (running on one of the servers) and the central guy then
distribute the requests to the four servers, the TCP connection between
the client and the central distributor seems to hang, after sometime
(from a few minutes to half an hour). The client stops writing requests
to the socket and the central guy stops reading from the socket.
But, if I launch any other TCP connection request (e.g., telnet
xx.xx.xx.xx 80) to the central distributor machine, the program resumes
from wehre it hangs (client starts to write the socket and the central
distributor starts to read the sockets again), although it would hang
after a while again unless I redo another tcp connection to that
machine.

Anyone could provide a clue/hint to solve this problem? Thanks. BTW, I
do notice there are about 12 tcp connections in the TIME WAIT status on
the central distributor server, it is from another thread of the server
process where it periodically opens a new socket, sends a performance
report through that socket to a remote machine, and then closes the
socket immediately. I guess it should not be the reason of the above
problem but not quite sure.

.



Relevant Pages

  • Re: What doesnt lend itself to OO?
    ... > system design within that context seriously). ... >>The first line exists in the server. ... > objects between client and server i.e. as far as the client code is ... the message data packet data in the server between requests, ...
    (comp.object)
  • Re: Socket switch delay
    ... both at the client and at the server (and why ... would you set the send buffer size to zero on a non-overlapped ... One glaring error is your client does ... So when you use a single socket, ...
    (microsoft.public.win32.programmer.networks)
  • Re: [CFT][PATCH] new scheduler policy
    ... "The X server uses selectto detect clients with pending input. ... executing requests from the client with the smallest file descriptor. ... Each client has a buffer which is used to read some data from the ...
    (Linux-Kernel)
  • Re: Locking on async calls
    ... you must synchronize the entire SendMessage routine as an atomic ... operation to prevent mixed messages from being transmitted to the server. ... You are correct that read and write on the socket do not interfere with each ... If you want to handle multiple client connections from one server object ...
    (microsoft.public.dotnet.general)
  • Re: socket communication: socket doesnt connect
    ... Microsoft MVP, MCSD ... As far as your server code goes, ... accept the listening socket. ... Client client = new Client; ...
    (microsoft.public.vc.language)