diff --git a/5.0-Upgrade.md b/5.0-Upgrade.md index 1550ea41..5a68370f 100644 --- a/5.0-Upgrade.md +++ b/5.0-Upgrade.md @@ -1,6 +1,6 @@ # Welcome to Puma 5: Spoony Bard. -![https://i1.kym-cdn.com/entries/icons/original/000/006/385/Spoony_Bard.jpg](https://i1.kym-cdn.com/entries/icons/original/000/006/385/Spoony_Bard.jpg) +![https://i1.kym-cdn.com/entries/icons/original/000/006/385/Spoony_Bard.jpg](https://i1.kym-cdn.com/entries/icons/original/000/006/385/Spoony_Bard.jpg) >Note: Puma 5 now automatically uses `WEB_CONCURRENCY` env var if set see [this post for an explanation](https://github.com/puma/puma/issues/2393#issuecomment-702352208). If your memory use goes up after upgrading to Puma 5 it indicates you're now running with multiple workers (processes). You can decrease memory use by tuning this number to be lower. @@ -34,9 +34,9 @@ Users of this option should see reduced request queue latency and possibly less Add the following to your `puma.rb` to try it: -```ruby +```ruby wait_for_less_busy_worker -# or +# or wait_for_less_busy_worker 0.001 ``` @@ -52,7 +52,7 @@ Production testing at GitLab suggests values between `0.001` and `0.010` are bes To use it, you can add this to your `puma.rb`: -```ruby +```ruby nakayoshi_fork ``` @@ -68,7 +68,7 @@ Puma 5 introduces an experimental new cluster-mode configuration option, `fork_w 10004 \_ puma: cluster worker 3: 10000 [puma] ``` -This allows the usage of `preload` with `phased_restart`. It also may improve memory usage because the worker process loads additional code after processing requests. +It is compatible with phased restarts. It also may improve memory usage because the worker process loads additional code after processing requests. To learn more about using `refork` and `fork_worker`, see [the documentation](https://github.com/puma/puma/blob/master/docs/fork_worker.md). diff --git a/docs/fork_worker.md b/docs/fork_worker.md index 6949d939..f2afb257 100644 --- a/docs/fork_worker.md +++ b/docs/fork_worker.md @@ -24,6 +24,8 @@ Similar to the `preload_app!` option, the `fork_worker` option allows your appli ### Limitations +- Not compatible with the `preload_app!` option + - This mode is still very experimental so there may be bugs or edge-cases, particularly around expected behavior of existing hooks. Please open a [bug report](https://github.com/puma/puma/issues/new?template=bug_report.md) if you encounter any issues. - In order to fork new workers cleanly, worker 0 shuts down its server and stops serving requests so there are no open file descriptors or other kinds of shared global state between processes, and to maximize copy-on-write efficiency across the newly-forked workers. This may temporarily reduce total capacity of the cluster during a phased restart / refork.