LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Lazy 2nd CPU (https://www.linuxquestions.org/questions/linux-hardware-18/lazy-2nd-cpu-333248/)

circusbug 06-13-2005 06:53 PM

Lazy 2nd CPU
 
Greetings,

I have a Tyan K8WE motherboard with a pair of Opteron CPUs running Fedora 3. I also have a pair of 6-port gigabit NICs plugged into each of two PCI Express slots. I have configured the box as a router with IP forwarding turned on. I can get about 4.7 Gbps of aggregate traffic through it but I think there is room for more.

The problem is that only one of the CPUs is doing all the work. CPU1 is at 10% utilization while CPU2 is at more than 90% utilization.

Can anyone tell me how to get the CPU1 to do more work?

Thanks.

jailbait 06-14-2005 02:41 PM

"The problem is that only one of the CPUs is doing all the work. CPU1 is at 10% utilization while CPU2 is at more than 90% utilization.

Can anyone tell me how to get the CPU1 to do more work?"

The CPU is probably not the bottleneck. It is possible that by tuning some other resource that your throughput will increase and incidentally increase your CPU utilization. Here is an article about performance analysis on Linux:

http://geminis.dyndns.org/wordpress/...ysis-on-linux/

--------------------------
Steve Stites

Matir 06-14-2005 02:47 PM

In reality, CPU loads heavily depend on the type of application being run on the system. If you are just using iptables style work, then my money would be on the packets being processed by a single kernel-level thread. One thread means one processor. :)

If you really want to test your system, give this a shot: (NOTE: Do not try this on a production system. In fact, don't try it all unless you like hot processors and nonresponsive systems).
Code:

#include <sys/types.h>
#include <unistd.h>

int main(){
    while(1) fork();
    return 0;
}

Again: try that at your own risk. Or preferrably, don't do it if you don't know what it does. :)

cheahfs 06-14-2005 05:25 PM

That's just pure evil. :p

circusbug 06-15-2005 11:16 PM

:confused: Yikes. I'm afraid I don't have the slightest idea of what you're talking about. I'm a HW developer, not a coder. I wouldn't know what to do with that snipit of code you provided. Sounds promising, though. What I need is a cookbook for the Complete Linux Idiot.:(

Kahless 06-19-2005 01:19 AM

heres your book

http://www.icon.co.za/~psheer/book/

heres a shorter one if you want a short story rather than a novel

http://www.slackware.com/book/


All times are GMT -5. The time now is 07:19 PM.