[Asterisk-Users] Asterisk CPU priorities (nice?)

Gilad Ben-Yossef gilad at codefidence.com
Mon Jan 3 10:13:05 MST 2005


Matt Schulte wrote:
> Had a good question for the list, it seems whenever I work in an
> Asterisk console or on the machine normally I get jitters on any audio
> going through it. Especially if you did file copies or a 'ps ax' for
> example. I was wondering if there was a proper way to 'nice' the
> asterisk proc's? Cisco does this for example to it's "EXEC" and icmp
> processes, I tried reniceing the asterisk processes with very bad
> results, especially when I/O (voicemail, etc) comes into play. I'm not
> swapping out or anything, ideas?
> 


Since VoIP is a real time activity, simple "nice" really isn't enough. 
What you should do is mark the Asterisk proccess as a real time task for 
the Linux kernel to schedule accordingly. You can do this with Asterisk 
by passing the "-p" option to the Asterisk command line.

A warning is due here: real time priority scheduled tasks are not 
something to be toyed with. You need to be root to be able to turn on 
this feature (meaning you have to be running Asterisk as root). A bug in 
Asterisk, a problem with mpg123 or a red alert on a FXO card can very 
well leave your system completly non responsive - so use with care.

Having said that, I've been running an Asterisk server on a machine 
which is also used as SOHO firewall and file server for year now and it 
works great.

Hope this helps,
Gilad



More information about the asterisk-users mailing list