H
H
happyjedi2015-10-27 16:54:06
Ruby on Rails
happyjedi, 2015-10-27 16:54:06

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)'"

OS - Linux 3.13.0-042stab111.12 (Ubuntu 14.04, x86_64, English)
Monit version 5.14
If you start Puma manually from the user's console, then everything works fine, but of course there is no monitoring and autorun after server reboot. (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 )
Maybe someone I faced such a problem, I will be very grateful for advice?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
happyjedi, 2016-02-13
@happyjedi

The problem with monit was not resolved, so I switched to bluepill, which is similar to it - https://github.com/bluepill-rb/bluepill

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question