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

update puma threads tunings #3248

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
16 changes: 4 additions & 12 deletions guides/common/modules/con_puma-threads.adoc
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
[id="Puma_Threads_{context}"]
= Puma threads

Number of Puma threads (per Puma worker) is configured by using two values: `threads_min` and `threads_max`.
To configure the number of Puma threads (per Puma worker), use these values: `threads_min` and `threads_max`.

Value of `threads_min` determines how many threads each worker spawns at a worker start.
Then, as concurrent requests are coming and more threads is needed, worker will be spawning more and more workers up to `threads_max` limit.

We recommend setting `threads_min` to same value as `threads_max` as having fewer Puma threads lead to higher memory usage on your {ProjectServer}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since https://projects.theforeman.org/issues/33214 (Foreman 3.1) this is the default behavior if you don't specify the min value.

Can we drop this line?


For example, we have compared these two setups by using concurrent registrations test:

[width="100%",cols="50%,50%",options="header",]
|===
|{Project} VM with 8 CPUs, 40 GiB RAM |{Project} VM with 8 CPUs, 40 GiB RAM
|`--foreman-foreman-service-puma-threads-min=0` |`--foreman-foreman-service-puma-threads-min=16`
|`--foreman-foreman-service-puma-threads-max=16` |`--foreman-foreman-service-puma-threads-max=16`
|`--foreman-foreman-service-puma-workers=2` |`--foreman-foreman-service-puma-workers=2`
|===

Setting the minimum Puma threads to `16` results in about 12% less memory usage as compared to `threads_min=0`.
For example, we have compared these two setups on a virtual machine with 8 CPUs and 40 GiB RAM using concurrent registrations test.
They both used `--foreman-foreman-service-puma-threads-max=16` and `--foreman-foreman-service-puma-workers=2`.
Setting the minimum Puma threads to `16` by using `--foreman-foreman-service-puma-threads-min=16` results in about 12% less memory usage as compared to `0`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is the default behavior, should we drop this line altogether and avoid users touching --foreman-foreman-service-puma-threads-min?