Skip to content

Use Puma's Hot Restart for deployments #997

@dacook

Description

@dacook

Hot Restart has benefits over the default stop/start. This will make deployments more seamless:

A hot restart means that no requests will be lost while deploying your new code, since the server socket is kept open between restarts.

https://puma.io/puma4/file.restart.html

  • All platforms: clients with an in-flight request are served responses before the connection is closed gracefully. Puma gracefully disconnects any idle HTTP persistent connections before restarting.

https://github.com/puma/puma/blob/master/docs/restart.md

So we should update the deployment playbook, and probably others to use Hot Restarts.

Note that the puma service is already configured to use the faster Phased Restart for the reload action.
But Hot Restart is generally necessary and safer, because it reloads the Puma master process. This means any updates to Ruby, Puma or Puma's dependent gems will successfully reload the new version.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    All the things 💤

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions