Skip to content
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

Increase scaler stream interval to 200ms #745

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

tommy351
Copy link
Contributor

Currently the scaler uses a lot of memory when there're a lot of HTTPScaledObjects (We have 300+). Based on the heap snapshots, it seems that the StreamIsActive handler consumes most of memory. I adjusted the interval from 5ms to 200ms to fix this issue.

Part of heap graph, you can open heap snapshot files below for details.

截圖 2023-07-31 16 01 35

Heap snapshots:

Memory usage:

Before:

截圖 2023-07-31 15 28 09拷貝

After:

截圖 2023-07-31 15 34 16

Checklist

@tommy351 tommy351 requested a review from a team as a code owner July 31, 2023 08:11
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice improvement! The resources saving is awesome, but I'm afraid about if this can impact in current applications, I don't think so because 5 checks per second sounds enough, but IDK if it makes sense adding a parameter for setting this value from users side (with a default value).
WDYT? @t0rr3sp3dr0 @tomkerkhove

@t0rr3sp3dr0
Copy link
Contributor

I like the idea of making this configurable and also think that 200ms is a good default value for it.

@JorTurFer
Copy link
Member

@tommy351 , could you add a parameter for that value (and document it) ? 🙏

@JorTurFer
Copy link
Member

Hi @tommy351
We will cut a release probably this month (we are coming back from the summer break and we are still a bit slow). Do you have any update about this?

@JorTurFer
Copy link
Member

Hello @tommy351
Any update? We plan a release soon and this'd be a nice improvement

@tommy351
Copy link
Contributor Author

Hi @JorTurFer, is the parameter you mentioned application-wide or just for a single ScaledObject?

@JorTurFer
Copy link
Member

JorTurFer commented Sep 28, 2023

I think that we can start with a global parameter because the improvement will be huge. If someone has a use case where it's required at HTTPScaledObject, we can just iterate.
From changes pov, a simple parameter within scaler startup is quite easier than adding it via CRD

@JorTurFer JorTurFer merged commit 8ea0896 into kedacore:main Oct 4, 2023
18 checks passed
@JorTurFer
Copy link
Member

I add the config value in another PR because we want to cut a release tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants