Project

General

Profile

« Previous | Next » 

Revision a23ae56c

Added by peterzhu2118 (Peter Zhu) about 2 years ago

Add REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO

[Feature #19571]

This commit adds the environment variable
RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO which is
used to calculate the remembered_wb_unprotected_objects_limit using a
ratio of old_objects. This should improve performance by reducing
major GC because, in a major GC, we mark all of the old objects, so we
should have more uncollectible WB unprotected objects before starting a
major GC. The default has been set to 0.01 (1% of old objects).

On one of Shopify's highest traffic Ruby apps, Storefront Renderer,
we saw significant improvements after deploying this patch in
production. In the graphs below, we have the tuned group which uses
RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO=0.01 (the
default value), and an untuned group, which turns this feature off
with RUBY_GC_HEAP_REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO=0. We
see that the tuned group spends significantly less time in GC, on
average 0.67x of the time compared to the untuned group and 0.49x for
p99. We see this improvement in GC time translate to improvements in
response times. The average response time is now 0.96x of the time
compared to the untuned group and 0.86x for p99.

https://user-images.githubusercontent.com/15860699/229559078-e23e8ce4-5f1f-4a2f-b5ef-5769f92b8c70.png