Reg. Asterisk linux Machine CPU usage

Hi,

I have Dell Poweredge 2800 machine with two processor and 3 gb ram. Just seeing the CPU usage on 10 active SIP channels and got the following CPU usage…

Sometimes when we do the conference bridge , we used to experience the Voice breaking…

Please guide i can do some thing using the usage detail to optimise the CPU usage so that will have better performace… over conference call , etc…

Rizwan

10:26:09 up 9 days, 57 min, 3 users, load average: 3.07, 3.13, 3.09
113 processes: 103 sleeping, 9 running, 0 zombie, 1 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 71.9% 0.0% 28.0% 0.0% 0.0% 0.0% 0.0%
cpu00 71.8% 0.0% 28.1% 0.0% 0.0% 0.0% 0.0%
cpu01 72.0% 0.0% 27.9% 0.0% 0.0% 0.0% 0.0%
Mem: 3082236k av, 677912k used, 2404324k free, 0k shrd, 158944k buff
352468k active, 97184k inactive
Swap: 2040212k av, 0k used, 2040212k free 304168k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
1418 root 25 0 1684 1680 1336 R 40.7 0.0 219:36 0 asterisk
12904 root 25 0 1696 1692 1344 R 33.7 0.0 5341m 1 asterisk
23146 root 25 0 12112 11M 5228 R 24.4 0.3 1539m 0 asterisk
4462 root 15 0 12112 11M 5228 S 0.5 0.3 0:12 0 asterisk
1 root 15 0 488 488 432 S 0.0 0.0 0:07 0 init
2 root RT 0 0 0 0 SW 0.0 0.0 0:00 0 migration/0
3 root RT 0 0 0 0 SW 0.0 0.0 0:00 1 migration/1
4 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 keventd
5 root 34 19 0 0 0 SWN 0.0 0.0 0:00 0 ksoftirqd/0
6 root 34 19 0 0 0 SWN 0.0 0.0 0:00 1 ksoftirqd/1
9 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 bdflush
7 root 15 0 0 0 0 SW 0.0 0.0 0:02 1 kswapd
8 root 15 0 0 0 0 SW 0.0 0.0 0:31 0 kscand
10 root 15 0 0 0 0 SW 0.0 0.0 0:14 0 kupdated
11 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd
18 root 25 0 0 0 0 SW 0.0 0.0 0:00 1 scsi_eh_0
21 root 15 0 0 0 0 SW 0.0 0.0 0:00 1 kjournald
76 root 24 0 0 0 0 SW 0.0 0.0 0:00 1 khubd
3473 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kjournald
3474 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kjournald
3475 root 15 0 0 0 0 SW 0.0 0.0 0:34 1 kjournald
3476 root 15 0 0 0 0 SW 0.0 0.0 0:00 1 kjournald
4013 root 15 0 576 576 492 S 0.0 0.0 0:08 1 syslogd
4017 root 17 0 452 452 392 S 0.0 0.0 0:06 0 klogd
4027 root 15 0 456 456 392 S 0.0 0.0 0:24 0 irqbalance
4044 rpc 15 0 604 604 528 S 0.0 0.0 0:00 0 portmap
4063 rpcuser 15 0 784 784 676 S 0.0 0.0 0:00 0 rpc.statd
4237 root 15 0 1512 1512 1256 S 0.0 0.0 0:03 0 sshd
4251 root 24 0 852 852 732 S 0.0 0.0 0:00 1 xinetd
4278 root 15 0 2512 2512 1840 S 0.0 0.0 0:08 1 sendmail
4287 smmsp 15 0 2216 2208 1672 S 0.0 0.0 0:00 0 sendmail
4297 root 15 0 464 464 408 S 0.0 0.0 0:00 0 gpm

Are you using g729 ? Any transcoding ? How many users in the confrence at once ? What else is running on the box. The CPU average is at 300 %. There is something that is killin the CPU. That will affect call quality. You have to see what it is. Can you post what you get from top when the CPU usage is real hi ?

Hi Dovid,

1.We use only g729 codecs.

2.Apart from asterisk, mysql, apache,php ,iptables services running in that machine…

3.We get voice breaking at conference call , 6 persons will be particapting in the bridge. Moreover the only one bridge was active at that time…

4.The above post ,i have included the top cmd results obtained from Linux machines when are at conference and that we experience the voice breaking issues.

I shall be thankfull, if you can help me to find the real cause which is killing my CPU …

Thanks in advance…

I have asterisk machine TDM2400p card attached for fxo trunks and 24 PSTN lines connected to it…

Thanks in advance

i shall be thankfull, if anyone can help on the same…

thanks in advacne

i’ll give this a shot…

I dont use g.729 much but I know it has a high CPU load. Esp since you are encoding (between pots lines and SIP users)…
I would suggest if the SIP users are on your LAN try switching to GSM or ulaw codec which will go much easier on your CPU.

Also make sure you have the right g.729 module for your machine architecture, if it’s compiled for the wrong CPU type you won’t get good performance…

I would say you have a serious problem.

What is the AGI thats being called?

what happens if you define a simple dial plan

IE Dial(SIP/1234) etc No agi no macro etc and see whats happening.

Ian

helix,

i will try using ulaw as codec for LAN user and i have 60 number for remote users and i have to use g.729 only…

as for the g.729, is being installed with help from Digium support executive… any how i will check one more time …

Hello ian,

i did not get you please…

thanks in advance

The SNMP mechanism in asterisk is non existent or if it exists there is a lot of expectations on it.

I don’t know if any advanced SNMP mechanisms are provided in the 1.4 release.

Other the codec translation costs there is a need to find out how much simultaneous calls are supported maintaing the QoS.
There needs to be a mechanism to find out the resources(CPU,memory) used for each call. More specifically some commands or logs regarding resource usage.
Having priorities assigned to each tunks in the sense that when the call quality degrades the less priority calls are dropped.

Hi helix,

I have a question here for the cases.

case 1:

only g729 for all the users…

1.compression and decompression takes place only when i call outside… (transcoding right) and CPU will be utilisation will be high as you suggested.

2.if the call is within the extensions, there is no compressions and decompression right in astersk .IP phone will be doing the comp and decomp.

case 2 :

LAN users got ulaw and remote users have g729.

1.when LAN SIP users call outside , there will not be any transcoding right…

2.Even when LAN SIP extension user call the remote sip extensions the there will be compression right… g711 to g729 and again the CPU will be utilised more for this right… Now it is burden to CPU for comp. and decomp.for LAN to remote, right…

so there will be burden to CPU when we call within the extension too…

what would you receommed in this cases? please correct me if i am wrong

Thanks in advance

depends on ‘outside’. As I recall you said you have PRIs, which means yes Asterisk transcodes g.729 to ulaw/alaw for the PRI.

If two IP phones call each other on your * box and they both are allowed to use g.729, then it will do that. Both phones must have allow=g729 in their sip.conf entries.
You can prioritize, ie disallow=all, then allow=ulaw and finally allow=g729. That will make the phones support end to end 729 when talkign to a remote user, easing load from *. also make sure remote users don’t have allow=ulaw, just disallow=all and allow=g729.

So if you set:
so if lan user has disallow=all, allow=ulaw, allow=g729
and WAN (remote) user has disallow=all and allow=g729
Then things will happen as follows:
LAN calls LAN- ulaw allowed on both sides and is higher priority than g729. call goes throug with passthru ulaw (server does not transcode)
LAN to WAN- WAN user supports only g729. LAN user also supports 729 but its a lower priority than ulaw. * will try to avoid transcoding if possible, so call is established with passthru g729 (server does not transcode)
PSTN to LAN- call takes place ulaw/alaw, I believe the raw ulaw is passed off the PRI. If not encoding ulaw is easy (server probably does not transcode, and if it does there is very little CPU used)
PSTN to WAN- Because WAN user requires g729, server will encode g729 for the WAN user. This creates higher CPU usage.

does that help?

yes, Thanks…