Skip to content
AI NEWS JOURNAL
VercelAI NEWS / JOURNAL

Add liveness checks to your Daemons

Vercel has introduced support for HTTP liveness checks in daemons, allowing users to define a health endpoint that returns a 200 status if the daemon is healthy or a 500 status if it is not. The daemon configuration now includes a livenessProbe option pointing to this endpoint, enabling Vercel to periodically check its health and restart the container when the check fails, ensuring the daemon remains functional even if it's running but unresponsive.

Vercel Daemons now support configuring HTTP liveness checks. Start with an HTTP endpoint in your daemon that reports its health. Keep it lightweight so it responds quickly, and have it return an error status when the daemon is no longer healthy: let alive = true; startWorker({ onConnectionError: () => { alive = false }}) require('http').createServer((req, res) => { res.statusCode = alive ? 200 : 500; res.end();}).listen(1234) A minimal health endpoint that fails the check when the worker is no longer healthy The daemon configuration now accepts a livenessProbe value pointing at that endpoint: { "daemons": { "worker": { "root": "worker/", "entrypoint": "Dockerfile", "livenessProbe": { "httpGet": { "port": 1234, "path": "/health" } } } }} A daemon with an HTTP liveness probe on port 1234 Vercel periodically requests the endpoint and restarts the daemon's container when the check fails, catching a daemon that is still running but no longer healthy. Read the Daemon documentation for more information about liveness checks, including default values and the optional tuning fields.

Sources

Read original ↗
← Continue to all updates