May 16, 2015 by Daniel P. Clark

Switching From Unicorn to Puma on Heroku is Easy!

I’ve had my project running on Heroku with Unicorn for some time now.  Not that long ago Heroku put out a notice advising people to switch over to Puma as Unicorn doesn’t do well with low latency connections.  And you know that with the internet you’re always going to have people with slow connections accessing your service.  Also upon looking into it further Puma it looks like it performs better than all the other server control environments.  Puma’s key advantage being it does things with threads really well.

First I’ll show what I had for my Unicorn server setup.


The configuration file in config/unicorn.rb

The line in Procfile

And the Gemfile

From hear it was as easy as switching the Profile and Gemfile and adding a Puma config file.


The configuration file config/puma.rb

The only thing I had to change from the default was the environment variable used for the Redis server.

Changed the Profile to

And the Gemfile to

After that it’s the normal push to the Heroku server with git and everything works!


It’s easy, it’s better, so you might as well just go ahead and do it.  Feel free to look at Heroku’s howto if you’d like.  Deploying Rails Applications with the Puma Web Server  I’ve pretty much covered it here.

Please feel free to comment, share, subscribe to my RSS Feed, and follow me on twitter @6ftdan!

God Bless!
-Daniel P. Clark

Image by Tambako The Jaguar via the Creative Commons Attribution-NoDerivs 2.0 Generic License.

#change#easy#heroku#puma#rails#ruby on rails#switch#unicorn
0 0 vote
Article Rating
Notify of
Newest Most Voted
Inline Feedbacks
View all comments
Swapnesh Khare
Swapnesh Khare
6 years ago

I have a Rails app currently running on Unicorn. I want to shift to Puma in such a way that the heavy requests are directed to the Puma server and the rest run like before on Unicorn. I’m using nginx. Is it possible?

Daniel P. Clark
6 years ago
Reply to  Swapnesh Khare

I don’t think that will work. The Procfile determines which process is used for “web” and your Rails instance handles requests there.