The dashboard and a simple ‘top’ show 100% cpu usage with almost all of it in user space. However in top’s program list there are fewer than 10 user programs, most with less than 1% user/system/etc usage. In contrast ‘top -n 1’ shows lots of global idle time.
Can anyone suggest how I can find the CPU hog(s)? These results suggest that some quick to run user space program are running and terminating before a normal ‘top’ can display them.
=============
top - 15:51:49 up 110 days, 23:23, 1 user, load average: 1.30, 1.36, 1.33 Tasks: 126 total, 2 running, 85 sleeping, 0 stopped, 0 zombie %Cpu(s): 83.7 us, 16.3 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 1008828 total, 137280 free, 291796 used, 579752 buff/cache KiB Swap: 0 total, 0 free, 0 used. 410896 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 18643 root 20 0 13732 2036 1292 S 0.7 0.2 531:27.70 /bin/bash /home/noisegraphs/bin/noise_graphs_daemon.sh -a 7 root 20 0 0 0 0 S 0.3 0.0 102:40.03 [ksoftirqd/0] 8 root 20 0 0 0 0 I 0.3 0.0 167:17.85 [rcu_sched] 21067 root 20 0 0 0 0 I 0.3 0.0 0:00.16 [kworker/u2:0] 1 root 20 0 225692 5684 2968 S 0.0 0.6 24:04.54 /lib/systemd/systemd --system --deserialize 35 2 root 20 0 0 0 0 S 0.0 0.0 0:00.61 [kthreadd] 4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 [kworker/0:0H]
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello @mystical ,
I would recommend you to try htop as well. It is basically the same as
top
but the graphs are colourful, more interactive and it’s easier to see the memory and CPU spikes.If you’re not familiar with the use of both utilities I will highly recommend you to check this tutorial:
You can also check our existing tutorial on how to monitor CPU usage on your DigitalOcean droplet:
You can also use sar to check what’s going on in your droplet. With sar, you can monitor the performance of various Linux subsystems (CPU, Memory, I/O…) in real-time.
You can use it like this:
To check the memory usage (Free and Used ):
To check the CPU usage:
Regards, Alex