We switched from Unicorn (process model) to Puma (threaded model) to decrease the memory footprint of our Rails production web server. Memory indeed dropped from 6GB to only 1GB!
We just had to decrease our worker count and increase our thread count instead. Performance (response time and throughput) remained the same, if not slightly better. We had no thread-safety errors, which was good.
Free bonus points are:
- Requests are blazing fast on our dev and staging environments!
- Puma has first-class support for WebSockets, so we know for sure that Rails ActionCable or GraphQL subscriptions will work great.
- Being on Puma makes us even more "default Rails"-compliant since it is the default Rails web server these days.
have you guys tried Phusion Passenger?
Some of us have had bad experiences with Phusion Passenger back in the day:
- too much hassle to compile custom nginx modules
- upgrades were a pain as you had to recompile code just for a version bump
Maybe things have improved since then, but we didn't want to take any chance. Puma (or Unicorn) work out of the box.