If you are encountering issues with log alerts along the lines of “too many pending timers” or “too many running timers”, we will want to identify the cause of this large use of timers as the default values should be sufficient in most cases. One of the plugins that can use a lot of timers is the Rate Limiting Advanced plugin. This is especially true when there are a large number of plugin instances and they span a number of different workspaces. Timers are essentially ‘connections’ in nginx terms, and therefore using too many timers can reduce Kong’s proxy performance and cause other unintended behavior around vitals, configuration propagation etc.
The namespace parameter of the Rate Limiting Advanced plugin is auto generated by default. Counter data and sync configuration are shared in a namespace, each namespace will loosely equate to one timer instance. Therefore if we allow these to be auto generated we will end up with a large number of namespaces and timers.