zombocom / puma_worker_killer

Automatically restart Puma cluster workers based on max RAM available
747 stars 77 forks source link

POC: Puma Worker Killer based on requests count #80

Closed ylecuyer closed 4 years ago

ylecuyer commented 4 years ago

This is a proof of concept based on https://github.com/puma/puma/pull/2106 It mimics the PassengerMaxRequests configuration of passenger : https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequests and kills workers after 10k requests

Here is a demo: https://youtu.be/ZUho9KCQGXk

schneems commented 4 years ago

Can you tell me more about the desire here? I think this can be implemented better as a separate middleware. Basically in the middleware you can simply exit(1) or raise a sigterm in the existing process, then puma will bring it back up. My preference would be to not add this directly to puma worker killer. If you make another gem, then I can link it in the README.