LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   CPU hign usage (https://www.linuxquestions.org/questions/linux-software-2/cpu-hign-usage-924795/)

ericyao 01-20-2012 09:07 AM

CPU hign usage
 
Dear All

I found that my Fedora 12 running slowly due to CPU higher usage even I reboot still same issues. I tried to used top to traced which process caused but fail even I sort by CPU, I also can't trace which process caused my CPU higher usage, is there anyone can help me? or other command can help to trace?



top - 22:58:52 up 6:26, 4 users, load average: 3.75, 3.91, 3.87
Tasks: 185 total, 3 running, 182 sleeping, 0 stopped, 0 zombie
Cpu0 : 4.0%us, 1.3%sy, 0.0%ni, 22.6%id, 72.1%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 0.3%us, 0.7%sy, 0.0%ni, 76.9%id, 22.1%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2027032k total, 863940k used, 1163092k free, 48068k buffers
Swap: 4194232k total, 0k used, 4194232k free, 450000k cached

PID  USER  PR  NI  VIRT  RES  SHR  S  %CPU  %MEM  TIME+  COMMAND
3145  root  20   0  2580  1136  848  R  0.3   0.1   0:03.59  top
32673  eric  20   0  2580  1144  852  S  0.3   0.1   0:05.92  top
1    root  20   0  2040  920  700   S  0.0   0.0   0:01.00   /sbin/init
2    root  20   0   0   0   0    S  0.0    0.0   0:00.00  [kthreadd]
3    root  RT   0   0   0   0    S  0.0    0.0   0:00.02  [migration/0]
4    root  20   0   0   0   0    S  0.0    0.0   0:00.00  [ksoftirqd/0]

rainbowsally 01-20-2012 09:21 AM

Quote:

Originally Posted by ericyao (Post 4579814)
Dear All

I found that my Fedora 12 running slowly due to CPU higher usage even I reboot still same issues. I tried to used top to traced which process caused but fail even I sort by CPU, I also can't trace which process caused my CPU higher usage, is there anyone can help me? or other command can help to trace?


I can't read your text but I think I recognize some kde stuff in there so I'll bite. :-)

Assuming you have KDE.

1. Turn NEPOMUK OFF!! It's a cpu hog and 'locate' does it better and nicer.

2. As superuser, turn /etc/PackageKit OFF!! By renaming the config file. Otherwise it sits there trying to get online every few seconds.

3. If you have ksysguard (Ctrl-ESC or run by typing the name on the commandline) you can click on the top bar and add PID display as well as CPU to the lists and click on the PIDs or CPU times to sort in ascending or descending order.

That will show you who the culprits are and when they started.

View as a 'tree' to see the relationships of the offending apps. You can do that with 'ps' also and probably whatever you got your dump with, if I miss my guess about KDE here.

Best of luck. :-)

.

rainbowsally 01-22-2012 01:06 AM

Also, I just realized that some distros come with Tracker set up by default.

You can uninstall it if that's sucking up cpu time. It has no dependencies on it that I know of and it will hog time like crazy if you have a lot of files in your HOME directory.

salasi 01-22-2012 04:39 PM

Well, what you are asking us to do with that data won't work, and it probably can't work for you, either.
  • Are you actually saying (you didn't say, but it may be the inference that you intended us to take) that the output that you posted was sorted according to cpu usage? In any case, it only has six tasks, and two of those are tops, one run by root and one by eric (I assume that's you). I'm pretty sure that you have rather more tasks running.
  • In any case, you will have noticed that most of the cpu percentage is going on (io)wait; this isn't going to show up, broken down by task, in top, so that makes top a rather blunt tool for this kind of problem.
  • your next step is to find out what is causing the wait; it is probably some kind of IO; so you need to find out if it is disk, network, etc.
  • Either having done that, (or, potentially slightly more difficult) you need to go around trying to pin down the cause of the IO - it might be immediately apparent, once you know what kind of IO it is (...eg, ok, so the only thing using the network is Blah, and we know it is network IO, so we know it is Blah)
  • A useful tool, in this kind of circumstance, is iotop. Now, it is easier to go straight to the scene of the criome if you know what kind of IO you are looking for, but if you don't and can't find out, you can just go through the types of IO that it might be, and see which it actually is.
  • At that point, you've either got some IO that you were expecting, but is chewing up a lot more time than you were expecting (why?) or some IO that you weren't expecting (err, why?, again)


All times are GMT -5. The time now is 09:09 AM.