Skip to content

Balancerd Size Recommendations and Horizontal Pod Autoscaling #92

@jubrad

Description

@jubrad

Problem

Balancerd defaults are undersized for production workloads and cannot scale to handle traffic spikes.

Solution

  1. Provide recommendation in sample config to set balancerd to 2 cores of CPU and 2Gi memory for production workloads.
  2. Provide ability for balancerd to scale automatically using horizontal pod autoscaler.
# Example Balancerd HPA config
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: balancer
  namespace: mz-balancer
spec:
  behavior:
    scaleDown:
      policies:
      - periodSeconds: 15
        type: Percent
        value: 100
      selectPolicy: Max
      stabilizationWindowSeconds: 1800
    scaleUp:
      policies:
      - periodSeconds: 15
        type: Pods
        value: 4
      - periodSeconds: 15
        type: Percent
        value: 100
      selectPolicy: Max
      stabilizationWindowSeconds: 180
  maxReplicas: 10
  metrics:
  - resource:
      name: memory
      target:
        averageUtilization: 50
        type: Utilization
    type: Resource
  - resource:
      name: cpu
      target:
        averageUtilization: 50
        type: Utilization
    type: Resource
  minReplicas: 1
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: balancer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions