[Serdev] [Tracker] Updated: (SER-245) Improved efficiency of usrloc's expiration algorithm
Jan Janak (JIRA)
tracker at iptel.org
Thu Jun 26 00:19:21 CEST 2008
[ http://tracker.iptel.org/browse/SER-245?page=all ]
Jan Janak updated SER-245:
--------------------------
Fix Version/s: (was: Wishlist)
> Improved efficiency of usrloc's expiration algorithm
> ----------------------------------------------------
>
> Key: SER-245
> URL: http://tracker.iptel.org/browse/SER-245
> Project: SER
> Issue Type: Improvement
> Components: Registrar
> Affects Versions: Ipteldorf
> Reporter: Jan Andres
> Priority: Minor
> Fix For: Ipteldorf
>
> Attachments: signature.asc, sip_router-cvs-20070704-ul_heap.diff, sip_router-cvs-20080204-ul_heap.diff, usrloc_heap.diff
>
>
> This patch replaces the algorithm for the removal of expired usrloc entries. It avoids the need to traverse all registered contacts each time the expiration procedure is run. The procedure can then be run much more frequently (like once per second or even more frequently if desired) which will make the overall operation "smoother" and avoid sending out large bursts of database updates, presence notifications, etc. on each expiration run. This also avoids keeping the udomain locked for extended amounts of time.
> The patch works by organizing the individual ucontacts in a binary heap ordered by the contact's expiration time. The expiration procedure can then simply remove elements from the heap until no more expired ones are left.
> The overhead of maintaining the heap was a concern at first, but a quick peek at the profiler and some performance tests show that the impact is really negligible, if visible at all.
> Note that this change doesn't help much if db_mode is 2 (WRITE_BACK) since then the timer still has to traverse all contacts to look for "dirty" entries. A possible fix would be to keep the dirty elements in a linked list. Some other cleanups could be applied (e.g. eliminate the linked list of all contacts, as they are all stored in the heap anyway), but I haven't done them yet.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tracker.iptel.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the Serdev
mailing list