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 Gem to 5.6.5 #51929

Merged
merged 2 commits into from May 23, 2023
Merged

Update puma Gem to 5.6.5 #51929

merged 2 commits into from May 23, 2023

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented May 16, 2023

Also switch back to mainline. Target 5.x for compatibility with Ruby 3.

This should be a relatively safe upgrade, despite taking us through two major versions. The main breaking change in 4.x was the switch to nio4r for I/O management, and in 5.x it was removal of support for plugins and versions of Ruby that we do not use.

From what I can tell, we maintained a custom branch for two reasons: one was to provide the log_stats plugin we were using for some performance monitoring. We don't use this data anywhere and don't need to keep collecting it, so the simple solution is to remove the monitoring logic.

The other reason was to implement some performance fixes. Specifically, we add some logic to attempt to balance incoming requests between worker threads in a more informed way. According to Will's notes, we were getting some performance improvements out of this. Puma 5.6.5 does not include our custom logic, but does include this alternative authored by the folks at GitLab which instructs busy worker threads to be less eager to pick up new jobs, thereby allowing the jobs to be distributed to other workers. According to some of Will's notes in that PR, we did also get performance improvements from this change but it's not clear to me how much or how they compare to the other set of improvements.

Ultimately, my proposal at this point is that we simply apply this update and see what the performance implications are. It should be straightforward to revert if we're unhappy with the effects.

Links

Testing story

For correctness testing, I tested locally and on an adhoc that loading the site works fine both on Ruby 2.7 and 3.0.

For performance testing, we plan to rely on post-merge monitoring.

Deployment strategy

Because this is a low-level dependency with a lot of potential performance implications, we plan to deploy this in a standalone deploy after our main deploy with a closed pipeline and a revert prepped.

Hamms added 2 commits May 16, 2023 13:56
Also switch back to mainline. Target 5.x for compatibility with Ruby 3

TODO: identify whether the changes in our custom branch are included in this version of puma, and if not whether we still need them.

- https://github.com/puma/puma/blob/master/5.0-Upgrade.md#welcome-to-puma-5-spoony-bard
…oesn't provide the log_stats plugin. TODO: verify that we don't actually need this logging anymore
@Hamms Hamms added the Ruby Update Everything related to work to update the version of Ruby our codebase runs on label May 18, 2023
@Hamms Hamms requested review from a team May 18, 2023 20:27
@Hamms Hamms marked this pull request as ready for review May 18, 2023 20:27
@cat5inthecradle
Copy link
Contributor

🎉

@Hamms Hamms merged commit e008442 into staging May 23, 2023
1 of 2 checks passed
@Hamms Hamms deleted the puma-5.6.5 branch May 23, 2023 21:01
@Hamms Hamms mentioned this pull request Jun 7, 2023
@Hamms Hamms mentioned this pull request Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ruby Update Everything related to work to update the version of Ruby our codebase runs on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants