Skip to content

Commit

Permalink
Docs on systemd integration
Browse files Browse the repository at this point in the history
Follow up to #2027
  • Loading branch information
amitaibu authored Jan 24, 2025
1 parent 2f25258 commit 410cd00
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Guide/deployment.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -878,3 +878,25 @@ The maximum number of subscriptions per websocket connection in IHP DataSync. De
#### `IHP_DATASYNC_MAX_TRANSACTIONS_PER_CONNECTION`

The maximum number of database transactions per websocket connection in IHP DataSync. Defaults to `10`.

## `systemd` Integration

The `deploy-to-nixos` tool now includes systemd integration to improve reliability and reduce downtime for IHP applications. These features are enabled by default when using `ihp.nixosModules.app`.

Key Features:

1. **Systemd Watchdog**:

- The app sends a heartbeat to systemd every 30 seconds via localhost.
- If the app becomes unresponsive, systemd restarts it after 60 seconds.

2. **Socket Activation**:

- Systemd queues incoming HTTP requests during app startup or restarts.
- This eliminates downtime and ensures uninterrupted service.

3. **Automatic Configuration**:

- The `IHP_SYSTEMD` environment variable is set to `"1"` automatically when deploying with `deploy-to-nixos`. If you are deploying differently, you are responsible for setting the variable yourself.


0 comments on commit 410cd00

Please sign in to comment.