Resource Monitoring
Learning Focus
By the end of this lesson you will know which OS-level commands to use alongside WebAdmin for comprehensive monitoring.
Key Commands
| Resource | Command | What to Watch |
|---|---|---|
| CPU | top, htop | High CPU from lshttpd or lsphp |
| Memory | free -h | Swap usage, available memory |
| Disk | df -h, iostat | Partition fullness, I/O wait |
| Network | netstat -an, ss -s | Connection counts, states |
| Processes | ps aux | grep lshttpd | Worker count and memory per worker |
Quick Health Check Script
#!/bin/bash
echo "=== CPU Load ==="
uptime
echo "=== Memory ==="
free -h
echo "=== Disk ==="
df -h /
echo "=== OLS Connections ==="
netstat -an | grep -c ":443.*ESTABLISHED"
echo "=== PHP Workers ==="
ps aux | grep lsphp | grep -v grep | wc -l
Key Takeaways
- Combine WebAdmin dashboard with OS-level tools for full visibility.
- Watch for swap usage — it is the first sign of memory pressure.
- Monitor disk space — full disks cause log failures and crashes.
What's Next
- Return to the Logging and Monitoring module for the complete overview.