If I run a process as root on an out-of-the-box fedora machine, is there any reason for a process to not be able to use up ~80% of the cpu?
-
Not that I'm aware of. Can you be more specific about why you think this is the case?– Peter RowellDec 25, 2009 at 0:02
-
3This question is far more suited for ServerFault.– DavDec 25, 2009 at 0:02
-
If it's a multicore machine, it can use no more than 100% of one core. So, on a 4-core machine it will be limited to 25% CPU.– ArteliusDec 25, 2009 at 0:04
3 Answers
There are several reasons why a process might not use up all of the CPU. A process may have a limitation on how much CPU it uses, such as a loop that sleeps every once in a while in order to avoid using too much CPU or battery. Or a process may be I/O bound; that is, it needs to do I/O frequently (disk I/O, network I/O, or swapping in lots of memory). A process may also be nice
d to be lower priority and take up less CPU when another process needs it.
Any process can use 100% CPU. Even on a multicore machine - it could spawn threads or child processes which are run on the other cores. Generally if the process is using 100% CPU, it is because it is CPU bound and must do so to complete its work. There is nothing wrong with this, unless the app is written inefficiently.
You may want to look at renice if you want the process to share the CPU more nicely with other processes.
(Hope the link is OK by you, mgb.)