faas/gateway/scaling/scaling_config.go
Alex Ellis (VMware) 117707df14 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>
2018-11-07 13:49:56 +00:00

26 lines
636 B
Go

package scaling
import (
"time"
)
// ScalingConfig for scaling behaviours
type ScalingConfig struct {
// MaxPollCount attempts to query a function before giving up
MaxPollCount uint
// FunctionPollInterval delay or interval between polling a function's
// readiness status
FunctionPollInterval time.Duration
// CacheExpiry life-time for a cache entry before considering invalid
CacheExpiry time.Duration
// ServiceQuery queries available/ready replicas for function
ServiceQuery ServiceQuery
// SetScaleRetries is the number of times to try scaling a function before
// giving up due to errors
SetScaleRetries uint
}