1

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 127.0.0.1:[misc port] to 127.0.0.1:7070
3922 connections from 127.0.0.1:7070 to 127.0.0.1:[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: http://munin.redhelper.ru/localdomain/localhost.localdomain/index.html

Poma
  • 1,289
  • 6
  • 22
  • 35
  • possible duplicate of [Very Large number of connections in TIME_WAIT state; Server is slow, ipconntrac](http://serverfault.com/questions/232360/very-large-number-of-connections-in-time-wait-state-server-is-slow-ipconntrac) – quanta Oct 04 '11 at 11:06
  • http://serverfault.com/questions/212093/how-to-reduce-number-of-sockets-in-time-wait – quanta Oct 04 '11 at 11:06

0 Answers0