[SR-Dev] [Kamailio-Devel] register_timer versus register_timer_process

Andrei Pelinescu-Onciul andrei at iptel.org
Tue Mar 10 14:45:38 CET 2009


On Mar 10, 2009 at 09:10, Ovidiu Sas <osas at voipembedded.com> wrote:
> The timer interval for the ratelimit is configurable (called every
> second in my case).
> I'm using it to control inbound/outbound cps over several SIP trunks.
> 
> Before having a separate timer for ratelimit, I wasn't able to
> properly control the cps due to timer jitter.
> If the slow timer doesn't introduce jitter, then I have no objections
> in using it.  But if the slow timer is exposed to jitter due to other
> timers that can block and introduce jitter, then the slow timer is not
> a viable option here.

I had a look at it and it qualifies for fast timer (it does very little
work in the handler).
Regarding jitter: why don't you compute the real timer_interval? This
way even if the handler would be called a little later you would still
get the real load. In sr you could always use get_ticks_raw() which is
very fast and also recovers after suspend/hibernate (so you'll always
have the correct ticks).
This would help even if you use a separate process.



Andrei



More information about the sr-dev mailing list