only 2 of 4 CPUs are working. What I'm doing wrong ?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
CPU#2 and CPU#3 are idle, but If I try to run ./some_script they are being used.
What the PC does it is a shaping machine which serves around 150mbit link and does
per IP shaping. At peak times CPU#0 and CPU#1 are 50% idle, but CPU#2 and CPU#3
aren't in use.
What I could be doing wrong ? Maybe I have missed something ?
I'm running kernel 2.6.20.6 with no patches.
I'm not sure what you are expecting to see. Your system is idle, with only one running task. What do you think the CPUs should be doing in that case?
How many running processes were there when "CPU#0 and CPU#1 are 50% idle, but CPU#2 and CPU#3 aren't in use"? Unless there are more than two runnable processes, only two CPUs will be used (processes cannot be "split" across CPUs).
Personally, I'd *love* to have this problem ...
You'd need a lot more evidence to say there is actually a (real) problem here. It is possible for code to use CPU affinity (for multiple tasks), but not likely if it's generic code.
I'm not sure what you are expecting to see. Your system is idle, with only one running task. What do you think the CPUs should be doing in that case?
How many running processes were there when "CPU#0 and CPU#1 are 50% idle, but CPU#2 and CPU#3 aren't in use"? Unless there are more than two runnable processes, only two CPUs will be used (processes cannot be "split" across CPUs).
Hi, thanks for the tips.
so it is something like CPU#0 is used for inbound and CPU#1 is used for outbound ?
Quote:
Personally, I'd *love* to have this problem ...
You'd need a lot more evidence to say there is actually a (real) problem here. It is possible for code to use CPU affinity (for multiple tasks), but not likely if it's generic code.
So i need tosearch for patches somewhere on the net or write my own ?
Since I use in-kernel tc for traffic shaping, is it possible to tell tc to use for example CPU#3 ?
As I understood, if i am routing the packets and I have eth0 + eth1 (for routing). the routing uses interrupts so those interrupts are handled as is:
eth0 <> cpu0 and eth1 <> cpu1 and if I *somehow* find a place for eth2 then CPU#2 would start to work and I'd have only CPU#3 in idle.
You are not understanding Linux scheduling and dispatching. It has nothing to do with application-level function; processes that are runnable (in need of CPU resources) are allocated to an available processor (with some limitations for performance).
If you have a thousand idle processes, but only two processes that need CPU resources, only two CPUs will be used. The rest remain in queue, not runnable.
Unless the load on any core exceeds 100%, you would see no performance boost by further distributing the load. In fact, due to caching mechanisms, you would likely see a decrease in performance. In order to use 4 cores, you need 4 threads running simultaneously. That being said, there are a LOT of threads on the system, they just may not be active when you are looking.
Okay, this is a bit related but not quite on track. I'm confused. I have no idea what the specs on my server are. cpuinfo reads four processors so I assumed that I had four. Now, when this thread listed his top I got worried. My top does not display multiple processors. Is there any way to be sure without taking the thing apart?
´1´ :Toggle_Single/Separate_Cpu_States -- On/Off
This command affects how the ’t’ command’s Cpu States portion is
shown. Although this toggle exists primarily to serve mas-
sively-parallel SMP machines, it is not restricted to solely SMP
environments.
When you see ’Cpu(s):’ in the summary area, the ’1’ toggle is On
and all cpu information is gathered in a single line. Other-
wise, each cpu is displayed separately as: ’Cpu0, Cpu1, ...’
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.