ngx.location.capture和ngx.location.capture.multi 设置发送超时,接收超时问题

189 views
Skip to first unread message

huan...@163.com

unread,
Jan 8, 2015, 3:34:15 AM1/8/15
to open...@googlegroups.com
春哥,之前你叫我设置 proxy_read_timeout,但是 proxy_read_timeout是指两个请求之间的超时,而不是一个请求访问upstream的超时设置,官方介绍如下:
Defines a timeout for reading a response from the proxied server. The timeout is set only between two successive read operations, not for the transmission of the whole response. If the proxied server does not transmit anything within this time, the connection is closed.
1)这个proxy_read_timeout满足不了要求
2)proxy_read_timeout设置的单位是秒,最少只能设置1s,如果我想设置500ms的话,则lua配置文件报错
3)除了这个proxy_read_timeout,还可以怎么设置发送接收超时?

DeJiang Zhu

unread,
Jan 8, 2015, 5:26:58 AM1/8/15
to open...@googlegroups.com
在 2015年1月8日 下午4:34, <huan...@163.com>写道:
春哥,之前你叫我设置 proxy_read_timeout,但是 proxy_read_timeout是指两个请求之间的超时,而不是一个请求访问upstream的超时设置,官方介绍如下:

貌似是你理解错了

不是两次请求之间的超时,是两次 socket 读之间的超时时间
在一个请求里,upstream返回的数据,也可能需要多次 socket 读才能全部得到

 
Defines a timeout for reading a response from the proxied server. The timeout is set only between two successive read operations, not for the transmission of the whole response. If the proxied server does not transmit anything within this time, the connection is closed.
1)这个proxy_read_timeout满足不了要求
2)proxy_read_timeout设置的单位是秒,最少只能设置1s,如果我想设置500ms的话,则lua配置文件报错
3)除了这个proxy_read_timeout,还可以怎么设置发送接收超时?

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html

Yichun Zhang (agentzh)

unread,
Jan 8, 2015, 2:42:43 PM1/8/15
to open...@googlegroups.com
Hello!

On Thursday, January 8, 2015, wrote:

1)这个proxy_read_timeout满足不了要求

能满足要求。你把官方文档完全理解错了。
 
2)proxy_read_timeout设置的单位是秒,最少只能设置1s,如果我想设置500ms的话,则lua配置文件报错

这个配置指令只是默认使用秒作单位。你可以指定毫秒单位,例如

   proxy_read_timeout  100ms;
 
3)除了这个proxy_read_timeout,还可以怎么设置发送接收超时?


还应同时配置 proxy_connect_timeout 和 proxy_send_timeout. 三者针对不同方面。缺一不可。

-agentzh
Reply all
Reply to author
Forward
0 new messages