Run top or htop to identify CPU-hungry processes. Common culprits: runaway PHP scripts, brute-force attacks triggering excessive PHP execution, unoptimized database queries, and search engine bots crawling aggressively. For PHP: check slow logs and optimize the offending scripts. For bots: implement rate limiting in Nginx. For database: enable the slow query log and add missing indexes. Check load average in top — values consistently above your vCPU count indicate CPU contention.
Diagnosing High CPU Usage
Run top or htop to identify CPU-hungry processes. Common culprits: runaway PHP scripts, brute-force attacks triggering excessive PHP execution, unoptimized database queries, and search engine bots crawling aggressively. For PHP: check slow logs and optimize the offending scripts. For bots: implement rate limiting in Nginx. For database: enable the slow query log and add missing indexes. Check load average in top — values consistently above your vCPU count indicate CPU contention.
Memory Leak Detection
Watch for gradually increasing memory usage with free -h over time. Check per-process memory with ps aux --sort=-%mem | head. PHP-FPM workers can leak memory — set pm.max_requests = 500 to recycle workers after 500 requests. MySQL’s buffer pool should be sized appropriately — too large and it competes with other services. Use valgrind for custom applications to identify specific leak sources.
Slow Disk I/O
Check I/O wait with iostat -x 1 — high %iowait means disk is the bottleneck. Identify which process is causing I/O: iotop. Common causes: database queries scanning large tables (add indexes), excessive logging, backup jobs running during peak hours, and swap usage (add more RAM or optimize applications). On VeloxMedia’s NVMe storage, I/O performance is excellent — if you see I/O issues, it’s almost always an application optimization opportunity.
Looking for reliable hosting? VeloxMedia offers Premium VPS hosting.