Welcome! Log In Create A New Profile

Advanced

Re: lots of connections on TIME_WAIT state

Artis Caune
April 08, 2009 03:47AM
2009/4/7 Deepan Chakravarthy <codeshepherd@gmail.com>:
> Hi,
>   I am using nginx with fast-cgi .  When I run
> $netstat -np | grep 127.0.0.1:9000
> I find lot of connections in TIME_WAIT state. Is this because of high
> keepalive_timeout value ?   When lot of people use (5 requests per second)
>  nginx takes more  time to respond. System load goes more than 10 during
> peak hours.

This is because of how TCP works.


> debian:~# netstat -np | grep 127.0.0.1:9000
> tcp        0      0 127.0.0.1:9000          127.0.0.1:45603
> TIME_WAIT  -
> tcp        0      0 127.0.0.1:9000          127.0.0.1:45601
> TIME_WAIT  -


If you were on FreeBSD, you could disable TIME_WAIT on loopback
completely by setting:

sysctl net.inet.tcp.nolocaltimewait=1

Maybe debian has similar /proc tuning or you can try to decrease msl
(maximum segment lifetime) or beter don't use inet sockets on loopback
- use unix sockets.





--
regards,
Artis Caune

<----. CCNA | BSDA
<----|====================
<----' didii FreeBSD
Subject Author Posted

lots of connections on TIME_WAIT state

Deepan Chakravarthy April 07, 2009 10:45AM

Re: lots of connections on TIME_WAIT state

Anoop Alias April 07, 2009 11:00AM

Re: lots of connections on TIME_WAIT state

Jérôme Loyet April 07, 2009 11:07AM

Re: lots of connections on TIME_WAIT state

Kon Wilms April 07, 2009 12:06PM

Re: lots of connections on TIME_WAIT state

Artis Caune April 08, 2009 03:47AM

Re: lots of connections on TIME_WAIT state

Igor Sysoev April 08, 2009 04:09AM

Re: lots of connections on TIME_WAIT state

mow April 08, 2009 10:56AM

Re: lots of connections on TIME_WAIT state

Maxim Dounin April 08, 2009 11:41AM

Re: lots of connections on TIME_WAIT state

mow April 08, 2009 12:51PM

Re: lots of connections on TIME_WAIT state

Peter Langhans April 08, 2009 01:10PM

Re: lots of connections on TIME_WAIT state

mow April 09, 2009 05:17AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 244
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready