I've a Digital Ocean Droplet that has a Rails App running Puma
as it's web-server and Nginx
as it's Web Proxy.
Puma silently crashes every few hours after bootup, then I get a notification from Uptime Robot and I start Puma again. There isn't anything of importance in the Puma Access Log and the Puma Error Log only has server start-up information:
=== puma startup: 2015-04-07 00:12:08 -0400 ===
* Listening on unix:///home/deploy/apps/kholopk/shared/tmp/sockets/kholopk-puma.sock
=== puma startup: 2015-04-07 02:19:16 -0400 ===
* Listening on unix:///home/deploy/apps/kholopk/shared/tmp/sockets/kholopk-puma.sock
=== puma startup: 2015-04-07 04:15:19 -0400 ===
* Listening on unix:///home/deploy/apps/kholopk/shared/tmp/sockets/kholopk-puma.sock
=== puma startup: 2015-04-07 06:16:15 -0400 ===
* Listening on unix:///home/deploy/apps/kholopk/shared/tmp/sockets/kholopk-puma.sock
This is what my Droplet graphs look like:
There's an Open Github Issue about this, here: Puma silently crashed #554 but it wasn't of much help. I even tried downgrading Puma to 2.7.1
like one user said but that didn't help either.
I'm using Ruby 2.2
, Rails 4.2
, Puma 2.11.1
and This is how I set up my Droplet. These are my Puma Capistrano Configurations:
set :puma_threads, [4, 16]
set :puma_workers, 0
set :pty, true
set :use_sudo, false
set :stage, :production
set :deploy_via, :remote_cache
set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}"
set :puma_bind, "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock"
set :puma_state, "#{shared_path}/tmp/pids/puma.state"
set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
set :puma_access_log, "#{release_path}/log/puma.error.log"
set :puma_error_log, "#{release_path}/log/puma.access.log"
set :ssh_options, { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) }
set :puma_preload_app, true
set :puma_worker_timeout, nil
set :puma_init_active_record, false # Change to true if using ActiveRecord