+0
日增长
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
PlugTop issues
#2697Import maps and performance (HTTP/2)58 comments · 2021-09-13#3788Puma 7 on JRuby is 20 times slower on TechEmpower40 comments · 2025-10-03#2188Spike an implementation of replacing minissl w/openssl36 comments · 2020-03-16#1889Replace parser C-extension with pure Ruby22 comments · 2019-08-06#3250Puma forces casing of certain response headers19 comments · 2023-10-05#3397Any way of receiving header values as an array instead of a string concatenated with commas?18 comments · 2024-06-02#3523No need for `Puma::NullIO` if Rack 3.1 is used?15 comments · 2024-10-15#3639Puma returns exit code 1 in docker container on SIGTERM12 comments · 2025-03-27
Discussions
#3890Much lower utilization with unchanged resource consumption on 7.0.03 comments · 2026-02-23#3887What happens when a request 'body' is sent without...1 comments · 2026-02-15#3835Keep-alive performance investigation (7.1.0+)1 comments · 2025-12-03#3806Intellisense-ability of config/puma.rb0 comments · 2025-10-23#3805CPU or CPU thread, that is the question2 comments · 2025-10-23#3789Rack handler spec for standardizing a custom puma/rails configuration0 comments · 2025-10-04#3775Puma 7 Plugin Compatibility1 comments · 2025-09-24#3768Perf finding: Removing mutexes and condition variables in favor of blocking on Queue#pop and using "poison" values to stop a queue.4 comments · 2025-09-22
Latest release
v8.1.1 v8.1.1 2026-11-15Bugfixes 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)