Skip to content

Commit

Permalink
Added ability to override the default number of gunicorn workers
Browse files Browse the repository at this point in the history
as well as updated the default to match the gunicorn documentation:

(2 * num_cores) + 1

Source: http://docs.gunicorn.org/en/stable/design.html#how-many-workers
  • Loading branch information
steverecio committed Apr 25, 2016
1 parent 7c28ad8 commit 413acb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions manifests/gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
$appmodule = 'app:app',
$osenv = false,
$timeout = 30,
$workers = false,
$access_log_format = false,
$accesslog = false,
$errorlog = false,
Expand Down
6 changes: 5 additions & 1 deletion templates/gunicorn.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ CONFIG = {
<% else -%>
'--bind=<%= @bind %>',
<% end -%>
'--workers=<%= @processorcount.to_i*2 %>',
<% if @workers -%>
'--workers=<%= @workers %>'
<% else -%>
'--workers=<%= @processorcount.to_i*2 + 1 %>',
<% end -%>
'--timeout=<%= @timeout %>',
<% if @access_log_format -%>
'--access-logformat=<%= @access_log_format %>',
Expand Down

0 comments on commit 413acb3

Please sign in to comment.