Running on branch/1.4 I have been watching some the queries from Asterisk and I think I have a place where some efficiency can come, but I am at a lost as to what is calling it... It appears that every 10-15 seconds, every mailbox INBOX and Old gets queried for the number of voice mail files. I have exposed SIP to verify that it wasn't the phones requesting. It is not much of a problem in a small voice mail system, but if there are 500 mailboxes, that is over 1000 queries per event and if it is occurring every 15 seconds that is 4000 queries a minute just to see if the voice mail has change. So I would like to change this, just not sure where to look. It seems to me we only need to query this when we call the VM app or a user enters the VM system. That does leave a problem for outside changes via the database on clustered systems, but... I believe there is a way around that where we could have 1 query every defined number of seconds. Just need to know how to find out what is polling that function.
Tony Plack wrote:> Running on branch/1.4 > > I have been watching some the queries from Asterisk and I think I have a place where some efficiency can come, but I am at a lost as to what is calling it... > > It appears that every 10-15 seconds, every mailbox INBOX and Old gets queried for the number of voice mail files. > > I have exposed SIP to verify that it wasn't the phones requesting. > > It is not much of a problem in a small voice mail system, but if there are 500 mailboxes, that is over 1000 queries per event and if it is occurring every 15 seconds that is 4000 queries a minute just to see if the voice mail has change. > > So I would like to change this, just not sure where to look. It seems to me we only need to query this when we call the VM app or a user enters the VM system.Maybe the same code that calls the externnotify command (a custom post-exec script) could trigger the SIP notification beforehand. A nice event-based solution. :) Additionally it would have to be triggered whenever a user (/peer/phone, whatever) registers ... Did not really think it through. Regards, Philipp Kempgen -- amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de Let's use IT to solve problems and not to create new ones. Asterisk? -> http://www.das-asterisk-buch.de Gesch?ftsf?hrer: Stefan Wintermeyer Handelsregister: Neuwied B 14998
>> So I would like to change this, just not sure where to look. It >> seems to me we only need to query this when we call the VM app or >> a user enters the VM system. >> > Maybe the same code that calls the externnotify command (a custom > post-exec script) could trigger the SIP notification beforehand. A > nice event-based solution. :) > Additionally it would have to be triggered whenever a user > (/peer/phone, whatever) registers ... Did not really think it > through. > > Regards, > Philipp KempgenI was even thinking to just create a single SELECT COUNT(*) FROM voicemail with no parameters and store the value. This way if something changed, you could at least then update the voicemail and notify the users without a event triggering it. You could have this run ever minute or so (or less by configuration) but at least the SQL query would be singular and not for every WHERE clause available and improve the overall resources on the SQL and Asterisk boxes.