Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Background: I have a whole mess of systems running the 2.6.20 and 2.6.22 kernel in what started as a Fedora Core 2 install several years ago. These systems have 8 cpus, as reported by cat /proc/cpuinfo.

My question is, when a process is running that uses multi-threading, does 99.99% CPU usage as reported by top mean 99.99% of every CPU or 99.99% total if you add the usage on each CPU together? In other words, should the maximum percentage be 800% or 100%?

It seems that when one of these processes is at 99.99%, if you look at each cpu individually, they will say 25% utilization (instead of 100%).

Any help is appreciated. If I was unclear or confusing, let me know and I will try to clarify.

UPDATE It seems as though we may have been seeing the low utilization because of a problem with the threading model used by the programmers. They're using user threads as opposed to kernel threads and are seeing limitations in what user threads are allowed to do.

share|improve this question
    
@Justin Bennett - if your program is multithreaded and all threads do some heavy processor linux scheduler will do the job and nicely load all cpus. you dont need to do anything. but that is rarely the case - quite often there are locks or program waits for input from network or iosubsystem. –  pQd Jun 17 '09 at 18:29

2 Answers 2

up vote 3 down vote accepted

99% cpu usage means almost total utilization of single core.

if your system is totally loaded [ couple threads each hogging one cpu ] - you'll see 400% usage on quad core or 800% usage on two quad cores.

processes/threads are re-assigned between cpus - that's why you see 25% of utilisation on each of cores. but you can set affinity for them.. then they'll stick to selected processors/cores.

share|improve this answer
    
How can I tell a process/thread to utilize more than one CPU? I want my multithreaded process to use at least 4 of the CPUs fully (so, 400% I guess). Is there a way I can give the process the ability to do this? Right now, it seems that the process is capped at 99.99%, even though it could certainly go beyond that if allowed to. –  Justin Bennett Jun 17 '09 at 16:13

It shows load per core. Don't forget about a great "top" replacement called htop. It will draw you load of individual cpus/cores.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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