[Rspamd-Users] Custom ratelimit: leaking too fast

Thomas Klaube thomas at klaube.net
Wed Jul 3 13:43:31 UTC 2024


Hi there,

I have a custom ratelimit with a burst of 1000 and a leak of 0.035 (~2 per Minute
or ~3000 per day) which is returning the correct ratelimit string.
However, the bucket seemed to be leaking too fast, so I enabled debug logging
for ratelimits (sorry for the long lines):

2024-07-03 15:11:30 #134152(normal) <a16798>; ratelimit; ratelimit.lua:489: got reply for limit rs_customrl_user at example.org (1000 / 0.035); 13.693034775 burst, 3.3898:10.1221 dyn, 0.022779456 leaked
2024-07-03 15:11:30 #134152(normal) <d2b9c0>; ratelimit; ratelimit.lua:489: got reply for limit rs_customrl_user at example.org (1000 / 0.035); 14.670627313 burst, 3.4236:10.1221 dyn, 0.022407462 leaked
2024-07-03 15:11:30 #134152(normal) <cf8555>; ratelimit; ratelimit.lua:489: got reply for limit rs_customrl_user at example.org (1000 / 0.035); 15.647632943 burst, 3.4578:10.1221 dyn, 0.02299437 leaked
2024-07-03 15:12:27 #134152(normal) <ad7629>; ratelimit; ratelimit.lua:489: got reply for limit rs_customrl_user at example.org (1000 / 0.035); 9.70665177 burst, 3.4923:10.1221 dyn, 6.940981173 leaked

In the last line it is stated, that 6.94 items were leaked in 57 seconds (calculated
from the timestamp of the last 2 lines). But my calculation says:

57 * 0.035 = 1.995 

I can't find a good explanation for this behavior and I have the feeling, that
I am missing something... 

Thanx and regards
Thomas


More information about the Users mailing list