[Asterisk-Users] realtime excessive database queries

snacktime snacktime at gmail.com
Sun May 22 01:50:51 MST 2005


Does asterisk really need to be doing 3 database calls for every
priority in every extension?

Why not just load all the extensions into memory, and then have a
mechanism to mark an extension as stale and only then reload from the
database?  Seems that with a basic caching mechanism you get all the
benefits of realtime without the downside of taking a performance hit
like it does now when having to go to the database so much.

If I'm reading the code right the extensions are all in a linked list.
 So it seems you could just add another item to the list to hold the
state of the extension, and when accessing the first item in the list
check the state.  If it's stale and realtime is in use, update the
extension from the database and restart at the top of the list.

Chris



More information about the asterisk-users mailing list