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 am using nginx as reverse proxy with varnish in the background. I have LAMP fueling varnish. The problem I am seeing on Varnish server is that the connection from nginx is getting established everytime a request is served.

We are serving more than 300 req/second and we see something like:

netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c
      2 ESTABLISHED
      1 FIN_WAIT1
      7 LISTEN
      1 SYN_RECV
  43187 TIME_WAIT

This is ofcourse undesired. What would be best is that we setup a tunnel or a connection between nginx and varnish ones and all communication happen over that static connection. I am not quite sure how exactly this can be done or if there are better ways to do it.

What else can I do here?

Thanks

share|improve this question
    
Please post all the relate configuration files. –  quanta Oct 12 '11 at 23:25
    
Please describe what is so "undesired" about the situation. That's just how nginx works; if it's not causing you direct problems, don't worry about it. –  womble Oct 13 '11 at 1:27

1 Answer 1

up vote 1 down vote accepted

Nginx only supports HTTP/1.0 between itself and back-end servers, so no HTTP keep-alive by default :(

There are a lot of weird and wonderful third-party modules which may help, but so far I've only found keepalive support for memcache and redis, no HTTP

share|improve this answer
    
Nginx now supports upstream keep-alive as of 1.1.4 nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive –  David Radcliffe Oct 3 at 17:12

Your Answer

 
discard

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.