[asterisk-users] Asterisk Realtime pounds MySQL

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Fri Aug 22 19:41:49 CDT 2008


On Thursday 21 August 2008 10:08:53 J.M. wrote:
> I am running Asterisk 1.4.21.2 with Realtime.  I have a phone setup in the
> database and when I connect that phone to Asterisk there are suddenly an
> endless number of "SELECT * FROM sip WHERE name = '1001' AND host =
> 'dynamic'" queries being run.  The only way to stop the flood of queries
> coming from Asterisk to restart the Asterisk process.  Even disconnecting
> the phone doesn't stop Asterisk from running the queries.
>
> Has anyone seen this before?  Why would Asterisk do that and does anyone
> know the fix?

Asterisk does that because realtime data is not cached by default, so for each
access of the peer in question, Asterisk needs to reload the data on the peer
from the database.  If you'd like, turn on rtcachefriends in sip.conf, which
will cache the peer for the duration of the registration interval (or whatever
you have rtexpire set to).  Also, to get correct behavior on reload, you'll
need to have rtupdate turned on.  Some of the behavior isn't quite right in
1.4.21.2, even, but it should be fixed once 1.4.22 is released.

BTW, I would otherwise have responded sooner, but I am on vacation this week,
and I am not responding to email as quickly as I would usually.

-- 
Tilghman



More information about the asterisk-users mailing list