Use two puma workers

This is the same configuration we had with unicorn.

With several workers, we've got two basic configuration options:

* Preload the application and use a hot restart
* Don't preload the application and use a phased restart

I've decided to preload the application because using a hot restart
changes are available immediately, while with a phased restart there are
a few seconds when both workers for the old code and workers for the new
code exist.

Using a phased restart also has advantages, so some forks might want to
disable the `puma_preload_app` setting in order to use it.
This commit is contained in:
Javi Martín
2019-11-11 19:56:19 +01:00
parent d17b2523cf
commit 95d395343b

View File

@@ -29,6 +29,9 @@ set :keep_releases, 5
set :local_user, ENV["USER"]
set :puma_restart_command, "bundle exec --keep-file-descriptors puma"
set :puma_workers, 2
set :puma_preload_app, true
set :puma_init_active_record, true
set :delayed_job_workers, 2
set :delayed_job_roles, :background