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

link|improve this question

79% accept rate
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
feedback

1 Answer

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.