[asterisk-dev] [Code Review] 2907: "queue show some_queue" caused unnecessary realtime lookups

svnbot reviewboard at asterisk.org
Wed Oct 16 06:04:04 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2907/
-----------------------------------------------------------

(Updated Oct. 16, 2013, 6:04 a.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 401049


Repository: Asterisk


Description
-------

When using realtime queues, queues have to be fetched from the database every now and then to see if any info has been changed or to see if the queue has been removed.

The 'queue show' command does a lookup for every queue in memory to see if the queue still exists. However, it also does that when we attempt to get info for a single queue only.

This patch fixes that: if there is an optional queue name that we look for, we skip the realtime lookups for other queues.


Diffs
-----

  /branches/1.8/apps/app_queue.c 400957 

Diff: https://reviewboard.asterisk.org/r/2907/diff/


Testing
-------

For a very limited set of queues, that extra lookup could become severely slow:

mysql> select count(*) from asterisk_queue;
+----------+
| count(*) |
+----------+
|      471 |
+----------+


Before:

$ time asterisk -nrx 'queue show abcdef'
No such queue: abcdef.

real	0m30.519s
user	0m0.010s
sys	0m0.000s


After:

$ time asterisk -nrx 'queue show abcdef'
No such queue: abcdef.

real	0m0.004s
user	0m0.010s
sys	0m0.000s


(Similar times when the queue *is* found.)


Thanks,

wdoekes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131016/50ea0af0/attachment-0001.html>


More information about the asterisk-dev mailing list