discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
525 stars 153 forks source link

Support malloc / oldmalloc increase bytes limit GC stat #305

Closed booleanbetrayal closed 5 months ago

booleanbetrayal commented 5 months ago

This PR adds support for Ruby GC statistic metrics malloc_increase_bytes_limit and oldmalloc_increase_bytes_limit. These metrics are useful in determining malloc limits for GC tuning, preventing unnecessary limit threshold recalculations and expansion.

We use these values from Production to tune RUBY_GC_MALLOC_LIMIT and RUBY_GC_OLDMALLOC_LIMIT accordingly.

We see that appropriate tuning of these metrics can help to alleviate immediate cold start / reboot request latency in our application.

see also: https://blog.appsignal.com/2021/11/17/practical-garbage-collection-tuning-in-ruby.html see also: https://engineering.appfolio.com/appfolio-engineering/2018/6/27/ruby-memory-environment-variables-simpler-than-they-look

SamSaffron commented 5 months ago

looks good, sure we can add

booleanbetrayal commented 5 months ago

thanks @SamSaffron !