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 am using 10EC2 Instances behind 1 ELB. And ELB configured 80 to 8080 and 443 to 8080 port.

And all 10EC2 instances having installed with Apache Tomcat, total request on ELB around 8000 to 10000 in 1 minute.

I am facing problem for CLOSE_WAIT connection on 10 EC2 Instance, having Apache Tomcat.

EC2 Instance Type : m1.xlarge

When we restart the Apache Tomcat, all CLOSE_WAIT connections are lost, but its not proper way to work on Production Instances.

Please help me out.

share|improve this question
Same problem here! But the strange thing is I am running workers that are connected to my local nginx using unix socket. And these workers are stuck with a connection on load balancer on SSL port. I tried many other solutions and it keeps happening (changed nginx to apache, and uwsgi to gunicorn for python workers). I believe its a ELB problem. And the worst thing is that sometimes it goes crazy an floods my EC2 instances with CLOSE_WAIT connections (more than 100k connections). Amazon support says its not an ELB issue. Any hints? – emanuelcds Apr 14 at 15:12

This is a variant of the problem described here: Does your application have many mobile clients? These clients, connecting over unreliable networks, can do crazy things with TCP states.

The simplest way to handle it is to reboot your apache instances in a rolling fashion - say, one server each 30 minutes. If you have enough instances behind your ELB then the net effect on your service should be bearable.

share|improve this answer
Earlier, all of the clients on the Internet were connecting over rather unreliable and slow networks and TCP states weren't gone crazy. ) – poige May 27 '13 at 11:16

Check out cutter.

Cutter is a tool for linux-based firewalls that allows connections passing through them to be forcably [sic] aborted by the firewall administrator.

share|improve this answer

Some clients don't properly close the TCP connection when their done. That's out of your control. These generally time out after a bit, and don't create too much of a problem, other than cluttering the listing you get from netstat -an and similar.

So, why you are having a problem with it?

This might be pertinent: What limits the maximum number of connections on a Linux server?

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.