A Fast, Concurrent Web Server for Ruby & Rack
Current Release: 5.5.0
Unlike other Ruby Webservers, Puma was built for speed and parallelism. Puma is a small library that provides a very fast and concurrent HTTP 1.1 server for Ruby web applications. It is designed for running Rack apps only.
What makes Puma so fast is the careful use of a Ragel extension to provide fast, accurate HTTP 1.1 protocol parsing. This makes the server scream without too many portability issues.
If you are using Bundler, just add Puma to your project's Gemfile:
Once you've installed your bundle, start Puma by running:
bundle exec puma
If you are not using Bundler, you can install Puma directly from the command line:
gem install puma
Once installed, start Puma by running:
Puma - 78 Mb
Rainbows! (1x16) - 120 Mb
Unicorn - 1076 Mb
Rainbows! (16x32) - 1138 Mb
|Puma (16:16, KA)||4589||8849||12245||14601||15909||14419||12939||12564||12701||12538|
|Rainbows! (1x16, KA)||775||1336||1715||2006||2271||2085||732||1092||634||315|
|Rainbows! (16x32, KA)||760||1479||2200||2853||3464||5413||7320||7350||7273||6419|
Puma comes from a long line of ruby webservers derived from Zed Shaw's seminal work on Mongrel. The primary element that remains is Mongrel's great HTTP parser written in ragel and executed in either C or Java, depending on the ruby implementation.
Evan Phoenix looked at Mongrel and saw a chance to take the idea and move it forward to incorporate two elements absent from the original work. Firstly, the Ruby world has moved almost entirely to use Rack as the primary interface for web apps. Mongrel was written in a pre-Rack world, so the first thing Puma did was cut out all the unnecessary abstractions and support the Rack interface directly. Second, Puma is designed to be used on a Ruby implementation which provides true parallelism, such as Rubinius and JRuby. Tuning for the capability and patterns that these implementations provide meant rethinking how requests entered the system and were handled. Incorporating these ideas, Puma was born from Mongrel and began moving forward.
Today, Puma runs on all Ruby implementations, but will always run best on any implementation that provides true parallelism. It looks to provide a simple and high performance request/response pipeline to Rack apps, allowing it to be used by nearly all ruby web applications.
Puma was created by Evan Phoenix in late 2011 as a derivative of Mongrel. Now, most of the original Mongrel code has been rewritten except for the parser. The git history for the project provides a timeline of the evolution of the project.