From 4c129efe5a35d8e87da7483e3ad3bf53c110ed76 Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Thu, 19 Aug 2021 12:43:12 -0400 Subject: [PATCH] Refs #33277: Unset foreman_service_puma_workers and foreman_service_puma_threads_max if set to default value This resets the foreman_server_puma_workers value to pick up the newest default which is undef. The change from https://github.com/theforeman/puppet-foreman/pull/986 makes the default a dynamically calculated value that should provide better out of the box experience for users. This resets the value of foreman_service_puma_threads_max to the new default value coming from puppet-foreman of 5. The original default of 16 has been determined to likely be too high for Ruby MRI based installations and resetting to the recommended default by Puma should result in less wasted resources. Users can opt to increase this value based on their environments. --- ...10819164113_reset_puma_workers_and_max_threads.rb | 12 ++++++++++++ ...10819164117-reset-puma-workers-and-max-threads.rb | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 config/foreman.migrations/20210819164113_reset_puma_workers_and_max_threads.rb create mode 100644 config/katello.migrations/210819164117-reset-puma-workers-and-max-threads.rb diff --git a/config/foreman.migrations/20210819164113_reset_puma_workers_and_max_threads.rb b/config/foreman.migrations/20210819164113_reset_puma_workers_and_max_threads.rb new file mode 100644 index 00000000..124a8147 --- /dev/null +++ b/config/foreman.migrations/20210819164113_reset_puma_workers_and_max_threads.rb @@ -0,0 +1,12 @@ +# https://github.com/theforeman/puppet-foreman/commit/533c1f3be8069139d7375841019afeb7c1102830 +if answers['foreman'].is_a?(Hash) + if answers['foreman']['foreman_service_puma_workers'] == 2 + answers['foreman'].delete('foreman_service_puma_workers') + end +end + +if answers['foreman'].is_a?(Hash) + if answers['foreman']['foreman_service_puma_threads_max'] == 16 + answers['foreman'].delete('foreman_service_puma_threads_max') + end +end diff --git a/config/katello.migrations/210819164117-reset-puma-workers-and-max-threads.rb b/config/katello.migrations/210819164117-reset-puma-workers-and-max-threads.rb new file mode 100644 index 00000000..124a8147 --- /dev/null +++ b/config/katello.migrations/210819164117-reset-puma-workers-and-max-threads.rb @@ -0,0 +1,12 @@ +# https://github.com/theforeman/puppet-foreman/commit/533c1f3be8069139d7375841019afeb7c1102830 +if answers['foreman'].is_a?(Hash) + if answers['foreman']['foreman_service_puma_workers'] == 2 + answers['foreman'].delete('foreman_service_puma_workers') + end +end + +if answers['foreman'].is_a?(Hash) + if answers['foreman']['foreman_service_puma_threads_max'] == 16 + answers['foreman'].delete('foreman_service_puma_threads_max') + end +end