Search code examples
performanceruby-on-rails-5pumaruby-2.5

Why does Puma respond slow or hang in clustered mode on Ruby 2.5.4


I'm adding this question because it took me a long time to even figure out that it was caused by upgrading to Ruby 2.5.4. I'm not sure of the minimal case that can reproduce this issue, but I'm running a Rails 5 app on Puma 3.11 in clustered mode in a docker container on a Kubernetes cluster managed by Cloud66 in Google Cloud Platform.

When I start the server in clustered mode (which has been our default configuration for years), on ruby 2.5.4, the server takes a minute or more to respond, or more often never responds at all, even to a static file request (i.e. curl localhost:3000/404.html)

I found this bug that I believe is related (but could be a coincidence, since nobody else has reported this specific behavior in relation to it): https://github.com/puma/puma/issues/1674

Is this a ruby bug? Are others experiencing this? Is there a workaround (aside from reverting to Ruby 2.5.3)?


Solution

  • It turns out this bug was reported and I missed it because it's closed already as fixed in Ruby 2.5.5! https://github.com/puma/puma/issues/1744

    (Unfortunately there is not a 2.5.5 tag in the ruby repository on dockerhub yet, but the 2.5 tag does include the fix already)