Skip to content

Health Checks

Health checks let CMDHub verify that a service is actually ready to accept traffic - not just that its process started. Without a health check, a service transitions to running as soon as the process launches.

Sends a GET request to a URL and expects a 2xx response.

"healthCheck": {
"type": "http",
"target": "http://localhost:3000/healthz",
"interval": 5,
"timeout": 3
}

Use this for HTTP/HTTPS services. Any 2xx status code counts as healthy. A connection error, timeout, or non-2xx response marks the service unhealthy.

Opens a TCP connection to a host:port and expects it to succeed.

"healthCheck": {
"type": "tcp",
"target": "localhost:5432",
"interval": 5,
"timeout": 3
}

Use this for services that don’t speak HTTP - databases, caches, message brokers. As long as the port accepts a connection, the service is considered healthy.

Runs a shell command and expects it to exit with code 0.

"healthCheck": {
"type": "shell",
"target": "pg_isready -h localhost -p 5432",
"interval": 10,
"timeout": 5
}

Use this when you need a richer check - for example, running a database client command, checking a file exists, or querying an API with curl.

FieldDefaultDescription
type-http, tcp, or shell
target-URL, host:port, or shell command
interval5Seconds between checks while the service is running
timeout3Seconds before a check attempt is considered failed

The indicator next to each service name in the popover reflects the health check result:

ColorMeaning
GreenRunning and healthy
OrangeRunning but health check is failing (unhealthy)
RedProcess has crashed
GreyStopped

During startup the indicator pulses while CMDHub waits for the first successful check.

When a service has dependencies, CMDHub waits for each dependency’s health check to pass before starting the next tier. If a dependency never becomes healthy within a startup timeout, the dependent service is not started.

See Services → Dependencies for more detail.