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

Does anybody have a clue about this problem?


From: Tian C. [email protected]
To: “[email protected][email protected]
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

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

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 R. [email protected]
To: [email protected]
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