1

top command shows the process cpu utilization, and it when we sum the cpu utilization of all the processes then it goes greater than 100%. And how can it shows the cpu utilization of each process( app. > 300 process) in very short span of time. There is a question about cpu usage by a process

that tells us to sleep for 1 second. And according to that solution Cpu usage by a process is different from top command output. so please tell me about right solution. My computer has the configuration Intel core2duo and ubuntu 10.10.

2

Top has two modes for computing the CPU load, one called Solaris mode, is counting the effective CPU load so with a two core CPU, the maximum load will be 200%. The other one is called Irix mode. It is showing the load divided by the number of CPUs, so the maximum shouldn't excess 100%. You toggle from one mode to the other with the "I" key.

  • So if we want to calculate cpu usage in "solaris mode" then we have to consider "cpu0" and "cpu1" entry separately. And I saw the source code of top implementation it uses hash table to retrieve results very fast. But is there another way to do this. – Sushant Jain Apr 29 '11 at 3:13
  • CPU usage reported in Solaris mode is as much correct as it is in Irix mode. What problem are you trying to solve ? – jlliagre Apr 29 '11 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.