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'm using nginx in reverse-proxy mode. Here's relevant part of config file:

server {
    listen       80;
    server_name  ~^web.redhelper\.ru$ ;
    access_log   off;
    location /http-bind {
         proxy_pass              http://localhost:7070;
         proxy_set_header        X-Real-IP $remote_addr;
         proxy_set_header        Host $http_host;


After some some time I started to hit 500 error. I think that I'm hitting some max open connections limit. Here's munin graph:

enter image description here enter image description here

When I use netstat I see that there are:

1279 open connections to port 80; (including website itself that is on the same port)
of them 745 are in ESTABLISHED state and 479 in TIME_WAIT
277 ESTABLISHED connections from[misc port] to
3922 connections from to[misc port]
of them 246 are in ESTABLISHED state and 3646 in TIME_WAIT 

I think that it is 3646 TIME_WAIT connections causing this. How can I prevent nginx from holding that much open connections?

Here are some more munin graphs, maybe they will help to better understand my problem:

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.