OpenLiteSpeed handles high traffic exceptionally well but requires proper tuning to reach its performance ceiling. This guide covers every parameter that matters for production deployments.
Server Configuration Tuning
WebAdmin → Server Configuration → Tuning:
Max Connections: 10000
Max SSL Connections: 10000
Connection Timeout: 300
Max Keep-Alive Req: 10000
Smart Keep-Alive: 1
Keep-Alive Timeout: 5
Send Buffer Size: 0 (auto)
Receive Buffer Size: 0 (auto)
LSPHP Process Tuning
WebAdmin → Server Configuration → External App → lsphp:
Max Connections: 2000
Environment: PHP_LSAPI_CHILDREN=100
Init Timeout: 60
Retry Timeout: 0
Persistent Connection: 1
Kernel Parameter Tuning
sudo nano /etc/sysctl.d/99-litespeed.conf
# Increase connection limits
net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.core.netdev_max_backlog = 65535
# TCP tuning
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_tw_reuse = 1
# File descriptor limits
fs.file-max = 1000000
sudo sysctl -p /etc/sysctl.d/99-litespeed.conf
System File Limits
sudo nano /etc/security/limits.conf
* soft nofile 1000000
* hard nofile 1000000
nobody soft nofile 1000000
nobody hard nofile 1000000
Cache Configuration for High Traffic
WebAdmin → Server Configuration → Cache:
Storage Path: /dev/shm/lscache # Use RAM disk
Default Policy: Public cache enabled
Max Cache Size: 2000 (MB)
Max Stale Age: 200
Monitor Performance
# Real-time stats
curl http://localhost:7080/status
# Or via WebAdmin → Dashboard
# Monitor: Requests/sec, Active Connections, Cache hit rate
Conclusion
Properly tuned OpenLiteSpeed handles millions of requests per day on modest hardware. Our team provides server performance tuning including OpenLiteSpeed optimisation.
Comments