High Availability
Configure ACP Server for high availability deployments with centralized storage
High Availability Setup
This guide explains how to configure ACP Server for high availability (HA) deployments using centralized storage to share sessions and state across multiple server instances.
Overview
ACP Server supports high availability through centralized storage backends that enable multiple server instances to share session data and state. This allows you to:
- Run multiple ACP Server instances behind a load balancer
- Ensure session continuity 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
- 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 instances
3. PostgreSQL Store
- Use case: Production HA deployments with persistence
- Features: ACID compliance, notifications via LISTEN/NOTIFY
- Requirements: PostgreSQL database accessible by all ACP instances
Configuration Examples
Redis Store Setup
PostgreSQL Store Setup
ACP-Specific Deployment Considerations
Session Continuity
ACP maintains session state across multiple server instances through centralized storage. When a client connects to any instance:
- Session lookup: The instance checks the centralized store for existing session data
- State restoration: If found, the agent’s state is restored from storage
- Seamless continuation: The agent can continue from where it left off
Storage Backend Requirements
Redis Requirements:
- Redis 6.0+ with keyspace notifications enabled
- Configure with:
CONFIG SET notify-keyspace-events KEA
PostgreSQL Requirements:
- 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
Agent state inconsistencies
- 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
Performance issues with centralized storage
- 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.