Phusion Passenger offers the ability to restart worker processes after N requests to handle memory issues, and I was wondering does Puma have a similar setting? I've not been able to find anything appropriate in the documentation or code, but I've not used Puma much before so may be missing something.
The documentation for the passenger feature is here:
PassengerMaxRequests
The maximum number of requests an application process will process. After serving that many requests, the application process will be shut down and Phusion Passenger will restart it. A value of 0 means that there is no maximum: an application process will thus be shut down when its idle timeout has been reached.
This option is useful if your application is leaking memory. By shutting it down after a certain number of requests, all of its memory is guaranteed to be freed by the operating system.
I've currently got the problem on Heroku where we're hitting memory quota limits on our Rails application after about 12-14 hours, purely because GC is causing the memory usage to step up dramatically. I'm going to try and tune our GC settings as well, but I've found this a useful feature in production environments in the past so would still like to set it if it's available.