title: Can I restart Puma workers after a maximum number of requests?
body: <p>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.</p>
  <p>The documentation for the passenger feature is <a href="https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#PassengerMaxRequests" rel="noreferrer">here</a>:</p>
  <blockquote>
  <p>PassengerMaxRequests </p>
  <p>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.</p>
  <p>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.</p>
  </blockquote>
  <p>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.</p>