Thanks, Lukas, it helped to understand better what happens. "Problem: Netstat shows lots of sockets in the TIME_WAIT state. What’s wrong?
Solution: Nothing’s wrong. TIME_WAIT is absolutely normal. If you go through the state-transition diagram above, you see that every socket that gets closed normally goes through this state after it’s closed. The TIME_WAIT state is a safety mechanism, to catch stray packets for that connection after the connection is "officially" closed. Since the maximum time that such stray packets can exist is 2 times the "maximum segment lifetime" (the time for a packet to go from your machine to the remote peer and for the response to come back), the TIME_WAIT state lasts for 2 * MSL. The only tricky bit is, there is no easy way to estimate MSL on the fly, so stacks traditionally hard-code a value for it, from 15 to 60 seconds. Thus, TIME_WAIT usually lasts 30-120 seconds. " My tests flooded the server with connections to see if is able do deal with. In real applications (unless DoS) it will never happen. To my understanding, I'll need to live with this behavior... []s Nelson >> My trouble is that on Linux each connection remains "open" (seen with >> netstat -ta) for about 1 minute, and when I test the server with many >> connections, the number of ports available runs out and the systems >> stalls for a moment - until some connections are closed (or reach >> some timeout). > > Read this: http://tangentsoft.net/wskfaq/articles/debugging-tcp.html > > It can help you, I hope. > > > -- Usando o revolucionário cliente de correio do Opera: http://www.opera.com/mail/ ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ synalist-public mailing list synalist-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synalist-public