# Enabling keepalive increases request time

**URL:** <https://www.ruby-forum.com/t/enabling-keepalive-increases-request-time/246303>\
**Category:** NGINX\
**Created:** [September 30, 2013, 4:51pm UTC](https://www.ruby-forum.com/t/enabling-keepalive-increases-request-time/246303 "2013-09-30T16:51:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [September 30, 2013, 4:51pm UTC](https://www.ruby-forum.com/t/enabling-keepalive-increases-request-time/246303/1 "2013-09-30T16:51:49Z")

</div>

HI,

I’m using Nginx 1.2.9 behind Amazon’s ELB. We recently moved our  
servers  
behind the ELB and in testing enabling keepalives between the server and  
the  
ELB we are seeing request times double from around 25ms to 50ms. I  
tried  
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  
as  
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  
keep  
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:

> **[enabling keepalive increases request time](https://forum.nginx.org/read.php?2,243267,243267#msg-243267)**
>
> HI, I'm using Nginx 1.2.9 behind Amazon's ELB. We recently moved our servers behind the ELB and in testing enabling keepalives between the server and the ELB we are seeing request times double from around 25ms to 50ms. I tried disabling...
