# Is there an nginx queue that isn't logged via $response\_time

**URL:** <https://www.ruby-forum.com/t/is-there-an-nginx-queue-that-isnt-logged-via-response-time/246326>\
**Category:** NGINX\
**Created:** [September 26, 2013, 8:10pm UTC](https://www.ruby-forum.com/t/is-there-an-nginx-queue-that-isnt-logged-via-response-time/246326 "2013-09-26T20:10:19Z")\
**Posts on this page:** 3\
**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 26, 2013, 8:10pm UTC](https://www.ruby-forum.com/t/is-there-an-nginx-queue-that-isnt-logged-via-response-time/246326/1 "2013-09-26T20:10:19Z")

</div>

We have a setup that looks like this:

nginx-\>haproxy-\>app servers

We are terminating SSL with nginx and it sits in front of everything.  
During  
our peak load times, we are experiencing about a 2x performance hit.  
Requests that would normally take 400 ms are taking 800ms. It’s taking  
longer for the entire Internet.

The problem is, I have absolutely no sign of any slowdowns in my logs  
and  
graphs. New Relic shows all the app servers are responding correctly  
with no  
change in speed. Nginx and haproxy show nothing in their logs about  
requests  
slowing down, but we are slowing down at end users. Despite nginx  
showing  
that a particular request I tracked is taking 17ms ($response\_time)  
through  
the entire stack, it took 1.5 seconds to curl it during peak load last  
week.

So, that leaves me with two options:

1. Network issues - I have more than enough pipe left according to  
graphs  
from the router. I’m only using 400 Mbps out of the 1 Gbps port and  
there  
are no errors in ifconfig or on the switch or routers. However,  
SoftLayer  
manages this gear, so I can’t verify this personally.

2. nginx is holding up the request and either not logging it or I’m not  
logging the right thing. Is it possible that requests are being queued  
up  
because workers are busier and they’re not getting acted on as quickly?  
If  
this is in fact happening, what can I log in nginx other than  
$response\_time, since that is showing no slowdown at all. And, if this  
is  
possible that requests are actually taking longer than $response\_time is  
indicating, how do I go about tweaking the config to speed things up?

Posted at Nginx Forum:

> **[Is there an nginx queue that isn't logged via $response\_time](https://forum.nginx.org/read.php?2,243170,243170#msg-243170)**
>
> We have a setup that looks like this: nginx-\>haproxy-\>app servers We are terminating SSL with nginx and it sits in front of everything. During our peak load times, we are experiencing about a 2x performance hit. Requests that would normally...

---

<div class="post-metadata">

**Author:** ![tempspace](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@tempspace](https://www.ruby-forum.com/u/tempspace)\
**Post date:** [September 26, 2013, 8:15pm UTC](https://www.ruby-forum.com/t/is-there-an-nginx-queue-that-isnt-logged-via-response-time/246326/2 "2013-09-26T20:15:36Z")

</div>

Sorry, I meant $request\_time.

Posted at Nginx Forum:

> **[Re: Is there an nginx queue that isn't logged via $response\_time](https://forum.nginx.org/read.php?2,243170,243171#msg-243171)**
>
> We have a setup that looks like this: nginx-\>haproxy-\>app servers We are terminating SSL with nginx and it sits in front of everything. During our peak load times, we are experiencing about a 2x performance hit. Requests that would normally...

---

<div class="post-metadata">

**Author:** ![tempspace](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@tempspace](https://www.ruby-forum.com/u/tempspace)\
**Post date:** [September 26, 2013, 9:42pm UTC](https://www.ruby-forum.com/t/is-there-an-nginx-queue-that-isnt-logged-via-response-time/246326/3 "2013-09-26T21:42:07Z")

</div>

In case it helps, here at my sysctl and applicable nginx config values

Sysctl  
net.ipv4.tcp\_syncookies = 0  
net.ipv4.tcp\_synack\_retries = 2  
net.ipv4.ip\_local\_port\_range = 1024 65535  
net.ipv4.tcp\_fin\_timeout = 3  
net.core.rmem\_max = 16777216  
net.core.wmem\_max = 16777216  
net.ipv4.tcp\_rmem = 16777216 16777216 16777216  
net.ipv4.tcp\_wmem = 16777216 16777216 16777216  
net.ipv4.tcp\_max\_tw\_buckets = 16777216  
net.ipv4.tcp\_tw\_reuse = 1  
net.ipv4.tcp\_max\_syn\_backlog = 262144  
net.core.somaxconn = 262144  
net.core.netdev\_max\_backlog = 15000  
net.core.netdev\_budget = 8196  
net.ipv4.ip\_local\_port\_range = 1024 65535  
net.ipv4.ip\_nonlocal\_bind = 1

Applicable nginx configuration  
user www-data;  
worker\_processes 20;  
worker\_rlimit\_nofile 500000;  
error\_log /var/log/nginx/error.log;  
pid /var/run/nginx.pid;

events {  
use epoll;  
multi\_accept off;  
accept\_mutex off;  
worker\_connections 65536;  
}

Posted at Nginx Forum:

> **[Re: Is there an nginx queue that isn't logged via $response\_time](https://forum.nginx.org/read.php?2,243170,243173#msg-243173)**
>
> We have a setup that looks like this: nginx-\>haproxy-\>app servers We are terminating SSL with nginx and it sits in front of everything. During our peak load times, we are experiencing about a 2x performance hit. Requests that would normally...
