[OpenSIPS-Devel] [OpenSIPS/opensips] 037886: [ratelimit] Fix accuracy on the ratelimit timer

Bogdan Andrei IANCU noreply at github.com
Tue Jul 4 12:56:42 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 03788691a145bd1597ab6c5ec43544718143aad3
      https://github.com/OpenSIPS/opensips/commit/03788691a145bd1597ab6c5ec43544718143aad3
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2023-07-04 (Tue, 04 Jul 2023)

  Changed paths:
    M modules/ratelimit/ratelimit.c
    M modules/ratelimit/ratelimit.h
    M modules/ratelimit/ratelimit_helper.c

  Log Message:
  -----------
  [ratelimit] Fix accuracy on the ratelimit timer

The computation perform by the ratelimit module is very time sensitive - any deviation of the interval between the runs of the timer handler may lead to false positive detection of CPS thresholds.
So, let's move the timer handler from regular timer (1s sensitivity) to utimer (100ms sensitivity) -> 10 times more accurate.
Still, the number of triggerings is the same, only the precision is 10 times better.
Credits go to @ovidiusas
Closes #2797





More information about the Devel mailing list