1

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:

Droplet Bandwidth Graph Droplet CPU Graph

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
Sheharyar
  • 73,588
  • 21
  • 168
  • 215
  • Can you paste your puma.error.log to better understand what your problem is caused by? – r4m Apr 08 '15 at 09:23
  • @r4m I've already pasted it above – Sheharyar Apr 08 '15 at 09:24
  • Another place to look is `/var/log/syslog`. If you run out of memory, the kernel could be killing the process. – andrewsomething Apr 08 '15 at 14:34
  • @andrewsomething I just checked it, there's nothing related to my app in `/var/log/syslog`. The last entry in it is from a month ago, when I first created the droplet. – Sheharyar Apr 08 '15 at 14:48
  • I've been looking in to it, and this is possibly an issue with the Memory leaks in `Ruby 2.2.0` as mentioned here: [Does Ruby 2.2 have Memory Issues?](http://stackoverflow.com/questions/27653207/does-ruby-2-2-have-memory-issues-on-heroku) – Sheharyar Apr 08 '15 at 17:56

0 Answers0