Is there a way to speed up the horizontal pod autoscaler metrics scan? Now it takes two minutes to upscale new pods

6/11/2018

I have an application with some endpoints that are quite CPU intensive. Because of that I have configured a Horizontal Pod Autoscaler like this:

spec:
  maxReplicas: 10
  minReplicas: 1
  scaleTargetRef:
    apiVersion: extensions/v1beta1
    kind: DeploymentConfig
    name: some-app
  targetCPUUtilizationPercentage: 30

The point is, supposing there's a request on a pod that keeps it working at 100% CPU for 5 mins. I takes two minutes until Openshift/Kubernetes schedules new pods.

Is there a way to speed up this process? It forces us to be almost unresponsive for two minutes.

The same thing happens to downscale, having to wait for two minutes until it destroys the unnecessary pods.

Ideally there should be some config option to set this up.

-- codependent
horizontal-scaling
kubernetes
openshift
openshift-origin

1 Answer

6/12/2018

For OpenShift, Please modify /etc/origin/master/master-config.yaml

kubernetesMasterConfig:
  controllerArguments:
    horizontal-pod-autoscaler-downscale-delay: 2m0s
    horizontal-pod-autoscaler-upscale-delay: 2m0s

and restart openshift master.

-- ccshih
Source: StackOverflow