JRuby max requests per instance

The jruby_max_requests_per_instance setting determines the maximum number of HTTP requests a JRuby handles before it's terminated. When a JRuby instance reaches this limit, it's flushed from memory and replaced with a fresh one.

Console node group

PE Master

Parameter

puppet_enterprise::master::puppetserver::jruby_max_requests_per_instance

This parameter is the same as the max_requests_per_instance parameter in the pe-puppet-server.conf settings and in open source Puppet.

Default value

0

  • The default value for the jruby-puppet.max-requests-per-instance setting in pe-puppetserver (which is configurable via the puppet_enterprise::master::puppetserver::max_requests_per_instance parameter in Hiera) has changed from 100000 to 0. This disables JRuby instance flushing.

  • Changing the jruby-puppet.max-requests-per-instance setting results in a full restart of the pe-orchestration-services, which is required to clear any leaked memory, rather than a service reload which was previously required.

Accepted values

An integer representing a number of HTTP requests

How to calculate

More frequent JRuby flushing can help address memory leaks, because it prevents any one interpreter from consuming too much RAM. However, performance is reduced slightly each time a new JRuby instance loads. Therefore, set this parameter to get a new interpreter no more than once every few hours.

Requests are balanced across multiple interpreters running concurrently, so the lifespan of each interpreter varies.