Enabling keepalive increases request time


I’m using Nginx 1.2.9 behind Amazon’s ELB. We recently moved our
behind the ELB and in testing enabling keepalives between the server and
ELB we are seeing request times double from around 25ms to 50ms. I
disabling postpone_output since I thought it was a buffering issue, but
still saw increased response times. Anyone have any ideas what could
explain this? Enabling keepalive , improves other metrics for us such
TCP timeouts and CPU utilization, so we’d like to enable if we can.

The nginx servers are just proxying to backend servers , also utilizing
alive on the upstream. Below are the main options we are using

worker_processes 2;
worker_rlimit_nofile 500000;

events {
worker_connections 20000;

http {

sendfile           on;
tcp_nopush         off;
tcp_nodelay        off;
gzip               off;
keepalive_requests  100000;
output_buffers   8 64k;
postpone_output  0;

server {
listen *:80 default deferred backlog=16384;

Posted at Nginx Forum: