Skip to content

Commit 64c8b2d

Browse files
authored
Add note about RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR (#513)
For example, RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=0.9 causes launching time penalty: * ruby-3.3.4(YJIT) 0.9 ~40 secs * ruby-3.2.5(YJIT) 0.9 ~3 secs * ruby-3.1.6(YJIT) 0.9 ~1 secs * ruby-3.0.7 0.9 ~1 secs See fluent/fluentd#4545 Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent ca4e978 commit 64c8b2d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

deployment/performance-tuning-single-process.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ Here's a quote from the documentation:
7474
> Do full GC when the number of old objects is more than R * N
7575
> where R is this factor and N is the number of old objects just after last full GC.
7676
77-
So, the default GC behavior does not call full GC until the number of old objects reaches `2.0 * before old objects`. This improves the throughput but it grows the total memory usage. This setting is not good for the low resource environment e.g. a small container. For such cases, try `RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=0.9` or `RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.2`.
77+
So, the default GC behavior does not call full GC until the number of old objects reaches `2.0 * before old objects`. This improves the throughput but it grows the total memory usage. This setting is not good for the low resource environment e.g. a small container. For such cases, try `RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.2`.
78+
79+
{% hint style='danger' %}
80+
Do not set a value lower than `1.0` unless there is a special reason, because there are cases where setting a value lower than `1.0` causes a performance degrade. e.g. delay of launching Fluentd.
81+
{% endhint %}
7882

7983
See [Ruby 2.1 Garbage Collection: ready for production](https://samsaffron.com/archive/2014/04/08/ruby-2-1-garbage-collection-ready-for-production) and [Watching and Understanding the Ruby 2.1 Garbage Collector at Work](https://thorstenball.com/blog/2014/03/12/watching-understanding-ruby-2.1-garbage-collector/) articles for more detail.
8084

0 commit comments

Comments
 (0)