Skip to content

Adjust RUBY_GLOBAL_METHOD_CACHE_SIZE on the web fleet

We have been seeing increased cpu utilization on the web fleet and it might be worthwhile adjusting RUBY_GLOBAL_METHOD_CACHE_SIZE

comments by @stanhu in https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5667

This signature looks awfully like the Ruby method cache: https://engineering.shopify.com/17489064-tuning-rubys-global-method-cache

We may want to try increasing RUBY_GLOBAL_METHOD_CACHE_SIZE environment variable from the default 2K to 64K or so. Then we should consider shipping this value as the default in Omnibus when we compile Ruby or dynamically in the Rails ENV.

I suggest we try this out on staging/canary first and then a server in prod to see if it helps.