I am trying to implement the RateLimit plugin, lik...
# ktor
a
I am trying to implement the RateLimit plugin, like this:
Copy code
register(rateLimitGeneralId) {
                    rateLimiter(limit = 1000, refillPeriod = 60.seconds)
                    requestKey { call -> call.userIdFromJwt() }
                    requestWeight { _, key -> if (key == PARTNER_NOT_FOUND) 0 else 1 }
                }
But when I enable it response times skyrockets. It seems like it is using a lot more memory when it is enabled, but it is hard to diagnose as it is really only an issue in production. Anyone experienced something similar? Any pointers as what to look into? I have double checked that we are not getting a lot of weird keys. I am pretty sure we will have 20-30 keys at any time. 🙂
a
Can you please file an issue with the attached steps to reproduce the problem?