1

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

Sparsh Gupta
  • 1,127
  • 7
  • 21
  • 31
  • 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 01:27

1 Answers1

1

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

Shish
  • 1,502
  • 9
  • 12