read_timeout和upstream_response_time的问题

23 views
Skip to first unread message

hammer

unread,
Apr 15, 2011, 6:11:46 AM4/15/11
to cnginx
我们有一个服务器要处理很高的访问量,上游是一些fastcgi服务。
现在我做了如下设置:


fastcgi_connect_timeout 5ms;
fastcgi_read_timeout 10ms;

日志中我记录了$upstream_response_time,结果还出现一秒多两秒多的日志。这是怎么回事呢?

Delta Yeh

unread,
Apr 15, 2011, 11:35:06 AM4/15/11
to cng...@googlegroups.com, hammer
是CGI服务要很久才响应么?

> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的“cnginx”论坛。
> 要向此网上论坛发帖,请发送电子邮件至 cng...@googlegroups.com
> 要取消订阅此网上论坛,请发送电子邮件至 cnginx+un...@googlegroups.com
> 若有更多问题,请通过 http://groups.google.com/group/cnginx?hl=zh-CN 访问此网上论坛。
>
>

Qiao Lian (连乔)

unread,
Apr 15, 2011, 11:19:39 PM4/15/11
to Delta Yeh, cng...@googlegroups.com
按理说很久才响应的,nginx应该最多15毫秒直接返回404了。

一秒多的日志是我看错了。但是有40毫秒的日志。
我估计是这样的:read_timeout是指一个read请求10毫秒没响应就超时
但是nginx可能向上游请求了n次read,每次都不到10毫秒,但是总的消耗时间达到40毫秒。
Reply all
Reply to author
Forward
0 new messages