0

I've always used unicorn as my application server but relatively recently I noticed that puma now has the clustered mode, so I wonder if there is any reason to use puma in the clustered mode instead of unicorn considering that my code is not thread-safe and therefore I can't use threads?

  • I am using MRI 2.2
NoDisplayName
  • 15,246
  • 12
  • 62
  • 98

1 Answers1

1

This depends on your application to a certain degree. If it has lots of long-running requests you may see some benefit, but if that's the case it sounds like Thin is a better option given your constraints.

Puma performs very well with Rubinius or JRuby; the GVL in MRI will cause it not to perform as well with MRI. As such you won't see a performance benefit from switching away from Unicorn if your application is primarily serving up fast responses (API server, for example).

There's some formal benchmarking here and here.

Marcus Walser
  • 5,101
  • 1
  • 14
  • 8
  • I can't use neither puma with threads (the code is not thread-safe) nor thin (the code is not written in the evented style). I have a vanilla rails app and I wonder if there's any difference in performance between let's say having 3 workers of unicorn and 3 workers of puma each with 1 thread? – NoDisplayName May 09 '15 at 03:41