Asterisk on Quad Core / Dual Core CPU

While running Asterisk on a Quad Core / Dual Core CPU only one Core is used.
Is there any way to compile Asterisk in multithreading modus to use all cores of the CPU?

That’s basically not true. In fact we had to use a quad core machine to identify some bugs in Asterisk, because a virtual machine didn’t have enough concurrency to reveal them.

Asterisk uses pthreads and is heavily multi-threaded.

I don’t know what happens on Windows, but one wouldn’t normally make serious use of Asterisk on Windows.

While running an stress test on this asterisk server (Asterisk 1.4.26.2) on OpenSuse 10.3 with SMP Kernel the CPU Load of asterisk is going to ~100% but onlyon one core.
The 3 other cores are beetwen 0-5%.

All asterisk threads here (for music on hold meetme and ulaw/alaw coding) are running on only one core and don’t use the other cores of the CPU.

I can see this via htop or top command.

Is there a way to enable the use of all cores? If this an misconfiguration on my site?

There is no reason why Asterisk would do this and a quick scan of the 1.6.1.0 code indicates no calls to any processor affinity system calls. You might want to verify this by using taskset(1).

I tried it on our 4 core test bed and it is showing all cores allowed:

[root@server2 ~]# taskset -p 6366
pid 6366’s current affinity mask: f

It is possible that you have some common resource such that the processing that requires significant CPU time is always done with that particular resource locked.