High Availability Setup
This guide explains how to configure ACP Server for high availability (HA) deployments using centralized storage to share server state across multiple server replicas.Overview
ACP Server supports high availability through centralized storage backends that enable multiple replicas to share server state. This allows you to:- Run multiple ACP Server replicas behind a load balancer
- Ensure resilience across server restarts
- Scale horizontally for increased throughput
- Maintain state consistency across nodes
Supported Storage Backends
ACP Server provides three storage options:1. Memory Store (Default)
- Use case: Single-instance deployments, development
- Limitations: No HA support, data lost on restart, TTL expiration
- Configuration: Used by default, no setup required
2. Redis Store
- Use case: Production HA deployments with fast access
- Features: Pub/Sub notifications, automatic expiration
- Requirements: Redis server accessible by all ACP replicas
3. PostgreSQL Store
- Use case: Production HA deployments with persistence
- Features: ACID compliance, notifications via LISTEN/NOTIFY
- Requirements: PostgreSQL database accessible by all ACP replicas
Configuration Examples
Redis Store Setup
PostgreSQL Store Setup
ACP-Specific Deployment Considerations
Storage Backend Requirements
Redis Requirements:- Redis 6.0+
- ACP will automatically configure keyspace notifications:
CONFIG SET notify-keyspace-events KEA
- PostgreSQL 12+ with LISTEN/NOTIFY support
- Database with JSONB support
- ACP will automatically create the required
acp_store
table
Load Balancer Considerations
- Session affinity: Not required for ACP (sessions are centralized)
- Health checks: Configure to check
/ping
endpoint - Graceful shutdown: ACP handles session persistence during restarts
Environment Variables
ACP supports configuration through environment variables for storage backends:Redis Configuration
PostgreSQL Configuration
Troubleshooting
ACP-Specific Issues
Session not found errors- Verify all instances use the same storage configuration
- Check that session data exists in the centralized store
- Ensure proper authentication credentials for storage backend
- Check storage backend connectivity from all instances
- Verify notification channels are working (Redis pub/sub, PostgreSQL LISTEN/NOTIFY)
- Review storage backend logs for connection issues
- Monitor storage backend performance and connection pools
- Check network latency between ACP instances and storage
- Consider storage backend-specific optimizations
Infrastructure Issues
For Redis setup, see the official Redis documentation.For PostgreSQL setup, see the official PostgreSQL documentation.
For Kubernetes deployment patterns, see the official Kubernetes documentation. For additional support, see the production deployment guide or visit our GitHub discussions.