Puma is the most popular1 web server for running Ruby applications. If you’ve recently started working on a new Rails application, chances are you’re using Puma to serve HTTP traffic, as it is the default Ruby on Rails server. Puma has stood the test of time, having gone through three major Ruby versions and been around for over 15 years, making it a treasure trove of interesting and mature design decisions.
The purpose of this article is to take a deep dive into the internals of a real, battle-tested web server, explore the trade-offs it makes, and highlight curiosities I personally find interesting. If you want a brief overview or condensed practical guidance instead, refer to Puma’s documentation.
If you want to learn more about how real HTTP servers operate, are studying socket programming and want to build a toy web server inspired by a real example, or if you’re a seasoned veteran curious about the design choices behind the most popular Ruby web server, this article will hopefully have something to offer you.
If you’re a Ruby programmer, this article may introduce you to concepts that you may not have known about or previously worked with.