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

wdoekes reviewboard at asterisk.org
Tue Oct 15 07:36:18 CDT 2013


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

Review request for Asterisk Developers.


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/20131015/74cb52e2/attachment.html>


More information about the asterisk-dev mailing list