{"id":13400336,"url":"https://github.com/puma/puma","last_synced_at":"2026-04-09T02:06:20.636Z","repository":{"id":38818418,"uuid":"2441517","full_name":"puma/puma","owner":"puma","description":"A Ruby/Rack web server built for parallelism","archived":false,"fork":false,"pushed_at":"2026-01-20T03:33:09.000Z","size":12567,"stargazers_count":7850,"open_issues_count":99,"forks_count":1466,"subscribers_count":173,"default_branch":"main","last_synced_at":"2026-01-20T09:06:23.323Z","etag":null,"topics":["multithreading","rack","ruby","server"],"latest_commit_sha":null,"homepage":"https://puma.io","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puma.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2011-09-23T02:26:08.000Z","updated_at":"2026-01-20T02:53:09.000Z","dependencies_parsed_at":"2025-12-25T16:03:42.772Z","dependency_job_id":null,"html_url":"https://github.com/puma/puma","commit_stats":{"total_commits":3591,"total_committers":516,"mean_commits":6.959302325581396,"dds":0.8267891952102479,"last_synced_commit":"edd2a1728e39d055545fd12ffdfa42d5d4ccbc58"},"previous_names":[],"tags_count":169,"template":false,"template_full_name":null,"purl":"pkg:github/puma/puma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puma%2Fpuma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puma%2Fpuma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puma%2Fpuma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puma%2Fpuma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puma","download_url":"https://codeload.github.com/puma/puma/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puma%2Fpuma/sbom","scorecard":{"id":594778,"data":{"date":"2025-08-11","repo":{"name":"github.com/puma/puma","commit":"1b08ed77741d0f6ed17c43795df7b50601d09060"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":7.2,"checks":[{"name":"Code-Review","score":6,"reason":"Found 16/25 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"26 commit(s) and 10 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/pr-label-status.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/rack_conform.yml:6","Info: topLevel 'contents' permission set to 'read': .github/workflows/ragel.yml:6","Info: topLevel 'contents' permission set to 'read': .github/workflows/skip_duplicate_workflow_runs.yml:17","Info: topLevel 'contents' permission set to 'read': .github/workflows/tests.yml:6","Info: topLevel 'contents' permission set to 'read': .github/workflows/turbo-rails.yml:9","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-label-status.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/pr-label-status.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-label-status.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/pr-label-status.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rack_conform.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/rack_conform.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rack_conform.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/rack_conform.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ragel.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/ragel.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ragel.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/ragel.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ragel.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/ragel.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/skip_duplicate_workflow_runs.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/skip_duplicate_workflow_runs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:100: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:173: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/tests.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:177: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/turbo-rails.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/turbo-rails.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/turbo-rails.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/puma/puma/turbo-rails.yml/master?enable=pin","Warn: containerImage not pinned by hash: .devcontainer/Dockerfile:5","Warn: containerImage not pinned by hash: tools/Dockerfile:3: pin your Docker image by updating ruby:3.2 to ruby:3.2@sha256:f2c162a99e72e980e3a97933428a9809b08c72b193ccff7073ff6a02f6aa6325","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 third-party GitHubAction dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T22:52:33.413Z","repository_id":38818418,"created_at":"2025-08-20T22:52:33.414Z","updated_at":"2025-08-20T22:52:33.414Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28627386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["multithreading","rack","ruby","server"],"created_at":"2024-07-30T19:00:50.803Z","updated_at":"2026-04-09T02:06:20.629Z","avatar_url":"https://github.com/puma.png","language":"Ruby","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/images/standard-logo.svg\" alt=\"Puma logo\"\u003e\n\u003c/p\u003e\n\n# Puma: A Ruby Web Server Built For Parallelism\n\n[![Actions](https://github.com/puma/puma/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/puma/puma/actions/workflows/tests.yml?query=branch%3Amain)\n\nPuma is a **simple, fast, multi-threaded, and highly parallel HTTP 1.1 server for Ruby/Rack applications**.\n\n## Built For Speed \u0026amp; Parallelism\n\nPuma is a server for [Rack](https://github.com/rack/rack)-powered HTTP applications written in Ruby.  It is:\n* **Multi-threaded**. Each request is served in a separate thread. This helps you serve more requests per second with less memory use.\n* **Multi-process**. \"Pre-forks\" in cluster mode, using less memory per-process thanks to copy-on-write memory.\n* **Standalone**. With SSL support, zero-downtime rolling restarts and a built-in request bufferer, you can deploy Puma without any reverse proxy.\n* **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.\n\nOriginally designed as a server for [Rubinius](https://github.com/rubinius/rubinius), Puma also works well with Ruby (MRI) and JRuby.\n\nOn 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.\n\n## Quick Start\n\n```\n$ gem install puma\n$ puma\n```\n\nWithout arguments, puma will look for a rackup (.ru) file in\nworking directory called `config.ru`.\n\n## SSL Connection Support\n\nPuma will install/compile with support for ssl sockets, assuming OpenSSL\ndevelopment files are installed on the system.\n\nIf the system does not have OpenSSL development files installed, Puma will\ninstall/compile, but it will not allow ssl connections.\n\n## Frameworks\n\n### Rails\n\nPuma is the default server for Rails, included in the generated Gemfile.\n\nStart your server with the `rails` command:\n\n```\n$ rails server\n```\n\nMany configuration options and Puma features are not available when using `rails server`. It is recommended that you use Puma's executable instead:\n\n```\n$ bundle exec puma\n```\n\n### Sinatra\n\nYou can run your Sinatra application with Puma from the command line like this:\n\n```\n$ ruby app.rb -s Puma\n```\n\nIn 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:\n\n```ruby\n# config.ru\nrequire './app'\nrun Sinatra::Application\n```\n\nYou can then start your application using:\n\n```\n$ bundle exec puma\n```\n\n## Configuration\n\nPuma provides numerous options. Consult `puma -h` (or `puma --help`) for a full list of CLI options, or see `Puma::DSL` or [dsl.rb](https://github.com/puma/puma/blob/main/lib/puma/dsl.rb).\n\nYou can also find several configuration examples as part of the\n[test](https://github.com/puma/puma/tree/main/test/config) suite.\n\nFor debugging purposes, you can set the environment variable `PUMA_LOG_CONFIG` with a value\nand the loaded configuration will be printed as part of the boot process.\n\n### Thread Pool\n\nPuma uses a thread pool. You can set the minimum and maximum number of threads that are available in the pool with the `-t` (or `--threads`) flag:\n\n```\n$ puma -t 8:32\n```\n\nPuma will automatically scale the number of threads, from the minimum until it caps out at the maximum, based on how much traffic is present. The current default is `0:16` and on MRI is `0:5`. Feel free to experiment, but be careful not to set the number of maximum threads to a large number, as you may exhaust resources on the system (or cause contention for the Global VM Lock, when using MRI).\n\nBe aware that additionally Puma creates threads on its own for internal purposes (e.g. handling slow clients). So, even if you specify -t 1:1, expect around 7 threads created in your application.\n\n### Cluster mode\n\nPuma also offers \"cluster mode\". Cluster mode `fork`s workers from a master process. Each child process still has its own thread pool. You can tune the number of workers with the `-w` (or `--workers`) flag:\n\n```\n$ puma -t 8:32 -w 3\n```\n\nOr with the `WEB_CONCURRENCY` environment variable:\n\n```\n$ WEB_CONCURRENCY=3 puma -t 8:32\n```\n\nWhen using a config file, most applications can simply set `workers :auto` (requires the `concurrent-ruby` gem) to match the number of worker processes to the available processors:\n\n```ruby\n# config/puma.rb\nworkers :auto\n```\n\nSee [`workers :auto` gotchas](lib/puma/dsl.rb).\n\nNote that threads are still used in cluster mode, and the `-t` thread flag setting is per worker, so `-w 2 -t 16:16` will spawn 32 threads in total, with 16 in each worker process.\n\nIf `workers` is set to `:auto`, or the `WEB_CONCURRENCY` environment variable is set to `\"auto\"`, and the `concurrent-ruby` gem is available in your application, Puma will set the worker process count to the result of [available processors](https://msp-greg.github.io/concurrent-ruby/Concurrent.html#available_processor_count-class_method).\n\nFor an in-depth discussion of the tradeoffs of thread and process count settings, [see our docs](docs/deployment.md).\n\nIn cluster mode, Puma can \"preload\" your application. This loads all the application code *prior* to forking. Preloading reduces total memory usage of your application via an operating system feature called [copy-on-write](https://en.wikipedia.org/wiki/Copy-on-write).\n\nIf the number of workers is greater than 1 (and `--prune-bundler` has not been specified), preloading will be enabled by default. Otherwise, you can use the `--preload` flag from the command line:\n\n```\n$ puma -w 3 --preload\n```\n\nOr, if you're using a configuration file, you can use the `preload_app!` method:\n\n```ruby\n# config/puma.rb\nworkers 3\npreload_app!\n```\n\nPreloading can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and preloading copies the code of master into the workers.\n\n#### Cluster mode hooks\n\nWhen using clustered mode, Puma's configuration DSL provides `before_fork`, `before_worker_boot`, and `after_worker_shutdown`\nhooks to run code when the master process forks, the child workers are booted, and after each child worker exits respectively.\n\nIt is recommended to use these hooks with `preload_app!`, otherwise constants loaded by your\napplication (such as `Rails`) will not be available inside the hooks.\n\n```ruby\n# config/puma.rb\nbefore_fork do\n  # Add code to run inside the Puma master process before it forks a worker child.\nend\n\nbefore_worker_boot do\n  # Add code to run inside the Puma worker process after forking.\nend\n\nafter_worker_shutdown do |worker_handle|\n  # Add code to run inside the Puma master process after a worker exits. `worker.process_status` can be used to get the\n  # `Process::Status` of the exited worker.\nend\n```\n\nIn addition, there is an `before_refork` and `after_refork` hooks which are used only in [`fork_worker` mode](docs/fork_worker.md),\nwhen the worker 0 child process forks a grandchild worker:\n\n```ruby\nbefore_refork do\n  # Used only when fork_worker mode is enabled. Add code to run inside the Puma worker 0\n  # child process before it forks a grandchild worker.\nend\n```\n\n```ruby\nafter_refork do\n  # Used only when fork_worker mode is enabled. Add code to run inside the Puma worker 0\n  # child process after it forks a grandchild worker.\nend\n```\n\nImportantly, note the following considerations when Ruby forks a child process:\n\n1. File descriptors such as network sockets **are** copied from the parent to the forked\n   child process. Dual-use of the same sockets by parent and child will result in I/O conflicts\n   such as `SocketError`, `Errno::EPIPE`, and `EOFError`.\n2. Background Ruby threads, including threads used by various third-party gems for connection\n   monitoring, etc., are **not** copied to the child process. Often this does not cause\n   immediate problems until a third-party connection goes down, at which point there will\n   be no supervisor to reconnect it.\n\nTherefore, we recommend the following:\n\n1. If possible, do not establish any socket connections (HTTP, database connections, etc.)\n   inside Puma's master process when booting.\n2. If (1) is not possible, use `before_fork` and `before_refork` to disconnect the parent's socket\n   connections when forking, so that they are not accidentally copied to the child process.\n3. Use `before_worker_boot` to restart any background threads on the forked child.\n4. Use `after_refork` to restart any background threads on the parent.\n\n#### Master process lifecycle hooks\n\nPuma's configuration DSL provides master process lifecycle hooks `after_booted`, `before_restart`, and `after_stopped`\nwhich may be used to specify code blocks to run on each event:\n\n```ruby\n# config/puma.rb\nafter_booted do\n  # Add code to run in the Puma master process after it boots,\n  # and also after a phased restart completes.\nend\n\nbefore_restart do\n  # Add code to run in the Puma master process when it receives\n  # a restart command but before it restarts.\nend\n\nafter_stopped do\n  # Add code to run in the Puma master process when it receives\n  # a stop command but before it shuts down.\nend\n```\n\n### Error handling\n\nIf Puma encounters an error outside of the context of your application, it will respond with a 400/500 and a simple\ntextual error message (see `Puma::Server#lowlevel_error` or [server.rb](https://github.com/puma/puma/blob/main/lib/puma/server.rb)).\nYou can specify custom behavior for this scenario. For example, you can report the error to your third-party\nerror-tracking service (in this example, [rollbar](https://rollbar.com)):\n\n```ruby\nlowlevel_error_handler do |e, env, status|\n  if status == 400\n    message = \"The server could not process the request due to an error, such as an incorrectly typed URL, malformed syntax, or a URL that contains illegal characters.\\n\"\n  else\n    message = \"An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact support@example.com\\n\"\n    Rollbar.critical(e)\n  end\n\n  [status, {}, [message]]\nend\n```\n\n### Binding TCP / Sockets\n\nBind Puma to a socket with the `-b` (or `--bind`) flag:\n\n```\n$ puma -b tcp://127.0.0.1:9292\n```\n\nTo use a UNIX Socket instead of TCP:\n\n```\n$ puma -b unix:///var/run/puma.sock\n```\n\nIf you need to change the permissions of the UNIX socket, just add a umask parameter:\n\n```\n$ puma -b 'unix:///var/run/puma.sock?umask=0111'\n```\n\nNeed a bit of security? Use SSL sockets:\n\n```\n$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key\u0026cert=path_to_cert'\n```\n#### Self-signed SSL certificates (via the [`localhost`] gem, for development use):\n\nPuma supports the [`localhost`] gem for self-signed certificates. This is particularly useful if you want to use Puma with SSL locally, and self-signed certificates will work for your use-case. Currently, the integration can only be used in MRI.\n\nPuma automatically configures SSL when the [`localhost`] gem is loaded in a `development` environment:\n\nAdd the gem to your Gemfile:\n```ruby\ngroup(:development) do\n  gem 'localhost'\nend\n```\n\nAnd require it implicitly using bundler:\n```ruby\nrequire \"bundler\"\nBundler.require(:default, ENV[\"RACK_ENV\"].to_sym)\n```\n\nAlternatively, you can require the gem in your configuration file, either `config/puma/development.rb`, `config/puma.rb`, or set via the `-C` cli option:\n```ruby\nrequire 'localhost'\n# configuration methods (from Puma::DSL) as needed\n```\n\nAdditionally, Puma must be listening to an SSL socket:\n\n```shell\n$ puma -b 'ssl://localhost:9292' -C config/use_local_host.rb\n\n# The following options allow you to reach Puma over HTTP as well:\n$ puma -b ssl://localhost:9292 -b tcp://localhost:9393 -C config/use_local_host.rb\n```\n\n[`localhost`]: https://github.com/socketry/localhost\n\n#### Controlling SSL Cipher Suites\n\nTo use or avoid specific SSL ciphers for TLSv1.2 and below, use `ssl_cipher_filter` or `ssl_cipher_list` options.\n\n##### Ruby:\n\n```\n$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key\u0026cert=path_to_cert\u0026ssl_cipher_filter=!aNULL:AES+SHA'\n```\n\n##### JRuby:\n\n```\n$ puma -b 'ssl://127.0.0.1:9292?keystore=path_to_keystore\u0026keystore-pass=keystore_password\u0026ssl_cipher_list=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA'\n```\n\nTo configure the available TLSv1.3 ciphersuites, use `ssl_ciphersuites` option (not available for JRuby).\n\n##### Ruby:\n\n```\n$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key\u0026cert=path_to_cert\u0026ssl_ciphersuites=TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256'\n```\n\nSee https://www.openssl.org/docs/man1.1.1/man1/ciphers.html for cipher filter format and full list of cipher suites.\n\nDisable TLS v1 with the `no_tlsv1` option:\n\n```\n$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key\u0026cert=path_to_cert\u0026no_tlsv1=true'\n```\n\n#### Controlling OpenSSL Verification Flags\n\nTo enable verification flags offered by OpenSSL, use `verification_flags` (not available for JRuby):\n\n```\n$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key\u0026cert=path_to_cert\u0026verification_flags=PARTIAL_CHAIN'\n```\n\nYou can also set multiple verification flags (by separating them with a comma):\n\n```\n$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key\u0026cert=path_to_cert\u0026verification_flags=PARTIAL_CHAIN,CRL_CHECK'\n```\n\nList of available flags: `USE_CHECK_TIME`, `CRL_CHECK`, `CRL_CHECK_ALL`, `IGNORE_CRITICAL`, `X509_STRICT`, `ALLOW_PROXY_CERTS`, `POLICY_CHECK`, `EXPLICIT_POLICY`, `INHIBIT_ANY`, `INHIBIT_MAP`, `NOTIFY_POLICY`, `EXTENDED_CRL_SUPPORT`, `USE_DELTAS`, `CHECK_SS_SIGNATURE`, `TRUSTED_FIRST`, `SUITEB_128_LOS_ONLY`, `SUITEB_192_LOS`, `SUITEB_128_LOS`, `PARTIAL_CHAIN`, `NO_ALT_CHAINS`, `NO_CHECK_TIME`\n(see https://www.openssl.org/docs/manmaster/man3/X509_VERIFY_PARAM_set_hostflags.html#VERIFICATION-FLAGS).\n\n#### Controlling OpenSSL Password Decryption\n\nTo enable runtime decryption of an encrypted SSL key (not available for JRuby), use `key_password_command`:\n\n```\n$ puma -b 'ssl://127.0.0.1:9292?key=path_to_key\u0026cert=path_to_cert\u0026key_password_command=/path/to/command.sh'\n```\n\n`key_password_command` must:\n\n1. Be executable by Puma.\n2. Print the decryption password to stdout.\n\n For example:\n\n```shell\n#!/bin/sh\n\necho \"this is my password\"\n```\n\n`key_password_command` can be used with `key` or `key_pem`. If the key\nis not encrypted, the executable will not be called.\n\n### Control/Status Server\n\nPuma has a built-in status and control app that can be used to query and control Puma.\n\n```\n$ puma --control-url tcp://127.0.0.1:9293 --control-token foo\n```\n\nPuma will start the control server on localhost port 9293. All requests to the control server will need to include control token (in this case, `token=foo`) as a query parameter. This allows for simple authentication. Check out `Puma::App::Status` or [status.rb](https://github.com/puma/puma/blob/main/lib/puma/app/status.rb) to see what the status app has available.\n\nYou can also interact with the control server via `pumactl`. This command will restart Puma:\n\n```\n$ pumactl --control-url 'tcp://127.0.0.1:9293' --control-token foo restart\n```\n\nTo see a list of `pumactl` options, use `pumactl --help`.\n\n### Configuration File\n\nYou can also provide a configuration file with the `-C` (or `--config`) flag:\n\n```\n$ puma -C /path/to/config\n```\n\nIf no configuration file is specified, Puma will look for a configuration file at `config/puma.rb`. If an environment is specified (via the `--environment` flag or through the `APP_ENV`, `RACK_ENV`, or `RAILS_ENV` environment variables) Puma looks for a configuration file at `config/puma/\u003cenvironment_name\u003e.rb` and then falls back to `config/puma.rb`.\n\nIf you want to prevent Puma from looking for a configuration file in those locations, include the `--no-config` flag:\n\n```\n$ puma --no-config\n\n# or\n\n$ puma -C \"-\"\n```\n\nThe other side-effects of setting the environment are whether to show stack traces (in `development` or `test`), and setting RACK_ENV may potentially affect middleware looking for this value to change their behavior. The default puma RACK_ENV value is `development`. You can see all config default values in `Puma::Configuration#puma_default_options` or [configuration.rb](https://github.com/puma/puma/blob/61c6213fbab/lib/puma/configuration.rb#L182-L204).\n\nCheck out `Puma::DSL` or [dsl.rb](https://github.com/puma/puma/blob/main/lib/puma/dsl.rb) to see all available options.\n\n## Restart\n\nPuma includes the ability to restart itself. When available (MRI, Rubinius, JRuby), Puma performs a \"hot restart\". This is the same functionality available in *Unicorn* and *NGINX* which keep the server sockets open between restarts. This makes sure that no pending requests are dropped while the restart is taking place.\n\nFor more, see the [Restart documentation](docs/restart.md).\n\n## Signals\n\nPuma responds to several signals. A detailed guide to using UNIX signals with Puma can be found in the [Signals documentation](docs/signals.md).\n\n## Platform Constraints\n\nSome platforms do not support all Puma features.\n\n  * **JRuby**, **Windows**: server sockets are not seamless on restart, they must be closed and reopened. These platforms have no way to pass descriptors into a new process that is exposed to Ruby. Also, cluster mode is not supported due to a lack of fork(2).\n  * **Windows**: Cluster mode is not supported due to a lack of fork(2).\n  * **Kubernetes**: The way Kubernetes handles pod shutdowns interacts poorly with server processes implementing graceful shutdown, like Puma. See the [kubernetes section of the documentation](docs/kubernetes.md) for more details.\n\n## Deployment\n\n * Puma has support for Capistrano with an [external gem](https://github.com/seuros/capistrano-puma).\n\n * Additionally, Puma has support for built-in daemonization via the [puma-daemon](https://github.com/kigster/puma-daemon) ruby gem. The gem restores the `daemonize` option that was removed from Puma starting version 5, but only for MRI Ruby.\n\n\nIt is common to use process monitors with Puma. Modern process monitors like systemd or rc.d\nprovide continuous monitoring and restarts for increased reliability in production environments:\n\n* [rc.d](docs/jungle/rc.d/README.md)\n* [systemd](docs/systemd.md)\n\nCommunity guides:\n\n* [Deploying Puma on OpenBSD using relayd and httpd](https://gist.github.com/anon987654321/4532cf8d6c59c1f43ec8973faa031103)\n\n## Community Extensions\n\n### Plugins\n\n* [puma-metrics](https://github.com/harmjanblok/puma-metrics) — export Puma metrics to Prometheus\n* [puma-plugin-statsd](https://github.com/yob/puma-plugin-statsd) — send Puma metrics to statsd\n* [puma-plugin-systemd](https://github.com/sj26/puma-plugin-systemd) — deeper integration with systemd for notify, status and watchdog. Puma 5.1.0 integrated notify and watchdog, which probably conflicts with this plugin. Puma 6.1.0 added status support which obsoletes the plugin entirely.\n* [puma-plugin-telemetry](https://github.com/babbel/puma-plugin-telemetry) - telemetry plugin for Puma offering various targets to publish\n* [puma-acme](https://github.com/anchordotdev/puma-acme) - automatic SSL/HTTPS certificate provisioning and setup\n\n### Monitoring\n\n* [puma-status](https://github.com/ylecuyer/puma-status) — Monitor CPU/Mem/Load of running puma instances from the CLI\n\n## Contributing\n\nFind details for contributing in the [contribution guide](CONTRIBUTING.md).\n\n## License\n\nPuma is copyright Evan Phoenix and contributors, licensed under the BSD 3-Clause license. See the included LICENSE file for details.\n","funding_links":[],"categories":["Ruby","Provision, Deploy \u0026 Host","Web Servers","Microbiome (16S)","Tools"],"sub_categories":["Web servers","Application and Web Servers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuma%2Fpuma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuma%2Fpuma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuma%2Fpuma/lists"}