Skip to content

Draft: Introduce GVL instrumentation via gvltools gem

Igor requested to merge igor-gvltools into master

What does this MR do and why?

Thus far we don't have reliable data on GVL contention. We estimate it by looking at CPU time spent by the ruby process, but this is potentially very unreliable.

In Ruby 3.2, a GVL instrumentation API was introduced. This allows tracing scheduler and GVL events. There is the gvltools gem that makes use of this API.

The instrumentation introduces some overhead. The exact overhead is unknown, the gem authors cite 1-5%. Further testing is needed.

It may be possible to sample either a subset of pods, requests, or time to reduce the overhead, if it's deemed too high. It may be worth paying 1-2% for increased o11y though.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports