How do I troubleshoot high CPU or memory usage on my Droplet?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
Use commands like top or htop # if installed, more user-friendly These show which processes are consuming the most CPU and memory. Look for any process stuck at 90–100% or using excessive RAM.
Enable DigitalOcean Monitoring & Metrics In your Droplet dashboard, enable Monitoring. This provides CPU %, memory, disk I/O, and alerts right from the dashboard. If you notice spikes, match the timeline with deployments, traffic bursts, or cron jobs.
Investigate the Culprit Web servers (Nginx/Apache): Too many requests or misconfiguration.
Databases (MySQL/PostgreSQL): Slow queries, missing indexes, too many connections.
Background tasks or cron jobs: Scripts running in loops or with memory leaks.
Bots or DDoS traffic: Check access logs for unusual IPs or repetitive requests.
Check System Logs
/var/log/syslog
/var/log/auth.log
/var/log/nginx/access.log
/var/log/mysql/error.log
Errors, crashes, or authentication attacks may consume resources.
Optimize Services
MySQL: Tune with mysqltuner
or optimize queries.
PHP / Node / Django apps: Use proper process managers (PM2, Gunicorn, Supervisor).
Caching: Add Redis or enable page caching to reduce load.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.