Forum: NGINX Big difference between upstream response time and request time

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C324a1d9b1be12a67b0abaab9b9759e6?d=identicon&s=25 Praveen (Guest)
on 2008-10-15 19:37
(Received via mailing list)
Hi,
I'm using nginx as a reverse proxy to my backends. I see there is a
huge discrepancy between upstream response time and request time.

X.X.X.X [15/Oct/2008:09:32:57 -0700] "GET /js/something.js HTTP/1.1"
upstream_response_time 0.005 request_time 105.026 90732578
10.3.0.134:8000

It's generally negligible. But sometimes its as high as 5 or more
seconds, and in some cases as high as the example above.

Any idea what's happening? nginx is running on a dedicated server, and
has about 2000 active connections.

worker_processes  4;
worker_connections  4096;

keepalive_timeout   120;
send_timeout          90;

proxy_read_timeout  120;
proxy_buffer_size   8k;
proxy_buffers   32 32k;

Thanks.
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2008-10-15 20:12
(Received via mailing list)
Hello!

On Wed, Oct 15, 2008 at 10:25:20AM -0700, Praveen wrote:

>
> Any idea what's happening? nginx is running on a dedicated server, and
> has about 2000 active connections.

The $request_time variable measures wall clock time it took to
fully process request, from first byte got from client to last
byte sent to client.  This includes time spent waiting for client
and may really vary depending on what client does / quality of
client's network connection / etc.

Generally you shouldn't pay much attention to this number unless
you have control over the client in question.

Maxim Dounin
F89db1be74d14b18b33970f005111fa0?d=identicon&s=25 Praveen (Guest)
on 2008-10-15 22:34
(Received via mailing list)
Thanks! What about the upstream response time? I'm assuming that it is
time from initiating a connection to the backend server till the last
byte of the response is received.

-p

On Wed, Oct 15, 2008 at 11:03 AM, Maxim Dounin <mdounin@mdounin.ru>
wrote:
>> 10.3.0.134:8000
> and may really vary depending on what client does / quality of
> client's network connection / etc.
>
> Generally you shouldn't pay much attention to this number unless
> you have control over the client in question.
>
> Maxim Dounin
>
>



--
Praveen

Can you yell "Movie!" in a crowded firestation?

http://tigertrail.net
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2008-10-15 23:08
(Received via mailing list)
Hello!

On Wed, Oct 15, 2008 at 01:26:26PM -0700, Praveen wrote:

> Thanks! What about the upstream response time? I'm assuming that it is
> time from initiating a connection to the backend server till the last
> byte of the response is received.

Yes.  And $upstream_response_time worth monitoring, since increase
here indicate that something goes wrong with your backends.

Note: $upstream_response_time may contain multiple values,
separated by ", ".  This may happen if for some reason request
wasn't processed by first backend server and went to other one
according to proxy_next_upstream setting.

Maxim Dounin
This topic is locked and can not be replied to.