Mikael Fredin
2014-Apr-24 10:20 UTC
[asterisk-users] Asterisk -rx, how expensive is it? Should you avoid "spamming" it?
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140424/2fc781d7/attachment.html>
Scott Griepentrog
2014-Apr-24 15:58 UTC
[asterisk-users] Asterisk -rx, how expensive is it? Should you avoid "spamming" it?
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140424/82385fae/attachment.html>
Tzafrir Cohen
2014-Apr-24 17:47 UTC
[asterisk-users] Asterisk -rx, how expensive is it? Should you avoid "spamming" it?
On Thu, Apr 24, 2014 at 12:20:37PM +0200, Mikael Fredin 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?It "feels" very expensive. Part of it is because of starting a new instance of Asterisk. It will not load any module and such, but if you care about speed, you can use netcat (it takes some care). You'll also encounter some artificial delays in the response which make it feel more expensive. The main reason to avoid it is because its output is not intended for automated parsing. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com