Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sockudo/sockudo/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This guide covers common issues you may encounter with Sockudo and provides solutions for debugging and resolving them.Debug Logging
Enable Debug Mode
Environment Variable (Recommended):Log Output Formats
Human-Readable Format (Development):You can disable colors via config file, but JSON format requires an environment variable.
Common Issues
Connection Issues
WebSocket connections failing
WebSocket connections failing
Symptoms:Solutions:
- Clients cannot establish WebSocket connections
- Connection attempts timeout
- 502 Bad Gateway errors
-
Check port binding:
-
Verify app credentials:
-
Check firewall rules:
-
Validate origin headers (if origin validation is enabled):
Connection drops / disconnects
Connection drops / disconnects
Symptoms:Solutions:
- Clients randomly disconnect
- Connection closed with error codes 4100, 4200, 4201
- Frequent reconnection attempts
-
Increase WebSocket buffer limits:
-
Adjust idle timeout:
-
Enable auto-ping:
-
Check slow consumer handling:
Origin not allowed errors
Origin not allowed errors
Symptoms:Solutions:
- Error code 4009: “Origin not allowed”
- Browser clients rejected, direct clients work
-
Add allowed origins:
-
Update config file:
-
Allow all origins (development only):
Memory Issues
High memory usage
High memory usage
Symptoms:Solutions:
- Memory consumption grows over time
- Out of memory errors
- Process killed by OOM killer
-
Reduce WebSocket buffer sizes:
-
Lower cleanup queue buffer:
-
Reduce cache capacity:
-
Enable aggressive cleanup:
-
Check for memory leaks:
Cleanup queue memory growth
Cleanup queue memory growth
Symptoms:Solutions:
- Memory grows during mass disconnections
- “Queue near capacity” warnings
- Cleanup queue overflowing
-
Increase batch processing speed:
-
Add more worker threads:
-
Reduce queue buffer (if memory constrained):
-
Emergency: Disable async cleanup:
Performance Issues
High CPU usage
High CPU usage
Symptoms:Solutions:
- CPU usage near 100%
- Slow message processing
- Increased latency
-
Disable unnecessary features:
-
Adjust cleanup workers:
-
Increase batch timeouts:
-
Check database connection pools:
Slow message delivery
Slow message delivery
Symptoms:Solutions:
- Messages delayed or arrive out of order
- High latency between publish and receive
- Backpressure warnings
-
Increase Redis concurrency:
-
Optimize adapter configuration:
-
Check network latency:
-
Increase buffer sizes:
Database & Backend Issues
Redis connection failures
Redis connection failures
Symptoms:Solutions:
- “Failed to connect to Redis” errors
- Adapter operations timing out
- Falling back to local adapter
-
Verify Redis is running:
-
Check connection settings:
-
Test with Redis URL:
-
Increase connection timeout:
Database pool exhaustion
Database pool exhaustion
Symptoms:Solutions:
- “Connection pool timeout” errors
- Slow app lookups
- “Failed to acquire connection” errors
-
Increase pool size:
-
Enable connection pooling:
-
Reduce pool minimum:
-
Enable app caching:
Issue Reference Table
| Issue | Error Code | Common Cause | Quick Fix |
|---|---|---|---|
| Connection refused | - | Port not open | Check firewall, verify port binding |
| Origin not allowed | 4009 | Missing origin in allowed list | Add origin to allowed_origins |
| Buffer overflow | 4100 | Slow consumer | Increase WEBSOCKET_MAX_MESSAGES |
| Auth failed | 4009 | Invalid credentials | Verify app key/secret |
| Connection timeout | - | Network/firewall issue | Check network connectivity |
| Memory exhaustion | - | High connection count | Reduce buffer sizes, enable limits |
| Queue overflow | - | Mass disconnections | Increase CLEANUP_QUEUE_BUFFER_SIZE |
| CPU saturation | - | Too many workers | Reduce CLEANUP_WORKER_THREADS |
Diagnostic Commands
Health Checks
Real-time Monitoring
Testing Tools
Emergency Procedures
Quick Restart
Disable Features
Fallback to Local Mode
Getting Help
If you’re still experiencing issues:- Enable debug logging:
DEBUG=true RUST_LOG=debug - Collect logs: Save relevant log sections
- Gather metrics: Export Prometheus metrics
- Document steps: Record what you tried
- Report issue: https://github.com/soketi/sockudo/issues
Next Steps
- Performance Tuning - Optimize your deployment
- Security Best Practices - Secure your installation
- Monitoring & Metrics - Set up comprehensive monitoring