-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak when RateLimitOverride is set with uniq ip on every call to ShouldRateLimit method #275
Comments
At one point we did not collect stats on a per key basis for this very reason. Has this regressed? Or do you have per-key/detailed stats enabled? |
It looks like regression. There is no settings (settings.go) like |
issue has been introduced here in #158 GetLimits --> NewRateLimit --> newRateLimitStats |
I'm new to GO so probably not the best candidate |
In our service we use
envoyproxy/ratelimit
as sidecar and are making grpc calls toShouldRateLimit
method explicitly without envoy proxy.Simplified config looks like
In our request we specify
Limit
(limit override) - https://github.com/envoyproxy/java-control-plane/blob/main/api/src/main/proto/envoy/extensions/common/ratelimit/v3/ratelimit.proto#L93 on every request which lead to this codepath getting executed - https://github.com/envoyproxy/ratelimit/blob/main/src/config/config_impl.go#L252-L261In that if statement when unique IP is getting used on every request we are getting unique
rateLimitKey
and also as a result are getting new set of stats Countersthis.statsManager.NewStats(rateLimitKey),
. So number of stats Counters and keys always grows over time.USE_STATSD
is set tofalse
.UPDATE:
our simplified ratelimit request to looks like this:
^ note 2 things
limit
defined in each request and is different based on customer. In this case customer iscustomer1234
<customer_identifier>_<ip>
Because
limit
is defined this code path is getting executedhttps://github.com/envoyproxy/ratelimit/blob/main/src/config/config_impl.go#L252-L261
which executes
this.statsManager.NewStats(rateLimitKey)
which will build whole bunch of new stats counters based onkey
(customer1234_1.2.3.4
)The text was updated successfully, but these errors were encountered: