Asterisk Has Consistent 100% CPU Load On One Core

1

http://i.imgur.com/sySQfsH.png

Please note the screenshot. I have an Ubuntu 12.10 box running Asterisk. I ssh'ed into the server the other day to find asterisk running at 100% CPU on one core, and i watched it for several days now, and it is always at 100% cpu on one core. I did some extensive google searching to find other people with the same problem and not very many similar situations like mine. Ideally i would like it to use multiple cores or perhaps just not 100% cpu as i assume this is the reason why i am having quality issues with the lines.

I do not know how to even start to troubleshooting this, does anyone have any ideas?

edit: (Additional info from PBX Admin)

System sees 20-40 active channels on average. All inbound SIP, no transcoding (except mix_monitor on all calls for recordings, which transcodes to gsm), g711ulaw 8kHz.

result of "core show threads" here: http://pastebin.com/n26V5LPE

htop shows asterisk thread (PID 1745) at 106% CPU (main thread it seems).

Quad-core with hyperthreading. Uptime 45 days.

Same behavior with verbosity/debug at levels 0 and 6.

Phone system downtime scheduled soon for lots of little bug fixes and tuneups. Any help is greatly appreciated!

Ace

Posted 2013-01-30T20:30:33.993

Reputation: 111

I have several questions: 1) What version of asterisk? 2) What is mix-mon doing exactly? (It is notorious for using a lot of CPU) 3) are you using hand-edited dialplan? or a prebuilt distro of some sort? 4) You mentioned "quality issues" ... what sort of quality issues? – TheCompWiz – 2013-01-30T21:10:15.440

>1) Asterisk 10.9

2) [DID_trunk_1] exten = _X.,1,Set(CALLFILENAME=did/${STRFTIME(${EPOCH},,%Y)}/${STRFTIME(${EPOCH},,%m)}/${STRFTIME(${EPOCH},,%d)}/${STRFTIME(${EPOCH},,%H%M%S)}-${CALLERID(num)}-${EXTEN}) exten = _X.,n,MixMonitor(${CALLFILENAME}.gsm) exten = _X.,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes) exten = _X.,n,Set(TIMEOUT(absolute)=21600) ;6 hours exten = _X.,n,Goto(DID_trunk_continue,${EXTEN},1)... === 3) Yes, hand-edited, extensively. === 4) PBX Admin has not heard consistent quality complaints, and could not isolate them to softphone, PBX, or caller. – Ace – 2013-01-31T17:35:45.533

@TheCompWiz sorry for the above comment, im not satisfied with the formatting, so heres a paste in response to your questions: [http://paste.ubuntu.com/1593633/] – Ace – 2013-01-31T17:38:43.240

Have you tried disabling the transcoding? (mixmon to a .g711 instead) What kind of channels are you using? IAX? Dahdi? SIP? ??? I've heard of problems with chan_iax sticking at 100% CPU... if you're not using it... disable it. – TheCompWiz – 2013-01-31T19:18:25.807

yeah, last night while we could afford some downtime, we rebooted the server and disabled all modules and no active channels, still 100% cpu

we are considering reinstalling OS and asterisk as a troubleshooting step. – Ace – 2013-01-31T20:42:11.097

Answers

0

it looks like our PBX admin was using a strange init script to start the service, therefor causing the CLI to loop. we were unable to see the loop over ssh, and were only able to see it once plugging in a monitor.

we grabbed the original init script from the deb in ubuntus official repository and that fixed the high CPU problem, but also caused other permissions issues that we addressed as well... needless to say, i like official repository packages made for the flavor of linux we use rather than building from source!

Ace

Posted 2013-01-30T20:30:33.993

Reputation: 111