[asterisk-users] Asterisk -rx, how expensive is it? Should you avoid "spamming" it?

Scott Griepentrog sgriepentrog at digium.com
Thu Apr 24 14:36:39 CDT 2014


The Stasis message bus and caching is introduced in Asterisk 12.
https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+API+Improvements
Note that as it's fairly new, in some cases older code may still lock data
structures during operations rather than read the cache.

You will also want to see if ARI (
https://wiki.asterisk.org/wiki/display/AST/Getting+Started+with+ARI) can
provide what you need.  This is newer code and more likely to use the cache
and be efficient.



On Thu, Apr 24, 2014 at 2:12 PM, Mikael Fredin <mikael at wiraya.com> wrote:

> Thank you, that's very useful information! Does the same go for issuing a
> "sip show peers" through the AMI? And do you know where I could find
> information of what asterisk versions may use cached information instead?
>
> What would you suggest be better ways to monitor asterisk information?
>
>
>
>
> On 24 April 2014 17:58, Scott Griepentrog <sgriepentrog at digium.com> wrote:
>
>> How much Asterisk is affected depends on both how often you run a
>> command, and even more significantly, what command you run (and which
>> version of Asterisk).
>>
>> Commands that display information about every active channel, for example
>> "sip show peers", may slow other processing significantly because they have
>> to briefly lock the data structures to insure valid information.  There
>> have been improvements in more recent versions of Asterisk that reduce the
>> negative affects of this by looking at cached information instead of
>> locking everything.
>>
>> On the other hand, requesting specific information (sip show peer X) or
>> more generic information (sip show inuse) will have much less affect on
>> other activity in Asterisk.
>>
>>
>>
>> On Thu, Apr 24, 2014 at 5:20 AM, Mikael Fredin <mikael at wiraya.com> wrote:
>>
>>> Just like the subject sais - how expensive is it to execute a lot of
>>> these commands to keep track of different things in asterisk?
>>>
>>> I have avoided doing this because it feels a bit like a risk to spam the
>>> asterisk CLI this way, but is it really?
>>>
>>> CPU-wise it doesn't seem very expensive to do it 100 times a second
>>> (from a simple test I did), but is it possible it will affect the asterisk
>>> service in any other negative way?
>>>
>>> Regards,
>>> Mikael
>>>
>>> --
>>> _____________________________________________________________________
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>>                http://www.asterisk.org/hello
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>
>>
>>
>> --
>> [image: Digium logo]
>> Scott Griepentrog
>> Digium, Inc · Software Developer
>> 445 Jan Davis Drive NW · Huntsville, AL 35806 · US
>> direct/fax: +1 256 428 6239 · mobile: +1 317 507 4029
>> Check us out at: http://digium.com · http://asterisk.org
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>                http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
[image: Digium logo]
Scott Griepentrog
Digium, Inc · Software Developer
445 Jan Davis Drive NW · Huntsville, AL 35806 · US
direct/fax: +1 256 428 6239 · mobile: +1 317 507 4029
Check us out at: http://digium.com · http://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140424/ee14c631/attachment.html>


More information about the asterisk-users mailing list