-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Performance tuning: scale_from_zero #1076
Comments
Hi @alexellis
Do you want, we only call GetReplicas once and only scaling one time (this log scale from 0 to 1, 5 times)? |
/lock: inactivity |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected Behaviour
When a function is not in the scaling cache and concurrent requests arrive, we should lock on a Mutex so that we don't make too many calls to the back-end to query the current amount of replicas
Current Behaviour
We could have a "thundering herd" situation where all 1000 +/- requests call to the back end until the cache is updated for subsequent calls.
Possible Solution
We could use a RWMutex in the scaler or in the cache for each unique function name rather than one for the whole cache.
https://github.com/openfaas/faas/blob/master/gateway/scaling/function_scaler.go#L42
https://github.com/openfaas/faas/blob/master/gateway/scaling/function_cache.go#L49
The text was updated successfully, but these errors were encountered: