Skip to content

Commit

Permalink
Fixes #31815 - Allow setting number of workers for content app
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Feb 8, 2021
1 parent e3e27dd commit a025770
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@
# @param service_ensure
# Specify if Pulp services should be running or stopped.
#
# @param content_service_worker_count
# Number of pulpcore-content service workers for gunicorn to use.
# Modifying this parameter should be done incrementally with benchmarking at each step to determine an optimal value for your deployment.
#
# @param api_service_worker_count
# Number of pulpcore-api service workers for gunicorn to use.
# Modifying this parameter should be done incrementally with benchmarking at each step to determine an optimal value for your deployment.
#
# @example Default configuration
# include pulpcore
#
Expand Down Expand Up @@ -178,6 +186,8 @@
Integer[0] $worker_count = min(8, $facts['processors']['count']),
Boolean $service_enable = true,
Boolean $service_ensure = true,
Integer[0] $content_service_worker_count = (2*min(8, $facts['processors']['count']) + 1),
Integer[0] $api_service_worker_count = 1,
) {
$settings_file = "${config_dir}/settings.py"

Expand Down
1 change: 1 addition & 0 deletions templates/pulpcore-api.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Group=<%= scope['pulpcore::group'] %>
WorkingDirectory=<%= scope['pulpcore::user_home'] %>
RuntimeDirectory=pulpcore-api
ExecStart=/usr/libexec/pulpcore/gunicorn pulpcore.app.wsgi:application \
-w <%= scope['pulpcore::api_service_worker_count'] %> \
--access-logfile -
ExecReload=/bin/kill -s HUP $MAINPID
ProtectSystem=full
Expand Down
2 changes: 1 addition & 1 deletion templates/pulpcore-content.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WorkingDirectory=<%= scope['pulpcore::user_home'] %>
RuntimeDirectory=pulpcore-content
ExecStart=/usr/libexec/pulpcore/gunicorn pulpcore.content:server \
--worker-class 'aiohttp.GunicornWebWorker' \
-w 2 \
-w <%= scope['pulpcore::content_service_worker_count'] %> \
--access-logfile -
ExecReload=/bin/kill -s HUP $MAINPID
SyslogIdentifier=pulpcore-content
Expand Down

0 comments on commit a025770

Please sign in to comment.