Welcome to Puma 7: Romantic Warrior.
Puma 7 brings better tail latency for keepalive-heavy traffic, support for fiber-per-request runtimes, and a handful of cleanup and compatibility changes across the server.
Here's what you should do:
- Review the Upgrade section below to look for breaking changes that could affect you.
- Upgrade to version 7.0 in your Gemfile and deploy.
- Open up a new bug issue if you find any problems.
- Join us in building Puma! We welcome first-timers. See CONTRIBUTING.md.
For a complete list of changes, see History.md.
What's New
Puma 7 is focused on request lifecycle improvements and long-request correctness.
- Better tail behavior for keepalive connections.
Puma7 includes a high-effort fix for long tail response behavior with keepalive clients. - Fiber-per-request support.
Pumanow supports fiber-per-request execution. rack.response_finishedsupport.Pumanow supports theRackhook for response completion.- Custom request logging support. You can plug in a custom logger for request logs.
Upgrade
Check the following list to see if you're depending on any of these behaviors:
- The default
max_keep_aliveis now999. - The default
persistent_timeoutis now65seconds. - Hook methods now raise
ArgumentErrorif called without a block. - For Rack > 3.1,
Pumano longer setsenv['HTTP_VERSION']. Puma::Runner#ruby_enginehas been removed.preload_app!is now the default in cluster mode. If you need the old behavior, setpreload_app! falseexplicitly.Configurationmust beclamp-ed before reading values.- Response headers are now normalized to lowercase.
- The minimum supported Ruby version is now 3.0.
- Callback hook names have been renamed:
| Old hook name | New hook name |
|---|---|
on_worker_boot |
before_worker_boot |
on_worker_shutdown |
before_worker_shutdown |
on_restart |
before_restart |
on_booted |
after_booted |
on_stopped |
after_stopped |
on_refork |
before_refork |
on_thread_start |
before_thread_start |
on_thread_exit |
before_thread_exit |
on_worker_fork |
before_worker_fork |
Then, update your Gemfile:
gem 'puma', '< 8'