Unknown CPU usage - top and ps don't show the cause
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Unknown CPU usage - top and ps don't show the cause
So a few weeks ago a Linux server was having high CPU usage, but we weren't able to determine what program was causing it. The top and ps commands (and others) didn't show any programs using a huge amount of CPU resources, but %idle was at 0 and our monitoring software showed 100% usage. Yet no process was found by ps and top to explain it. The usage was caused by a DBA doing some work, but we never found out why we could not see the application causing the usage.
Now here I am several weeks later and I have the same problem, but this time it is on my Palm Pre. I upgraded to 1.2.1, and now it runs very slowly. A quick top in an SSH session shows:
Now, assuming I'm not just being stupid (which is always a possibility) the first two values on the CPU line show a total of 100% usage, yet no process shows that. The ps command shows a similar result.
So, what is causing the high CPU usage? Why doesn't top and ps show it?
Memory causing high CPU? I don't get it, why would that happen?
The reason low RAM causes high CPU loading is because the system spends a lot of time in swapping operations. This also makes processes take longer in terms of wall time, even when the CPU time statistics look good -- because the system has to wait on drive storage rather than RAM storage.
It is very common on a low-RAM system for the system to be very slow but with no serious CPU loading taking place, all because the system is constantly swapping to the drive instead of reading and writing RAM.
Must of that time is spent in hardware wait states, not CPU time, so it doesn't show up in the CPU statistics, but the machine is very slow.
Those %cpu figures for upstart, dbus, and pmsyslogd look high to me. I'd expect them to be close to or around 0 on a healthy system.
I'd be inclined to have a look through your logfiles for any repeated messages, check if some daemon or other keeps failing and being constantly restarted by upstart.
P.S. Read the manpage for ps and look what %cpu actually means. It's not what you're expecting it to.
I re-installed the OS on my Palm Pre to fix the problem on that, so I will look into that server tomorrow. Right now it is showing high iowait, so even though these have similar symptoms they seem to be different issues. When this started on the server, I don't recall seeing that high iowait though.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.