How Redis is Used
The platform uses Redis for asynchronous job processing:- Upload Service (
upload-service/src/utils/buildQueue.ts:11): Pushes project IDs to thebuild-queueusingLPUSH - Deploy Service (
deploy-service/src/server.ts:13): Blocks and waits for new items usingBLPOP
Redis acts as a reliable message broker, ensuring builds are processed in order and no projects are lost during high load.
Installation
- macOS
- Linux (Ubuntu/Debian)
- Linux (CentOS/RHEL)
- Windows
- Docker
- Docker Compose
Configuration
Default Configuration
The application uses default Redis connection settings:- Host:
localhost(127.0.0.1) - Port:
6379 - Database:
0 - No authentication
Custom Configuration
If your Redis runs on a different host or port, update the connection:If you modify connection settings, update both
upload-service/src/utils/buildQueue.ts:3 and deploy-service/src/server.ts:5.Production Configuration
For production deployments, configure Redis with:redis.conf
Testing the Connection
Test Queue Operations
Simulate the upload service pushing to queue:Check queue length:Simulate deploy service pulling from queue:Should return:
1) "build-queue" 2) "test-project-123"Monitor Real-Time Activity
Watch Redis commands in real-time:Keep this running while your services operate to see queue activity.
Monitoring and Management
Check Queue Status
Clear Queue
Backup and Restore
- RDB Snapshot
- AOF (Append-Only File)
Troubleshooting
Connection Refused
Connection Refused
Error:
Error: connect ECONNREFUSED 127.0.0.1:6379Solutions:- Check if Redis is running:
redis-cli ping - Start Redis:
sudo systemctl start redis-server - Check Redis logs:
sudo tail -f /var/log/redis/redis-server.log - Verify port:
sudo lsof -i :6379
Authentication Failed
Authentication Failed
Error:
NOAUTH Authentication requiredSolutions:- Set password in connection:
- Or disable auth in
redis.conf(development only):
Queue Not Processing
Queue Not Processing
Symptoms: Items stay in queue, builds don’t startSolutions:
- Check deploy service is running and connected
- Verify queue has items:
redis-cli LLEN build-queue - Check for errors in deploy service logs
- Ensure
BLPOPtimeout is set correctly (0 = block forever)
Memory Issues
Memory Issues
Error:
OOM command not allowed when used memory > 'maxmemory'Solutions:- Increase max memory in
redis.conf: - Set eviction policy:
- Clear old data:
redis-cli FLUSHDB
Redis Crashed
Redis Crashed
Symptoms: Service stops unexpectedlySolutions:
- Check system logs:
sudo journalctl -u redis-server -n 100 - Verify disk space:
df -h - Check Redis logs:
/var/log/redis/redis-server.log - Increase system limits in
/etc/systemd/system/redis.service:
Security Best Practices
Enable Authentication
redis.conf
Bind to Localhost
redis.conf
Rename Dangerous Commands
redis.conf
Use TLS Encryption
redis.conf
Redis Cloud Alternatives
For production, consider managed Redis services:- AWS ElastiCache: Fully managed Redis on AWS
- Redis Cloud: Official cloud offering from Redis Labs
- DigitalOcean Managed Redis: Simple, affordable option
- Azure Cache for Redis: Integrated with Azure services
- Google Cloud Memorystore: Redis on Google Cloud
Update the connection URL in your services to point to the managed Redis endpoint.
Next Steps
Docker Setup
Install Docker for running project builds
Environment Variables
Configure all required environment variables