Connection Settings
Learning Focus
By the end of this lesson you will know how to tune connection timeouts, keep-alive behavior, and maximum concurrent connections for your traffic patterns.
Key Connection Settings
| Setting | Default | What It Controls |
|---|---|---|
| Max Connections | 10000 | Total concurrent connections allowed |
| Max SSL Connections | 10000 | Concurrent HTTPS connections |
| Connection Timeout | 300s | How long an idle connection stays open |
| Keep-Alive Timeout | 5s | How long to keep a connection alive between requests |
| Max Keep-Alive Requests | 10000 | Requests per persistent connection |
Tuning Guidelines
| Server Profile | Keep-Alive Timeout | Max Connections | Rationale |
|---|---|---|---|
| Small VPS (1-2 GB RAM) | 5-15s | 2000-5000 | Conserve memory and file descriptors |
| Medium server (4-8 GB) | 15-30s | 10000 | Balance responsiveness and resources |
| High traffic (16+ GB) | 30-60s | 20000+ | Maximize client reuse |
Configuring in WebAdmin
- Navigate to Server Configuration → Tuning → Connection
- Adjust settings based on your server profile
- Save and Graceful Restart
# Monitor current connection count
netstat -an | grep -c ESTABLISHED
# Check file descriptor limits (connections require FDs)
ulimit -n
cat /proc/sys/fs/file-max
info
Connection settings trade off between keeping clients happy (longer keep-alive) and protecting server resources (shorter timeouts). Measure before tuning.
Key Takeaways
- Keep-alive settings balance responsiveness against resource usage.
- Start with conservative defaults and increase based on measured traffic.
- Monitor connection counts to detect when limits are being reached.
What's Next
- Continue to Security Settings for request filtering and access control.