[Asterisk-Dev] IAX phones and CPU usage problem

Grzegorz Nosek blackfire at metal.art.pl
Mon Dec 1 07:08:49 MST 2003

On Sun, 30 Nov 2003 10:04:19 -0500, Claude Klimos wrote
> Hi all,
> We have an asterisk server running on redhat 9, with a 
> TE410P card connected to 4 PRIs, on a dual 2.6GHz xeon 
> server with 2GB of RAM. We also have 10-12 agents using IAX 
> based softphones on winxp. Almost all of the usage consists 
> of outbound calls done automatically through the PRIs and 
> connected  to an agent once answered. The agents perform the 
> 'ready' operation via IAX by calling iaxc_call() to call an extension
> that in turn calls AgentLogin. The 'Not ready' operation is done
> automatically once the phone call ends by invoking 
> iaxc_dump_call(). This ready/not-ready sequence is made 
> repeatedly, for every call connected to an agent.
> We noticed that the CPU usage of Asterisk if increasing with 
> time. When we start Asterisk, everything seems ok, but with 
> time the CPU usage goes higher and higher. After a day of 
> work or so, the 'top' command shows that Asterisk is 
> consuming around 90-95% of the CPU, some times 100%, and the 
> voice on the softphones suffers dramatically.
> When all the agents become Not Ready by doing an 
> iaxc_dump_call(), the CPU goes down to 1-2%. As soone as one 
> softphone does a iaxc_call() the CPU jumps up again. This 
> situation is very serious to us especially since we are 
> planning to deploy over 50 agents on this system.
> Any ideas, hints, recommendations are greatly appreciated.
> Regards,
> Claude


I recall somebody on the -users list said that RH9 has some issues
with threads eating much cpu and that exporting the env var
LD_ASSUME_KERNEL=2.4.1 changes the semantics to something more robust.
I don't use RH however, so YMMV.

Other than that, check if you don't do unnecessary codec conversions
(try G.711 on a LAN, though I'm not sure libiaxclient supports it.
Anyway, code is trivial and easily found)

my 0.02PLN,
 Grzegorz Nosek

More information about the asterisk-dev mailing list