[SR-Users] usrloc, timer process and cache cleanup

Ovidiu Sas osas at voipembedded.com
Thu Dec 22 19:40:00 CET 2011


The replace solution will mask the real issue.
The flag that is in the usrloc should switch between update or insert
and that is the real fix.

Regards,
Ovidiu Sas

-- VoIP Embedded, Inc.http://www.voipembedded.com

On Thu, Dec 22, 2011 at 12:58 PM, Daniel-Constantin Mierla
<miconda at gmail.com> wrote:
> Hello,
>
>
> On 12/22/11 6:19 PM, Andreas Granig wrote:
>
> Got the cause of the issue.
>
> What happens is that there's an AOR which registers ever 120 seconds.
> For some reason, the location entry is in usrloc cache, but not in db.
> What happens now is that usrloc tries an "update" query in the db,
> because it still assumes that the entry is there, which obviously fails.
>
> If you remove the entry from usrloc (kamctl ul rm <aor>), then on the
> next re-registration it's both inserted into the cache and into the db.
>
> Wondering how it could happen to get out of sync, and how we could
> improve this. Maybe using a "replace into" instead of "update", at least
> for mysql? Suggestions?
>
> is the timer interval parameter of usrloc higher than 120sec?
>
> http://kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2494575
>
> IIRC, there should be anyhow a flag to mark if the record is in db or not,
> and based on that do insert or update, maybe something is lost there. If you
> do 'kamctl ul show __aor__', what are the values for flags fields?
>
> Another option, perhaps more portable, but with two db hits is: update and
> if fails then insert -- considering that these should be corner cases, maybe
> the performance is not affected much. A blended version is even better, if
> the db driver supports replace, do replace instead of update (I don't know
> if replace is faster/slower than update).
>
> Cheers,
> Daniel
>
>
> Andreas
>
> On 12/22/2011 05:12 PM, Andreas Granig wrote:
>
> Hi,
>
> Could you please tell me which of the three timer processes ("timer",
> "slow timer" or "timer nh") is responsible for cleaning up the internal
> usrloc cache?
>
> Looks like every now and then the cleanup of the internal location cache
> is starting to fail. Funny thing is that expired locations are removed
> from the mysql backend, but not from the internal cache. We're running
> kamailio 3.1.5, are there any known issues fixed since that version?
>
> In the meanwhile we're trying to pin the issue down, but maybe someone
> has a clue...
>
> Andreas



More information about the sr-users mailing list