mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Set the cowboy_listener process priority to high
See comment added with it for more information.
This commit is contained in:
parent
774659ec03
commit
3ce2865d84
1 changed files with 7 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue