The Rate Limiting Advanced plugin has been added and is working fine. After a period of time, when under a heavy load, errors start to occur that arithmetic is being performed on a nil value. For example;
2025/12/05 00:43:42 [error] 2694#0: *156152717 lua coroutine: runtime error: ...l/share/lua/5.1/kong/tools/public/rate-limiting/init.lua:309: attempt to perform arithmetic on local 'cur' (a nil value)
stack traceback:
coroutine 0:
...l/share/lua/5.1/kong/tools/public/rate-limiting/init.lua: in function 'increment'
.../lua/5.1/kong/plugins/rate-limiting-advanced/handler.lua:242: in function <.../lua/5.1/kong/plugins/rate-limiting-advanced/handler.lua:208>
coroutine 1:
[C]: in function 'resume'
coroutine.wrap:21: in function <coroutine.wrap:21>
/usr/local/share/lua/5.1/kong/init.lua:623: in function 'access'
access_by_lua(nginx-kong.conf:85):2: in function <access_by_lua(nginx-kong.conf:85):1>The plugin is using the config. strategy=cluster option.
This specific crash no longer reproduces as of Kong Gateway 3.14.0.0. Historically, the Rate Limiting Advanced plugin used a shared dictionary to store the counters for the rate limits, and if the shared dictionary was too small to hold all the counters, some counters would be evicted, leading to a nil value being returned for the counter and a runtime crash when the plugin tried to perform arithmetic on it.
This has since been fixed: dict:incr is now called with an init value and wrapped in an error-catch, so an under-sized shared dictionary now causes a silent, WARN-logged counter reset instead of a Lua runtime crash. The sizing guidance below remains useful as a best practice to avoid unnecessary counter resets, but is no longer required to prevent a crash.