[asterisk-users] Asterisk high load when streaming MOH

jg webaccounts at jgoettgens.de
Fri Sep 20 09:29:22 CDT 2013


> My CPU load is permanent at 200-250%. I have 7 active mpg123 streams.
My understanding is that the mpg123 stream gets decoded only a single time regardless of the 
number of listeners.
> netstat -t -p shows me each of the 7 IP addresses and Recv-Q has some bytes listed (55000 - 
> 113000) for each IP. According to man netstat Recv-Q means "The count of bytes not copied by 
> the user program connected to this socket". Note the "not". Now, is that good or bad?
I see about the same values. The values should be varying and as low as possible. So 0 for a 
couple of minutes could mean that the stream is dead.
> What I do is simply call killall mpg123 every 10 minutes via cron. Asterisk MOH will restart 
> the process immediately and there will be less than a second of silence for the listener. Not 
> that elegant but it helps with hanging audio streams...
My solution is essentially the same, only the other way around and based on whether a stream 
seems to be dead. "moh reload" essentially kills any mpg123 instances and restarts them. I was 
just too lazy to study the Asterisk sources carefully. When skimming the code there were quite a 
few "Uh Oh. ..." comments, and I assumed that "moh reload" is probably a safer thing to do than 
just killing mgp123.

My system issues an "moh reload" maybe once or twice a day, and sometimes not even a single 
time. When I use Shoutcast streams there a a lot more restarts a day.

jg



More information about the asterisk-users mailing list