Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
If I have a process that is running 100 percent (cpu) on a server that has 24 processors, is my cpu utilization 100 percent or is it 100 percent / 24 ?
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Rep:
Quote:
Originally Posted by hokie1999
If I have a process that is running 100 percent (cpu) on a server that has 24 processors, is my cpu utilization 100 percent or is it 100 percent / 24 ?
"Traditionally", it would not be considered running at 100% because you still have 23 more processors that could be doing work. (A nice sitation to be in, IMHO.) You just have a process that wasn't written to be aware of other CPUs and take advantage of them and it's monopolizing one of your processors.
You should be able to comfortably sustain a load of "N" where N=#cpus. Anything above that means there are processes waiting for a CPU. (In the olden days, we'd say there were hamsters waiting for their turn on the wheel.)
Thanks for answer. Let's say this mongod exceeds the single cpu's limit, let's say it's twice what cpu could handle. Would I likely see something like this:
$ top -bn 1
.
.
.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3069 root 20 0 9.857g 9.598g 8440 R 100.0 15.3 2:07.00 mongod
3069 root 20 0 9.857g 9.598g 8440 R 100.0 15.3 2:07.00 mongod
Maybe the PID is an indicator of one process spread out over multiple cpus
I would not expect to see something like that unless the process is doing a heck of a lot of forking, but then I would expect to see the load spread out over most of the processors. The most processor a single thread program can use is 100% of one processor. The situation suggested in your last posting could arise if the same program was fired up as several processes each running a copy of the CPU hog.
Last edited by Rich Strebendt; 08-06-2019 at 02:17 PM.
Reason: spelling error
I would not expect to see something like that unless the process is doing a heck of a lot of forking, but then I would expect to see the load spread out over most of the processors. The most processor a single thread program can use is 100% of one processor. The situation suggested in your last posting could arise if the same program was fired up as several processes each running a copy of the CPU hog.
No, only one process, no forks.
Or, if a process is running really busy, it grabs the one cpu and simply slows down, in other words, it wants 101 percent, but it only gets 100 percent. If that is the case, may explain why some of our processes seem slow, slow as in sluggish to reload configs and rules (this is IDS).
Looks like after it hits 100 it must load balance to another cpu, doesn't say which. By that logic, at 24 cpus on this server, utilization could go to 2400 percent.
Monitorix gives the user the ability to view the history of the processor(s) among other things, I have Cloud and external sites presenting this information.
It is pretty nice and can be installed in almost any Linux/Unix System.
This is a large part of the reason we now have large numbers of "CPUs" in our systems - it all got too hard to keep up with Moore's Law and grow the CPU. Easier to go sideways than up. But that meant code had to become multi-processor aware and multi-threaded to use it all efficiently.
As you've found "top" shows non-normalised numbers - but you'll never get near 2400% as the overheads to manage that multi-threading grow exponentially, for both the application and the operating system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.