aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-11-01 15:53:51 +0100
committerLoïc Hoguin <[email protected]>2011-11-01 15:53:51 +0100
commit3ce2865d84f16acd395768eb4f02edc03a3f47ab (patch)
tree4fc854c093e4c65c6ad5bae0b5a59e58b499856d /src
parent774659ec0306b963b86031cb2c6525f314cfb044 (diff)
downloadcowboy-3ce2865d84f16acd395768eb4f02edc03a3f47ab.tar.gz
cowboy-3ce2865d84f16acd395768eb4f02edc03a3f47ab.tar.bz2
cowboy-3ce2865d84f16acd395768eb4f02edc03a3f47ab.zip
Set the cowboy_listener process priority to high
See comment added with it for more information.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_listener.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cowboy_listener.erl b/src/cowboy_listener.erl
index 8b656ba..c19d079 100644
--- a/src/cowboy_listener.erl
+++ b/src/cowboy_listener.erl
@@ -30,9 +30,15 @@
%% API.
%% @private
+%%
+%% We set the process priority to high because cowboy_listener is the central
+%% gen_server in Cowboy and is used to manage all the incoming connections.
+%% Setting the process priority to high ensures the connection-related code
+%% will always be executed when a connection needs it, allowing Cowboy to
+%% scale far beyond what it would with a normal priority.
-spec start_link() -> {ok, pid()}.
start_link() ->
- gen_server:start_link(?MODULE, [], []).
+ gen_server:start_link(?MODULE, [], [{spawn_opt, [{priority, high}]}]).
%% @private
-spec stop(pid()) -> stopped.