O'Reilly logo

Heroku Cookbook by Mike Coutermarsh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up and running Puma on Heroku

Puma is a lightweight Ruby web server that was built for concurrency. It is a great alternative to Unicorn and works well on Heroku. Like Unicorn, Puma allows us to get more performance out of our dynos by responding to multiple requests simultaneously. It does this while maintaining a smaller memory footprint than Unicorn and has shown very impressive benchmarks when load tested.

The primary difference between Puma and Unicorn is that Puma will run multiple threads within a single process. This is an important distinction, because while processes have their own unique memory space, threads do not. This means our application's code must be thread safe.

The danger of code that is not thread safe is that separate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required