Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 servers, both running RHEL 6, one for Apache 2.2 and one for memcached (memcached-1.4.4-3).

I noticed an increase in the number of TIME_WAIT connections on the Apache server

netstat -n | grep 11211  | awk '{print $6}' | sort |  uniq -c
    807 TIME_WAIT

and still the number increases.

  • Does TIME_WAIT mean it is still used ?
  • Is increasing the number will affect the server performance?
  • How can I get rid of them ?
share|improve this question
This is not really something to worry about. See: – Krist van Besien Apr 9 '13 at 13:51

Connections in the TIME_WAIT state can cause a problem, but only when you get to about 30,000 of them.

Each one of these connections is holding open the local IP address and port in case any more packets from the earlier, finished connection were delayed and come through after the connection has been closed. This is a design feature of TCP.

If you have too may of them, new connections cannot be opened until some of the connections in the TIME_WAIT state expire. The symptoms you might see at the front end are slower-than-usual HTTP requests, particularly when the site is heavily loaded. (But these symptoms can have many, many different causes so don't immediately jump to this conclusion.)

I've only ever once run into this problem and it was due to a misbehaving script on some servers that was opening a new connection to the database for every query rather than holding open a single connection and running multiple queries over it. It's not a common problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.