Health Checks
Health checks ensure that your services are running correctly and ready to handle requests. Convox supports multiple types of health checks including readiness probes, liveness probes, startup probes, and gRPC health checks.Readiness Health Checks
Readiness health checks determine whether a service is ready to receive traffic. Services behind a load balancer require health checks to determine if a process can handle requests.Processes that fail two consecutive health checks are assumed dead and will be terminated and replaced.
Simple Health Check
Specifying health as a string sets the path and uses default values for other options
Advanced Health Check
Health Check Parameters
The HTTP endpoint that will be requested for health checks
The amount of time in seconds to wait for a process to boot before beginning health checks
The number of seconds between health checks
The number of seconds to wait for a valid response (200-399 status code)
Disable health checks for this service
Liveness Checks
Liveness checks monitor the ongoing health of running processes. While readiness probes determine when a service is ready to receive traffic, liveness checks determine when a service should be restarted if it becomes unresponsive.When a liveness check fails, Kubernetes will restart the container, which can help recover from deadlocks, memory leaks, or other issues.
Liveness Check Configuration
Liveness Check Parameters
Required. The HTTP endpoint that will be requested for liveness checks
The amount of time in seconds to wait before beginning liveness checks
The number of seconds between liveness checks
The number of seconds to wait for a successful response
The number of consecutive successful checks required
The number of consecutive failed checks before restarting the container
Liveness Check Use Cases
- Deadlock Detection
- Memory Monitoring
Startup Probes
Startup probes check if an application has successfully started before allowing readiness and liveness probes to take effect. This is particularly useful for applications with long or variable startup times.When a startup probe is configured, all other probes are disabled until it succeeds.
TCP Startup Probe
Required. The TCP port to check for startup success
HTTP Startup Probe
Required. The HTTP endpoint to check for startup success
Startup Probe Parameters
The number of seconds to wait before starting startup checks
The number of seconds between startup probe checks
The number of seconds to wait for a successful response
The number of consecutive successful checks required
The number of consecutive failed checks before restarting the container
Startup Probe Use Cases
Database Migrations
Applications that run database migrations on startup
Cache Warming
Services that need to populate caches before serving traffic
Large Applications
Applications with significant initialization requirements
Configuration Loading
Services that load extensive configuration on startup
Complete Example with All Probes
In this example, the startup probe allows up to 5 minutes (15s × 20) for the application to start. Once successful, health and liveness checks begin.
gRPC Health Checks
For services using gRPC, Convox provides support for gRPC health checks through the gRPC health checking protocol.Basic gRPC Configuration
Must specify
grpc: prefix for gRPC servicesEnables gRPC health checking protocol
Advanced gRPC Configuration
The
path attribute specifies the service name to check within your gRPC health implementation.Implementation Requirements
Services must implement the gRPC Health Checking Protocol.Probe Behavior
WhengrpcHealthEnabled is true, Convox configures:
Readiness Probe
Determines whether the service is ready to receive traffic
Liveness Probe
Monitors ongoing health and initiates restarts if necessary
Health Check Best Practices
Lightweight Checks
Keep health check endpoints fast and simple - avoid heavy operations
Dependency Checks
Include critical dependency checks (database, cache) in health endpoints
Separate Endpoints
Use different endpoints for readiness, liveness, and startup checks
Conservative Timeouts
Set appropriate grace periods and failure thresholds to avoid false positives
Health Check Timing
- Fast Startup
- Normal Startup
- Slow Startup
Troubleshooting
Service keeps restarting
Service keeps restarting
Common causes:
- Health check timeout too short
- Health endpoint returning error status codes
- Grace period too short for application startup
- Check logs:
convox logs -s <service>
Service not receiving traffic
Service not receiving traffic
Check that:
- Health check endpoint returns 200-399 status code
- Service is actually listening on configured port
- Health check path is correct
- Use
convox psto check service status
gRPC health checks failing
gRPC health checks failing
Verify:
portusesgrpc:prefix- gRPC health protocol is implemented
- Service is actually listening on the gRPC port
- Health service is registered correctly
Version Requirements
All versions
All versions
Version 3.19.7+
All versions
Related Documentation
Load Balancers
Configure traffic routing to healthy services
Service
Complete service configuration reference
Deployment
Understanding deployment and health checks