[Asterisk-Users] IAX2 Vs SIP cpu load

Paul Hewlett paul at cottonpickinminds.co.za
Fri Jun 16 03:21:45 MST 2006


On Tuesday 13 June 2006 16:49, Colin Anderson wrote:


> It's generally well-known that a "fake" SMP machine such as a
> HyperThreading CPU affects Asterisk negatively, and best practice is to
> disable
> HyperThreading. However, "real" SMP machines have no trouble (I use a 4 way
> Xeon). 

   This is because HT machines still only have 1 floating point unit - 
transcoding uses FP (particularly if MMX is enabled) and any advantage from 
executing 2 threads at once is lost when bottlenecking at the FPU.

True SMP has an FPU per processor so this does not then apply
 
> It's possible to "pin" a process to a specific CPU, and in fact, I 
> do this to force Asterisk to it's own CPU, and pin all other processes to a
> specific CPU that Asterisk does *not* use:
>
> setasteriskaffinity.sh:
>
> #!/bin/bash
> ASTERISKPID=`ps -A | grep -a -A0 "asterisk"`
> taskset 0x00000003 -p  ${ASTERISKPID:0:5}

  Why not do this when starting asterisk ?

   taskset 0x00000003 -- /usr/sbin/asterisk -p

>
> This "pins" Asterisk to CPU # 4 on a 4 way system. Repeat for all other
> processes, to different CPU's with the affinity mask:
>
> 0x00000000 = CPU 1
> 0x00000001 = CPU 2
> 0x00000002 = CPU 3
> 0x00000003 = CPU 4

   It is better to use the 'isolcpus' kernel parameter at bootup to disable a 
particular CPU and then put asterisk on that CPU. Trying to set CPU affinity 
for all other processes evidently has problems... 

Also later kernels now support the concept of 'sets' similar to solaris. 

Paul Hewlett

>
>
> -----Original Message-----
> From: Jon Schøpzinsky [mailto:jos at detele.dk]
> Sent: Tuesday, June 13, 2006 8:14 AM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: [Asterisk-Users] IAX2 Vs SIP cpu load
>
>
> Hello
>
> Is it correct that IAX2 uses more CPU, than SIP? Also, can it be true that
> IAX2 is much more sensitive against high CPU loads?
> Also, does Asterisk support and use multiprocessor architectures, such as
> Xeon?
>
>  
> Regards
> Jon



More information about the asterisk-users mailing list