-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Should scalers reuse opened connection/clients? #1121
Comments
@arschles yeah, that's definititely a step forward 👍 |
Sorry for not replying to this earlier @zroubalik, I know I promised I'll but wanted to take a look at all the scalers, and how they implement connections to get a better feel for what would be the best option here. The following scalers are the ones that create a client/connection on
All other scalers don't use connections, or use HTTP style clients that don't need to open/close connections. Initially I thought a The reason to recreate the scalers on every We have had few memory leaks (1, 2, 3) when those scalers are not closed, there is one code path now actually also missing to close those scalers (#1608), so I'd also like to improve that to make sure the interface of It'd be a slightly large change, but I'll work on it |
@ahmelsayed, you can also add 1543642 to your memory leaks list |
@ahmelsayed is working on this one and will aim for v2.5 🎉 |
Closes #1121 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Closes #1121 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Closes #1121 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Closes #1121 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Closes #1121 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Closes #1121 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Closes #1121 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
* Add ScalersCache to reuse scales unless they need changing Closes #1121 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Signed-off-by: qvalentin <valentin.theodor@web.de>
I have been thinking about this for some time. Currently we are creating a new Scaler (and creating a client and opening a connection) in every cycle after in the Scale Loop (after
pollingInterval
has passed) and we are doing the same in the Metrics Server when HPA is requesting the metrics.This has some benefits, eg. if the
pollingInterval
is long, we don't need to keep the opened conection, use the memory resources etc. And if I am not mistaken, then ENV variables on the Target Deployment are evaluated in each cycle.On the other hand, if the
pollingInterval
is not that long, we keep opening and closing the clients very often. This is not ideal from the performance perspective and we can as well flood the Event Source (eg. Kafka Broker) with many opened and closed connections.What if we try to create the Scaler just once, and keep the reference on the Scaler (and if there is an error while accessing this scaler, we can recreate again). We should do it on both sides (in the Operator's Scale Loop and in the Metrics server).
Are there any downsides or problems? Or any other ideas?
The text was updated successfully, but these errors were encountered: