diff --git a/manifests/init.pp b/manifests/init.pp index 264ff64a..b86b06ad 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 # @@ -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" diff --git a/templates/pulpcore-api.service.erb b/templates/pulpcore-api.service.erb index caac3b84..70a65150 100644 --- a/templates/pulpcore-api.service.erb +++ b/templates/pulpcore-api.service.erb @@ -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 diff --git a/templates/pulpcore-content.service.erb b/templates/pulpcore-content.service.erb index af52a8f7..6bbabe35 100644 --- a/templates/pulpcore-content.service.erb +++ b/templates/pulpcore-content.service.erb @@ -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