Forum: NGINX request_time exstreamly larger than upstream_response_time for some queries when using fastcgi

Posted by Tian Chao (Guest)
on 2012-11-21 06:03
(Received via mailing list)
Hi,
I run python in backend, and use nginx to proxy queries to python by 
using
fastcgi. I found some strange things in my nginx log those days. Some 
queries'
$request_time are up to 40 seconds which their $upstream_response_time 
are less
than 1 second.

Here is my fastcgi related conf.
fastcgi_max_temp_file_size 0;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_NAME "";
fastcgi_pass python_backend;
fastcgi_buffers 1024 8K;

Do you guys know what's the problem?

Chao
Posted by Tian Chao (Guest)
on 2012-11-22 04:52
(Received via mailing list)
Does anybody have a clue about this problem?


________________________________
 From: Tian Chao <tchao.china@yahoo.com>
To: "nginx@nginx.org" <nginx@nginx.org>
Sent: Wednesday, November 21, 2012 1:02 PM
Subject: request_time exstreamly larger than upstream_response_time for 
some queries when using fastcgi


Hi,
I run python in backend, and use nginx to proxy queries to python by 
using
fastcgi. I found some strange things in my nginx log those days. Some 
queries'
$request_time are up to 40 seconds which their $upstream_response_time 
are less
than 1 second.

Here is my fastcgi related conf.
fastcgi_max_temp_file_size 0;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_NAME "";
fastcgi_pass python_backend;
fastcgi_buffers 1024 8K;

Do you guys know what's the problem?

Chao
Posted by Reinis Rozitis (Guest)
on 2012-11-22 05:05
(Received via mailing list)
>  I found some strange things in my nginx log those days. Some queries'
> $request_time are up to 40 seconds which their $upstream_response_time are
> less than 1 second.

$request_time is time since start of the request (first bytes read from
client) till end of the request (last bytes are sent to client and 
logging
happens) - so while the backend can generate the response in 1 second 
there
might be clients with slow connections or even not waiting for the 
response
(closing it) etc.


rr
Posted by Tian Chao (Guest)
on 2012-11-22 08:03
(Received via mailing list)
Hi rr,

Thanks for your explain. Some queries' body sent is just about 1K bytes, 
however the$request_time is up to 40 seconds, so i think the connection 
is tooslow. Is there a way fordiagnosticwhat happened in that time for 
those slow queries?

Thanks,
Chao


________________________________
 From: Reinis Rozitis <r@roze.lv>
To: nginx@nginx.org
Sent: Thursday, November 22, 2012 12:04 PM
Subject: Re: request_time exstreamly larger than upstream_response_time 
for some queries when using fastcgi

> I found some strange things in my nginx log those days. Some queries' 
$request_time are up to 40 seconds which their $upstream_response_time are less 
than 1 second.

$request_time is time since start of the request (first bytes read from 
client) till end of the request (last bytes are sent to client and 
logging happens) - so while the backend can generate the response in 1 
second there might be clients with slow connections or even not waiting 
for the response (closing it) etc.


rr
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.