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

Send metrics to scaler to avoid latency in cold start #219

Closed
benjaminhuo opened this issue Aug 7, 2021 · 3 comments
Closed

Send metrics to scaler to avoid latency in cold start #219

benjaminhuo opened this issue Aug 7, 2021 · 3 comments

Comments

@benjaminhuo
Copy link

benjaminhuo commented Aug 7, 2021

I can see from the code that the scaler will pull the metrics every 500 ms to determine whether to scale.

https://github.com/kedacore/http-add-on/blob/main/scaler/queue_pinger.go#L49
https://github.com/kedacore/http-add-on/blob/main/scaler/main.go#L40
It’s hardcoded in the http-add-on’s source code to 500ms

This could introduce inevitable latency when scaling up from 0

what I can see from knative's design doc is like below:

Unlike the queue-proxy, the activator actively sends metrics to the autoscaler via a websocket connection to minimize scale-from-zero latencies as much as possible.

It'll greatly reduce the latency of cold start if keda HTTP addon could introduce something similar to this mechanism.

https://github.com/knative/serving/blob/main/docs/scaling/SYSTEM.md

@arschles
Copy link
Collaborator

@benjaminhuo is the push interface described in #97 suitable to achieve this?

@benjaminhuo
Copy link
Author

@arschles Yeah, exactly. I can see the external push interface is marked as unimplemented in keda-http-addon.
It'll be great to have this added!

@arschles
Copy link
Collaborator

wonderful. stay tuned on #97. we'll likely start working on it shortly after the big #206 is merged and released

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

No branches or pull requests

2 participants