Answer the question
In order to leave comments, you need to log in
Why does Monit create a zombie ruby process (Rails+Puma)?
Good afternoon! There was a problem in production while monitoring the processes of a Rails application with a Puma server. For monitoring and autostart I use Monit. It successfully starts the Puma server, the workers start, they start eating resources, as expected, but then, after 20 seconds, the workers become zombies with zero resources, and then they try to start again, and everything goes into a closed loop - there are resources - zombies - there are resources. Accordingly, the application does not respond to requests. Here is the Monit script in /etc/monit/conf.d/puma.monit:
check process puma with pidfile /usr/local/src/my_site/shared/tmp/puma.pid
group puma
start program = "/bin/su username -c 'cd /usr/local/src/my_site/current && ( RACK_ENV=production /usr/bin/env bundle exec puma -C /usr/local/src/my_site/shared/config/puma.rb --daemon )'"
stop program = "/bin/su username -c 'cd /usr/local/src/my_site/current && ( bundle exec pumactl -P /usr/local/src/my_site/shared/tmp/puma.pid stop)'"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question