0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Increase the default max_keepalive HTTP option to 1000

100 is very low for current deployments. 1000 is more
appropriate as a default value.
This commit is contained in:
Loïc Hoguin 2020-05-20 11:08:58 +02:00
parent 4edc39b003
commit 8337aca4d3
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
3 changed files with 4 additions and 3 deletions

View file

@ -121,7 +121,7 @@ max_headers (100)::
Maximum number of headers allowed per request. Maximum number of headers allowed per request.
max_keepalive (100):: max_keepalive (1000)::
Maximum number of requests allowed per connection. Maximum number of requests allowed per connection.

View file

@ -176,7 +176,7 @@ init(Parent, Ref, Socket, Transport, ProxyHeader, Opts) ->
parent=Parent, ref=Ref, socket=Socket, parent=Parent, ref=Ref, socket=Socket,
transport=Transport, proxy_header=ProxyHeader, opts=Opts, transport=Transport, proxy_header=ProxyHeader, opts=Opts,
peer=Peer, sock=Sock, cert=Cert, peer=Peer, sock=Sock, cert=Cert,
last_streamid=maps:get(max_keepalive, Opts, 100)}, last_streamid=maps:get(max_keepalive, Opts, 1000)},
setopts_active(State), setopts_active(State),
loop(set_timeout(State, request_timeout)); loop(set_timeout(State, request_timeout));
{{error, Reason}, _, _} -> {{error, Reason}, _, _} ->

View file

@ -33,7 +33,8 @@ groups() -> [{http, [parallel], ct_helper:all(?MODULE)}].
init_per_group(Name = http, Config) -> init_per_group(Name = http, Config) ->
cowboy_test:init_http(Name = http, #{ cowboy_test:init_http(Name = http, #{
env => #{dispatch => cowboy_router:compile(init_routes(Config))} env => #{dispatch => cowboy_router:compile(init_routes(Config))},
max_keepalive => 100
}, Config). }, Config).
end_per_group(Name, _) -> end_per_group(Name, _) ->