If your VPS feels slow or you're getting high CPU usage alerts, here's how to find out what's going on and fix it.
Run top to see what's using your CPU:
top
Press Shift+P to sort by CPU usage. The top processes are your biggest consumers. Press q to quit.
For a friendlier view, install and use htop:
# Ubuntu/Debian
apt install htop -y
# AlmaLinux/Rocky
dnf install htop -y
htop
Note the process name and %CPU of anything using a lot of resources.
free -h
Look at the available column. If it's very low and swap is heavily used, your VPS is running out of RAM. When the system swaps to disk, everything slows down dramatically.
df -h
If / is above 90% full, your VPS may struggle. Services can fail to write logs or temp files, causing slowness or crashes.
If CPU and RAM look fine but the VPS is still slow, disk I/O might be the bottleneck:
# Install and run iotop (shows disk I/O per process)
apt install iotop -y # or: dnf install iotop -y
iotop
systemctl restart apache2 or systemctl restart nginx.ps aux | grep unattended — just wait for it to finish.kworkerds, xmrig, random strings), your VPS may be compromised. Stop the process, change all passwords, and consider reinstalling your OS.crontab -l for scheduled tasks that might be stacking up.
# Kill a specific runaway process (find PID from top/htop)
kill -9 PID
# Restart a misbehaving service
systemctl restart SERVICE_NAME
# Clear old logs to free disk space
journalctl --vacuum-size=50M
# Clear temp files
rm -rf /tmp/*
If you're regularly hitting CPU or RAM limits, your workload may have outgrown your current plan. You can upgrade your VPS directly from the VirtFusion panel — upgrades typically take effect within minutes after a reboot.