puma /puma

A Ruby/Rack web server built for parallelism

★ 7,928⑂ 1,519👁 170⑃ 2,214● 1,820▤ 82
RubyBSD-3-ClauseCreated 2011-09-23puma.io
Download: v8.1.1v8.1.1 ↓8.1.12026-11-15
+0
Daily
7,928
stars
1,519
forks
170
watchers
2,214
prs
1,820
issues
82
releases

README

Puma: A Ruby Web Server Built For Parallelism




  
    
    
  


Puma is a simple, fast, multi-threaded, and highly parallel HTTP 1.1 server for Ruby/Rack applications.

 Built For Speed & Parallelism

Puma is a server for Rack-powered HTTP applications written in Ruby.  It is:
 Multi-threaded. Each request is served in a separate thread. This helps you serve more requests per second with less memory use.
 Multi-process. "Pre-forks" in cluster mode, using less memory per-process thanks to copy-on-write memory.
 Standalone. With SSL support, zero-downtime rolling restarts and a built-in request bufferer, you can deploy Puma without any reverse proxy.
 Battle-tested. Our HTTP parser is inherited from Mongrel and has over 15 years of production use. Puma is currently the most popular Ruby webserver, and is the default server for Ruby on Rails.

Originally designed as a server for Rubinius, Puma also works well with Ruby (MRI) and JRuby.

On MRI, there is a Global VM Lock (GVL) that ensures only one thread can run Ruby code at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing IO waiting to be done in parallel. Truly parallel Ruby implementations (TruffleRuby, JRuby) don't have this limitation.

 Quick Start


$ gem install puma
$ puma


Without arguments, puma will look for a rackup (.ru) file in
the working directory called config.ru.

 SSL Connection Support

Puma will install/compile with support for ssl sockets, assuming OpenSSL
development files are installed on the system.

If the system does not have OpenSSL development files installed, Puma will
install/compile, but it will not allow ssl connections.

 Frameworks

 Rails

Puma is the default server for Rails, included in the generated Gemfile.

Start your server with the rails command:


$ rails server


Many configuration options and Puma features are not available when using rails server. It is recommended that you use Puma's executable instead:


$ bundle exec puma


 Sinatra

You can run your Sinatra application with Puma from the command line like this:


$ ruby app.rb -s Puma


In order to actually configure Puma using a config file, like puma.rb, however, you need to use the puma executable. To do this, you must add a rackup file to your Sinatra app:

ruby
 config.ru
require './app'
run Sinatra::Application


You can then start your application using:


$ bundle exec puma


 Configuration

Puma provides numerous options. Consult puma -h (or puma --help) for a full list of CLI options, or see Puma::DSL or dsl.rb.

You can also find several configuration examples as part of the
test suite.

For debugging purposes, you can set the environment variable PUMA_LOG_CONFIG with a value
and the loaded configuration will be printed as part of the boot process.

 Documentation

 Configuration
 Cluster mode
 Binding TCP / Sockets and SSL
 Control/Status Server and stats
 Restart
 Signals
 Plug

Top issues

Discussions

Latest release

v8.1.1 v8.1.1 2026-11-15
Bugfixes
   Fix pumactl stop and SIGINT hanging in cluster mode when an after_stopped hook owns child processes (4135)
   Fix TLS stream corruption on TruffleRuby when flushing to a full socket (4108)
   Stop shipping development-only files in the gem (4124)

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON