Generated by GPT-5-mini| Puma (web server) | |
|---|---|
| Name | Puma |
| Author | Evan Phoenix |
| Programming language | Ruby |
| Operating system | Cross-platform |
| License | MIT License |
Puma (web server) Puma is a high-performance, concurrent HTTP server for Ruby designed to serve Rack-based applications such as those built with Ruby on Rails, Sinatra (web framework), and Hanami (web framework). It targets both low-latency request handling and efficient resource usage on platforms ranging from single-host deployments to cluster environments used by organizations like GitHub, Shopify, and Heroku. Puma emphasizes a small, focused codebase and integrates with ecosystem tools including Bundler, Rake, and Capistrano.
Puma is implemented in Ruby (programming language) with optional integration of native extensions and operates as a threaded and clustered server for Rack (webserver interface). It provides an alternative to servers such as Unicorn (web server), Phusion Passenger, and Thin (web server), addressing concurrency and I/O patterns encountered by applications deployed on services like Amazon Web Services, Google Cloud Platform, and Microsoft Azure. Puma's design aligns with practices promoted by contributors from projects associated with RailsConf, RubyKaigi, and various open-source communities under licenses similar to those used by RubyGems projects.
Puma uses a hybrid model combining a master process with worker processes and thread pools, inspired by process models found in servers such as Nginx and Apache HTTP Server. Each worker runs a pool of threads to handle multiple connections concurrently, leveraging Ruby's native threading primitives in MRI (Matz's Ruby Interpreter) and compatibility layers for JRuby and TruffleRuby. Feature highlights include support for HTTP/1.1 keepalive, pipelining patterns, SSL/TLS termination, socket activation compatible with systemd, and integration points for logging frameworks used by Logstash and Fluentd. Puma exposes a control rack application and supports metrics collection compatible with Prometheus and tracing via projects like OpenTelemetry.
Benchmarks for Puma commonly compare throughput and latency against servers such as Unicorn (web server), Phusion Passenger, and Thin (web server), using workloads derived from applications like Discourse and sample apps from Rails Guides. Performance varies with interpreter choice—MRI (Matz's Ruby Interpreter) exhibits different characteristics than JRuby—and with system tuning involving epoll, kqueue, and TCP stack parameters found on Linux kernel and FreeBSD. Real-world adopters run Puma behind reverse proxies including Nginx or HAProxy to handle TLS termination and load balancing, a pattern advocated at conferences like Velocity Conference and in case studies from Heroku and GitHub Enterprise.
Puma is configured via a Ruby DSL configuration file and command-line options used in deployment workflows with tools such as Capistrano, Ansible, and Docker (software). Containerized deployments often build images referencing base images maintained by Debian, Alpine Linux, or Ubuntu, and orchestrators like Kubernetes and Docker Swarm are common for scaling Puma-backed services. Integration with process supervisors including systemd, supervisord, and runit supports zero-downtime deployments and rolling restarts, while cloud-native patterns leverage Helm (package manager) charts and service meshes like Istio for traffic management.
Puma's stability model emphasizes crash isolation through worker processes and graceful restart semantics similar to mechanisms used by Unicorn (web server) and Phusion Passenger. Security practices for Puma deployments involve configuring OpenSSL parameters for cipher suites, using Let's Encrypt certificates managed by Certbot or acme.sh, and applying process privileges as recommended by CIS (Center for Internet Security) guidelines. Operational security often pairs Puma with web application firewalls such as ModSecurity or cloud offerings from Cloudflare and Akamai, and monitoring integration with Sentry (software) and New Relic helps detect stability regressions.
Puma was created by Evan Phoenix and evolved in the context of the Ruby community alongside projects like Rails (web framework), Rack (webserver interface), and Rubinius. Its development history includes contributions surfaced at community events including RubyConf and RailsConf, and stewardship via repositories hosted on GitHub. Puma's roadmap and releases have been discussed in issue trackers and pull requests comparable to workflows used by RubyGems packages and other server projects such as Thin (web server) and Unicorn (web server).
Puma is widely used to serve web applications developed with Ruby on Rails, Sinatra (web framework), Hanami (web framework), and APIs for services built with Grape (microframework). Large-scale adopters and platform providers like Heroku, GitHub, Shopify, and numerous startups in incubators associated with Y Combinator rely on Puma for production traffic, often colocated with proxies like Nginx and observability stacks featuring Prometheus and Grafana. Puma is also popular in education and developer tooling contexts alongside projects like Rails Tutorial and community resources such as RubyGems.org.
Category:Free web server software