Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
    
serverfault.com/questions/212093/… –  quanta Oct 4 '11 at 11:06
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.