123456789_123456789_123456789_123456789_123456789_

Puma provides three distinct kinds of restart operations, each for different use cases. This document describes "hot restarts" and "phased restarts." The third kind of restart operation is called "refork" and is described in the documentation for fork_worker.

Hot restart

To perform a "hot" restart, Puma performs an exec operation to start the process up again, so no memory is shared between the old process and the new process. As a result, it is safe to issue a restart at any place where you would manually stop Puma and start it again. In particular, it is safe to upgrade Puma itself using a hot restart.

If the new process is unable to load, it will simply exit. You should therefore run Puma under a process monitor when using it in production.

How-to

Any of the following will cause a Puma server to perform a hot restart:

Supported configurations

Client experience

Additional notes

Phased restart

Phased restarts replace all running workers in a Puma cluster. This is a useful way to upgrade the application that Puma is serving gracefully. A phased restart works by first killing an old worker, then starting a new worker, waiting until the new worker has successfully started before proceeding to the next worker. This process continues until all workers are replaced. The master process is not restarted.

How-to

Any of the following will cause a Puma server to perform a phased restart:

Supported configurations

Client experience

Additional notes