Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #28955 - Add puma configuration tuning options #790

Merged
merged 1 commit into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@
#
# $cors_domains:: List of domains that show be allowed for Cross-Origin Resource Sharing. This requires Foreman 1.22+
#
# $foreman_service_puma_threads_min:: Minimum number of threads for Puma. Relevant only when Puma service is used and ignored when Passenger is used.
#
# $foreman_service_puma_threads_max:: Maximum number of threads for Puma. Relevant only when Puma service is used and ignored when Passenger is used.
#
# $foreman_service_puma_workers:: Number of workers for Puma. Relevant only when Puma service is used and ignored when Passenger is used.
#
class foreman (
Stdlib::HTTPUrl $foreman_url = $::foreman::params::foreman_url,
Boolean $unattended = $::foreman::params::unattended,
Expand Down Expand Up @@ -286,6 +292,9 @@
Optional[Redis::RedisUrl] $jobs_sidekiq_redis_url = $::foreman::params::jobs_sidekiq_redis_url,
Boolean $hsts_enabled = $::foreman::params::hsts_enabled,
Array[Stdlib::HTTPUrl] $cors_domains = $::foreman::params::cors_domains,
Integer[0] $foreman_service_puma_threads_min = $::foreman::params::foreman_service_puma_threads_min,
Integer[0] $foreman_service_puma_threads_max = $::foreman::params::foreman_service_puma_threads_max,
Integer[0] $foreman_service_puma_workers = $::foreman::params::foreman_service_puma_workers,
) inherits foreman::params {
if $db_sslmode == 'UNSET' and $db_root_cert {
$db_sslmode_real = 'verify-full'
Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
$foreman_service_ensure = 'running'
$foreman_service_enable = true
$foreman_service_port = 3000
$foreman_service_puma_threads_min = 0
$foreman_service_puma_threads_max = 16
$foreman_service_puma_workers = 2

# Define job processing service properties
$jobs_manage_service = true
Expand Down
3 changes: 3 additions & 0 deletions templates/foreman.service-overrides.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ Environment=FOREMAN_HOME=<%= scope['foreman::app_root'] %>
Environment=FOREMAN_BIND=<%= scope['foreman::foreman_service_bind'] %>
<% end -%>
Environment=FOREMAN_PORT=<%= scope['foreman::foreman_service_port'] %>
Environment=FOREMAN_PUMA_THREADS_MIN=<%= scope['foreman::foreman_service_puma_threads_min'] %>
Environment=FOREMAN_PUMA_THREADS_MAX=<%= scope['foreman::foreman_service_puma_threads_max'] %>
Environment=FOREMAN_PUMA_WORKERS=<%= scope['foreman::foreman_service_puma_workers'] %>