aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-05-09 20:37:12 +0200
committerLoïc Hoguin <[email protected]>2011-05-09 20:37:12 +0200
commitb3d3045cae8d90257851e87e0073c227656d3ad0 (patch)
tree5087f767baceaacb68798c95dad2c82807aeeba5
parent420f5baf98cb1b19209977e5552107ab3222767f (diff)
downloadcowboy-b3d3045cae8d90257851e87e0073c227656d3ad0.tar.gz
cowboy-b3d3045cae8d90257851e87e0073c227656d3ad0.tar.bz2
cowboy-b3d3045cae8d90257851e87e0073c227656d3ad0.zip
Increase the default backlog from 128 to 1024.
Improves reliability under heavy load.
-rw-r--r--src/cowboy_ssl_transport.erl2
-rw-r--r--src/cowboy_tcp_transport.erl2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_ssl_transport.erl b/src/cowboy_ssl_transport.erl
index 41577fc..cbe1ac1 100644
--- a/src/cowboy_ssl_transport.erl
+++ b/src/cowboy_ssl_transport.erl
@@ -31,7 +31,7 @@ messages() -> {ssl, ssl_closed, ssl_error}.
-> {ok, LSocket::ssl:sslsocket()} | {error, Reason::atom()}.
listen(Opts) ->
{port, Port} = lists:keyfind(port, 1, Opts),
- Backlog = proplists:get_value(backlog, Opts, 128),
+ Backlog = proplists:get_value(backlog, Opts, 1024),
{certfile, CertFile} = lists:keyfind(certfile, 1, Opts),
{keyfile, KeyFile} = lists:keyfind(keyfile, 1, Opts),
{password, Password} = lists:keyfind(password, 1, Opts),
diff --git a/src/cowboy_tcp_transport.erl b/src/cowboy_tcp_transport.erl
index 49003bd..fdd3ca6 100644
--- a/src/cowboy_tcp_transport.erl
+++ b/src/cowboy_tcp_transport.erl
@@ -30,7 +30,7 @@ messages() -> {tcp, tcp_closed, tcp_error}.
-> {ok, LSocket::inet:socket()} | {error, Reason::atom()}.
listen(Opts) ->
{port, Port} = lists:keyfind(port, 1, Opts),
- Backlog = proplists:get_value(backlog, Opts, 128),
+ Backlog = proplists:get_value(backlog, Opts, 1024),
gen_tcp:listen(Port, [binary, {active, false},
{backlog, Backlog}, {packet, raw}, {reuseaddr, true}]).