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

update puma threads tunings #3248

merged 1 commit into from
Dec 11, 2024

Conversation

Imaanpreet
Copy link
Contributor

@Imaanpreet Imaanpreet commented Aug 30, 2024

What changes are you introducing?

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

Checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • Foreman 3.13
  • Foreman 3.12/Katello 4.14 (Satellite 6.16)
  • Foreman 3.11/Katello 4.13
  • Foreman 3.10/Katello 4.12
  • Foreman 3.9/Katello 4.11 (Satellite 6.15; orcharhino 6.8/6.9/6.10)
  • Foreman 3.8/Katello 4.10
  • Foreman 3.7/Katello 4.9 (Satellite 6.14)
  • Foreman 3.6/Katello 4.8
  • Foreman 3.5/Katello 4.7 (Satellite 6.13; orcharhino 6.6/6.7)
  • We do not accept PRs for Foreman older than 3.5.

Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

three more small suggestion, then I'd merge.

guides/common/modules/con_puma-threads.adoc Outdated Show resolved Hide resolved
guides/common/modules/con_puma-threads.adoc Outdated Show resolved Hide resolved
guides/common/modules/con_puma-threads.adoc Outdated Show resolved Hide resolved
@Imaanpreet
Copy link
Contributor Author

@maximiliankolb Hello, if all looks good to you can I squash all the commits into one?

Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

Thanks @Imaanpreet diff LGTM. Merging is currently blocked by GitHub. Please rebase to "master" and resolve the merge conflicts.

@pr-processor pr-processor bot added the Waiting on contributor Requires an action from the author label Sep 6, 2024
@maximiliankolb
Copy link
Contributor

triage: @Imaanpreet friendly reminder: please rebase to "master" and resolve the merge conflict. diff LGTM

@pr-processor pr-processor bot added Needs re-review and removed Waiting on contributor Requires an action from the author labels Sep 25, 2024
@Imaanpreet
Copy link
Contributor Author

Sorry for delayed changes @maximiliankolb, I have missed your reminder.
Thank you for checking.

Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

One small fix, then we're good to go.

guides/common/modules/con_puma-threads.adoc Outdated Show resolved Hide resolved
@pr-processor pr-processor bot added Waiting on contributor Requires an action from the author Needs re-review and removed Needs re-review Waiting on contributor Requires an action from the author labels Oct 1, 2024
Apply suggestions from code review

looks good. thank you guys!

Co-authored-by: Aneta Šteflová Petrová <[email protected]>
Copy link
Contributor

@maximiliankolb maximiliankolb left a comment

Choose a reason for hiding this comment

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

LGTM

@asteflova
Copy link
Member

@Imaanpreet You are requesting cherry picks into a few selected versions only, skipping quite a few in between. Is there a reason for that?

I'd also appreciate it if you provided some more details about this update by filling out the template in the PR description.

@Imaanpreet
Copy link
Contributor Author

Hello Team, I am not sure why I can't get the updates (via emails) and I end up delaying the response :(
Yes, please go ahead and updates all the foreman versions as selected above.

@asteflova asteflova added tech review done No issues from the technical perspective style review done No issues from docs style/grammar perspective Needs tech review Requires a review from the technical perspective and removed tech review done No issues from the technical perspective labels Nov 7, 2024
@maximiliankolb
Copy link
Contributor

maximiliankolb commented Nov 7, 2024

@Imaanpreet Please ping an engineer to do a technical review.

@jhutar
Copy link
Contributor

jhutar commented Dec 11, 2024

Hello @maximiliankolb ! Basically Imaan is the engineer here who measured this stuff. I approve this PR.

@asteflova asteflova added tech review done No issues from the technical perspective and removed Needs tech review Requires a review from the technical perspective labels Dec 11, 2024
@asteflova asteflova merged commit 1675c0a into theforeman:master Dec 11, 2024
9 checks passed
asteflova pushed a commit that referenced this pull request Dec 11, 2024
(cherry picked from commit 1675c0a)
asteflova pushed a commit that referenced this pull request Dec 11, 2024
(cherry picked from commit 1675c0a)
@asteflova
Copy link
Member

Merged to "master" and cherry-picked:

@asteflova
Copy link
Member

Hello @maximiliankolb ! Basically Imaan is the engineer here who measured this stuff. I approve this PR.

Thanks for the additional ack, @jhutar! To explain: We've been evaluating our review process and part of that is standardizing who we ask to review doc PRs. For example, one suggestion that has been floated around recently is to ask a developer and a QA engineer to review each doc PR, to get multiple perspectives. Thanks for working with us on this PR.

@asteflova
Copy link
Member

@Imaanpreet Thank you for working on this! I hit a conflict on 3.11 so I didn't cherry-pick there. If you think the update should be included on 3.11 and below, can you please create a separate PR? If you don't think it's necessary, I'm fine with that too.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I still have a strong opinion that users shouldn't touch these values if we can avoid it. The values are automatically determined and if that's incorrect then we should fix it. For example, theforeman/puppet-foreman#1197.

My preference would be to drop this whole chapter or make it more like Puma's official documentation (https://msp-greg.github.io/puma/#thread-pool) with specific recommendations for our application.

@@ -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?

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style review done No issues from docs style/grammar perspective tech review done No issues from the technical perspective
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants