Enable backoff/retries on scaling up

- this change is needed for Docker Swarm which may give an error
when several concurrent requests come in to scale a deployment.

Tested on Docker Swarm before/after with the hey tool and figlet
scaled down to zero replicas.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (VMware)
2018-11-05 20:30:42 +00:00
committed by Alex Ellis
parent 446c8672ae
commit 117707df14
3 changed files with 51 additions and 6 deletions

View File

@ -137,7 +137,8 @@ func main() {
if config.ScaleFromZero {
scalingConfig := scaling.ScalingConfig{
MaxPollCount: uint(1000),
FunctionPollInterval: time.Millisecond * 10,
SetScaleRetries: uint(20),
FunctionPollInterval: time.Millisecond * 50,
CacheExpiry: time.Second * 5, // freshness of replica values before going stale
ServiceQuery: alertHandler,
}