关于keepalive_requests

211 views
Skip to first unread message

damacheng009

unread,
Sep 7, 2012, 3:02:40 AM9/7/12
to openresty
dear all:
我想nginx与前端保持长连接,发现keepalive_requests参数不能像tomcat那样设置为-1来表示没有限制,
nginx难道不能实现没有限制的请求次数吗?谢谢大家~
 
2012-09-07

damacheng009

agentzh

unread,
Sep 7, 2012, 2:15:37 PM9/7/12
to open...@googlegroups.com
Hello!

2012/9/7 damacheng009 <damach...@gmail.com>:


> dear all:
> 我想nginx与前端保持长连接,发现keepalive_requests参数不能像tomcat那样设置为-1来表示没有限制,
> nginx难道不能实现没有限制的请求次数吗?谢谢大家~
>

根据目前的实现,并不能实现绝对没有限制的请求次数。不过,可以通过把 keepalive_requests 设置得非常大来予以近似。比如在
64 位系统上,keepalive_requests 可以设置到最大的 64 位有符号整数:

keepalive_requests 9223372036854775806;

这在工程上已经等价于没有限制了,因为即使你的每个 http 连接平均每秒处理 1 万个请求,那在近 3000 万年以内都不会超过限制了 :)

Best regards,
-agentzh

Reply all
Reply to author
Forward
0 new messages