TechBuzzPro

How to Monitor CPU Use on DigitalOcean Droplets

· 7 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You monitor CPU use on a DigitalOcean Droplet by reading the metrics that DigitalOcean already collects for you (in the control panel or through the monitoring API) and, when you need per-process detail, by running a tool such as top, htop or vmstat over SSH. The control-panel graphs are the quickest way to see whether a Droplet is consistently busy; the command-line tools tell you which process is responsible. No extra software is required for the built-in graphs, and nothing needs to be installed for the basic command-line tools on a standard Linux image.

What You'll Need

  • A DigitalOcean account with at least one Droplet running a Linux distribution (Ubuntu, Debian, CentOS, Fedora and similar all include the tools below).
  • Access to the DigitalOcean control panel at cloud.digitalocean.com, or an API token if you prefer to query metrics programmatically.
  • SSH access to the Droplet (a terminal on macOS or Linux, or PuTTY/WSL on Windows) for the command-line steps.
  • Optional: htop for a friendlier process viewer. It is available in the standard package repositories of most distributions.

Menu labels in the control panel can differ slightly by account version, region or the way the Droplet was created, so if a label does not match exactly, look for the closest equivalent.

Step-by-Step

  1. Open the Droplet's graphs. Log in to cloud.digitalocean.com, go to Droplets in the left sidebar, and click the name of the Droplet you want to inspect. The Droplet's detail page shows a set of graphs; the CPU graph is the one labelled CPU. The graph updates at a coarse interval (roughly every few minutes), so it is best for spotting trends rather than instantaneous spikes.
  2. Read the CPU graph correctly. The graph plots CPU usage as a percentage over time. A flat line near 100% means the Droplet is saturated and likely needs a larger size or a code fix; short spikes that return to a low baseline are usually normal. Hover over the graph to see the value at a specific time. If you have multiple Droplets, the Monitoring section of the control panel lets you compare them side by side.
  3. Connect over SSH. From your terminal, run ssh root@your_droplet_ip (replace the IP with the Droplet's public address, and use your own username if you created a non-root user). If you have not set up SSH keys, the control panel's Access tab has a built-in web console you can use instead.
  4. Get a live snapshot with top. Run top. The first few lines show load average and the overall CPU breakdown (user, system, idle, iowait). The process list below is sorted by CPU by default; press P to re-sort by CPU if needed, and q to quit. Watch the %Cpu(s) line: high us (user) means your application is working hard, high sy (system) means kernel work such as networking, and high wa (iowait) means the CPU is waiting on disk.
  5. Use htop for a clearer view. If htop is installed, run htop. It shows per-core bars, a colour-coded breakdown and an easy process tree (press F5). If it is not installed, install it from your distribution's repositories (for example apt install htop on Ubuntu/Debian) and run it again. This is optional; top gives the same core information.
  6. Check historical and per-core data with vmstat and mpstat. Run vmstat 1 5 to print five one-second samples; the us, sy and id columns show where CPU time goes. On multi-core Droplets, mpstat -P ALL 1 5 (from the sysstat package) shows each core separately, which helps spot a single-threaded process pinning one core while the rest sit idle.
  7. Identify the culprit. In top or htop, note the PID and command name of the process using the most CPU. You can then inspect it with ps -p PID -o pid,comm,%cpu,etime to see how long it has been running. If it is a web server or database, correlate the spike with traffic or a scheduled job rather than assuming a bug.
  8. Set up alerts (optional but recommended). In the control panel, open the Droplet's Monitoring tab and look for the alert policy settings. DigitalOcean lets you create CPU alert policies that notify you by email when usage crosses a threshold for a sustained period. This is the practical way to catch a runaway process before users notice.
  9. Query metrics via the API (optional). If you want CPU data in your own dashboards, create a personal access token in the API section of the control panel and call the monitoring endpoints documented at docs.digitalocean.com. The API returns the same time-series data shown in the graphs, which you can feed into a script or an external monitoring service.

Common Mistakes

  • Judging load by the graph alone. The control-panel CPU graph is sampled at intervals, so a brief spike can be invisible. Use the command-line tools when you need to see what is happening right now.
  • Confusing load average with CPU percentage. A load average of 4 on a 2-core Droplet means processes are queuing, even if the CPU graph does not look pinned. Check both.
  • Ignoring iowait. High wa in top or vmstat points to slow disk I/O, not a CPU-hungry application; upgrading the CPU will not fix it.
  • Leaving top running in a forgotten SSH session. It consumes little CPU but can clutter your process list and confuse later readings. Quit it with q when done.
  • Assuming a single busy core means the whole Droplet is overloaded. Many applications are single-threaded; one core at 100% on a 4-core Droplet is a different problem from all four cores saturated.

Tips

  • Run top -b -n 1 to capture a single non-interactive snapshot you can paste into a support ticket or log.
  • Use uptime for a one-line load average check before opening a fuller tool.
  • If you suspect a recurring spike, schedule vmstat or top -b output to a file with cron so you have evidence to compare across days.
  • Keep the Droplet's monitoring agent enabled (it is on by default for Droplets created through the control panel); disabling it removes the graphs and alerts.
  • For long-term trends, export the API data to a spreadsheet or your own monitoring stack rather than relying on the control panel's limited retention window.

Troubleshooting

If the CPU graph is missing or blank, confirm the Droplet is powered on and that monitoring has not been disabled; newly created Droplets can take a short time before the first data points appear. If SSH refuses the connection, check that port 22 is open in the Droplet's firewall and that you are using the correct IP and username. If htop or mpstat is not found, install the package from your distribution's repositories rather than downloading a binary from an unofficial source. If the control-panel graph shows high CPU but top shows mostly idle, the spike may have passed between samples; run vmstat 1 10 to watch a longer window. If alerts are not arriving, check the alert policy's threshold and the email address on the account, and look in the spam folder. If the API returns an authentication error, regenerate the token and confirm it has the monitoring scope enabled.

Frequently Asked Questions

Does DigitalOcean monitor CPU by default?

Yes. Droplets created through the control panel have basic monitoring enabled, which populates the CPU, memory, disk and network graphs on the Droplet's page.

How often does the control-panel CPU graph update?

The graphs are sampled at intervals of a few minutes, so they show trends rather than real-time peaks. Use top or vmstat over SSH for live readings.

What is a healthy CPU usage for a Droplet?

There is no single number. A steady baseline well below 100% with occasional spikes is normal for most workloads; sustained saturation near 100% is the signal to investigate or resize.

Can I get CPU alerts without third-party software?

Yes. DigitalOcean's alert policies in the Droplet's monitoring settings can notify you by email when CPU usage crosses a threshold you set.

Why does one core show 100% while others are idle?

Many applications run as a single process on one core. Check with mpstat -P ALL or htop's per-core view; the fix is usually application-level (worker processes or threading), not a larger Droplet.

Is there a cost to the built-in CPU graphs?

The basic monitoring graphs are included with the Droplet. If you need longer retention or more detail, use the API to export the data to your own monitoring system.