Nginx – HTTP Keep-Alive puzzle with EC2 Linux, Nginx and Chrome

amazon ec2google-chromekeepalivelinux-networkingnginx

Please, help to solve HTTP keep-alive problem.
Basically, I have amazon-ami linux (v2012.09) on EC2 running nginx (v1.2.6).

Chrome (v25.0.1364.99) accesses HTTP page normally, then after about 30 seconds connection dropped (unknown why) as monitored on server by netstat. After that, if chrome requests something from server, it can't receive anything and timeouts for about a minute waiting for something on apparently broken connection. After timeout subsequent requests works ok.

Nginx configured with keepalive_timeout 70s 60s;

cat /proc/sys/net/ipv4/tcp_keepalive_time shows 7200

It might be something easy, but googling revealed a lot of similar problems, but not exactly.
(https://code.google.com/p/chromium/issues/detail?id=27400 read about here http://blog.fastmail.fm/2011/06/28/http-keep-alive-connection-timeouts/).

What answers would be helpful:

  • How to alter configuration of server to avoid excessive waiting on dropped connection from Chrome

  • What product might content bug or what workaround may be available

Disable keep alive for chrome is kind of last resort solutions: as it defeats the purpose as I want to reduce response latency and have long HTTP connection keep-alive time, at least a minute.
Thanks

Best Answer

In such environment, an HTTPS connection doesn't not get sneakily closed after 30s, so when I put a site completely under HTTPS (which was actually planned), Chrome Keep=Alive problem no longer manifest itself with Keep-Alive for a minute, which is acceptable.

Unfortunately, I had no resources to invest into TCP debugging. So puzzle is not solved completely, per se.

Many thanks for suggestions!