Skip to content

Draft: Tweak Puma Ruby GC in webservice Chart

Matthias Käppler requested to merge mk-set-ruby-gc-init-slots into master

Note: This should be the last step in gitlab-com/gl-infra/production#3680 (closed)

What does this MR do?

Our application is memory heavy and allocates a lot of long-lived objects during boot, since Puma/Rails preload the application. We measured the required heap slots to be just under 3M, and found that sizing the heap accordingly comes with a reduction in memory use and decrease in start-up time, since the GC has less work to do and allocates fewer heap pages upfront.

For now this is meant to apply to Puma only; we are not targeting Sidekiq yet.

Related issues

gitlab-org/gitlab#289838 (closed)

Test plan

  1. run webservice pod with these changes applied
  2. shell into pod and run env | grep RUBY_GC_HEAP_INIT_SLOTS
  3. verify the output is RUBY_GC_HEAP_INIT_SLOTS=3000000

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

Edited by Matthias Käppler

Merge request reports