[Asterisk-Users] Asterisk CPU priorities (nice?)
Steve Kann
stevek at stevek.com
Tue Jan 4 13:53:36 MST 2005
Gilad Ben-Yossef wrote:
> Justin Carlson wrote:
>
>> what is wrong with running asterisk with the -pg flags at startup?
>
>
> Which is exactly what I suggested:
>
>>>
>>> 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.
>>>
>
> And the warning still holds:
>
>>> 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.
>>
This is a problem that can be solved in asterisk, though, with a
watchdog, and/or something more elegant. I've implemented this in
iaxclient (it gets used automatically if you use iaxclient as root on
linux), and it should be done for asterisk as well.
See http://bugs.digium.com/bug_view_page.php?bug_id=0003203
If this is implemented in asterisk, and asterisk swamps your machine for
more than N seconds (where N is 4, for example), the real-timedness of
asterisk goes away..
-SteveK
More information about the asterisk-users
mailing list