Clear questions and runnable code
get the best and fastest answer
Re^7: Multithreaded Server Crashes under heavy loadby BrowserUk (Pope)
|on Aug 30, 2012 at 09:13 UTC||Need Help??|
It is all over after the first 3 minutes. Its not a "hang". It's just running really slowly because it cannot get new sockets for connections.
You are creating huge numbers of connections -- there are 6,897 open sockets when your program runs, presumably still timing out from previous runs -- but rather than cleanly shutting those connections down, they are going into TIME_WAIT state and then your server has to wait for one of them to time out (900 seconds or some such) before it can establish a new connection.
(If you are going to throw another set of data at us, how about you expend a little energy to make the csv data readable :)
There is either:
Before you do another run, you need to clean up any existing connections. There is the netsh command that allows you to reset at various levels -- winsock; interface; ipv4; tcp etc. -- but perhaps the simplest is to just reboot the machine.
You need to work out what is causing the connections to 'linger'. You appear to be using shutdown correctly -- at the server end at least -- and closing the filehandles; but something is preventing them from being reused immediately, despite your ReuseAddr setting on the listener.
Not a solution, but maybe it will give you some clues about where to start looking and how.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.