Tweak GC settings in pipeline config
What does this MR do?
This MR sets a few Ruby GC env variables in order to speed up the CI suite time a bit.
Settings:
ENV_VAR | description | note |
---|---|---|
RUBY_GC_HEAP_INIT_SLOTS | Initial allocation slots. Introduced in Ruby 2.1, default: 10000. | Less allocations on boot if increased |
RUBY_GC_MALLOC_LIMIT | The initial limit of young generation allocation from the malloc-family. GC will start when this limit is reached. Default: 16MB | Increasing this value reduces the number of GC runs |
RUBY_GC_MALLOC_LIMIT_MAX | The maximum limit of young generation allocation from malloc before GC starts. Prevents excessive malloc growth due to RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR. Introduced in Ruby 2.1, default: 32MB. | 2 x RUBY_GC_MALLOC_LIMIT |
RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR | Increases the limit of young generation malloc calls, reducing GC frequency but increasing malloc growth until RUBY_GC_MALLOC_LIMIT_MAX is reached. Introduced in Ruby 2.1, default: 1.4, minimum: 1.0 (no growth) | |
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR | Perform a full GC when the number of old objects is more than R * N, where R is this factor and N is the number of old objects after the 3 last full GC. Introduced in Ruby 2.1.1, default: 2.0 | Defer full GC if increased |
RUBY_GC_OLDMALLOC_LIMIT | The initial limit of old generation allocation from malloc, a full GC will start when this limit is reached. Introduced in Ruby 2.1, default: 16MB | |
RUBY_GC_OLDMALLOC_LIMIT_MAX | The maximum limit of old generation allocation from malloc before a full GC starts. Prevents excessive malloc growth due to RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR. Introduced in Ruby 2.1, default: 128MB |
Source: https://github.com/ruby/ruby/blob/master/man/ruby.1
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Adam Hegyi