[Asterisk-Dev] pseudo realtime and load issue

Steven Critchfield critch at basesys.com
Mon Aug 22 12:17:36 MST 2005


Pinging fellow developers to look at this patch and possibly make
comments on this buglet.

http://bugs.digium.com/view.php?id=4930

It simply makes the set_priority function globally accessible and
changes it's name to ast_set_priority. Then at any point where we need
to reduce priority we can call it to take care of the priority in a nice
portable manner.

And in AGI after we fork but before we exec the agi script, we reduce
our priority to keep from starving asterisk.

Those worried about asterisk running as a psuedo realtime app due to
busy loops locking the machine should realize this reduces your risk of
locking up as it keeps your AGI apps from being able to load up the
machine too much in a busy loop. 

On Wed, 2005-08-10 at 12:40 -0500, Steven Critchfield wrote:
> When asterisk is run in the pseudo realtime mode, any agi app that runs
> also inherits this priority and can compete with asterisk to complete
> it's task. While some agi apps may not take long to start up and then
> spend a large amount of time waiting for asterisk to reply to events, it
> is the start up time of an agi app that can cause problems. 
> 
> Specifically we have a complex perl script that was causing up to 1
> second of choppy audio on other zap channels when a new call was
> started. It would get worse with the more concurrent calls running as
> asterisk had more work to do and the perl script still had a fixed
> amount of work to get accomplished before it could go to a mostly idle
> state.
> 
> After discussions with Tilghman about the solution, here is a set of
> diffs that I think need a moment more of peer review before being
> accepted. 
> 
> I do have a disclaimer on file with Digium.
> 
> The first two expose the set_priority function for use elsewhere.

-- 
Steven Critchfield <critch at basesys.com>




More information about the asterisk-dev mailing list