Skip to content

Commit

Permalink
Upgrade guide: what setting WEB_CONCURRENCY does
Browse files Browse the repository at this point in the history
This is what happened in puma#2143.
  • Loading branch information
dentarg committed Nov 7, 2020
1 parent 26ae960 commit 5477d54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 5.0-Upgrade.md
Expand Up @@ -84,12 +84,12 @@ To learn more about using `refork` and `fork_worker`, see ['Fork Worker'](docs/f

## Upgrade

* Setting the `WEB_CONCURRENCY` environment variable will now configure the number of workers (processes) that Puma will boot.
* Setting the `WEB_CONCURRENCY` environment variable will now configure the number of workers (processes) that Puma will boot and enable preloading of the application.
* If you did not explicitly set `environment` before, Puma now checks `RAILS_ENV` and will use that, if available in addition to `RACK_ENV`.
* If you have been using the `--control` CLI option, update your scripts to use `--control-url`.
* If you are using `worker_directory` in your config file, change it to `directory`.
* If you are running MRI, default thread count on Puma is now 5, not 16. This may change the amount of threads running in your threadpool. We believe 5 is a better default for most Ruby web applications on MRI. Higher settings increase latency by causing GVL contention.
* If you are using a worker count of more than 1, Puma will now preload the application by default (disable with `preload_app! false`). We believe this is a better default, but may cause issues in non-Rails applications if you do not have the proper `before` and `after` fork hooks configured. See documentation for your framework. Rails users do not need to change anything. **Please note that it is not possible to use [the phased restart](docs/restart.md) with preloading.**
* If you are using a worker count of more than 1, set using `WEB_CONCURRENCY`, Puma will now preload the application by default (disable with `preload_app! false`). We believe this is a better default, but may cause issues in non-Rails applications if you do not have the proper `before` and `after` fork hooks configured. See documentation for your framework. Rails users do not need to change anything. **Please note that it is not possible to use [the phased restart](docs/restart.md) with preloading.**
* tcp mode and daemonization have been removed without replacement. For daemonization, please use a modern process management solution, such as systemd or monit.
* `connected_port` was renamed to `connected_ports` and now returns an Array, not an Integer.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -146,7 +146,7 @@ before_fork do
end
```

Preloading can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and preload_app copies the code of master into the workers.
Preloading can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and `preload_app!` copies the code of master into the workers.

### Error handling

Expand Down

0 comments on commit 5477d54

Please sign in to comment.