Skip to content

Add KEDA-driven HPA on core-worker (Asynq queue depth) #81

@tayebmokni

Description

@tayebmokni

Summary

Configure KEDA-driven HorizontalPodAutoscaler for core-worker targeting Asynq queue depth as the external metric, instead of CPU. Workers should scale on asynq_queue_depth{queue="default"} (target 50/pod) and {queue="media"} (target 20/pod) — pure CPU autoscaling produces bad behavior for throughput-shaped workloads.

Design reference

  • docs/09-deployment-ops.md §4.6 (core-worker HPA on queue depth)
  • docs/12-jobs-cron.md §11.3 (queue depth metrics)

Acceptance criteria

  • KEDA ScaledObject (or HPA via metrics adapter) targeting core-worker Deployment
  • Triggers: gonext_asynq_queue_depth{queue="default"} target 50, {queue="media"} target 20
  • minReplicaCount: 3, maxReplicaCount: 15
  • terminationGracePeriodSeconds: 300 on worker pods preserved
  • No readinessProbe on workers (no Service); livenessProbe only
  • Verified scale-out when a queue is artificially backed up
  • Documented in values.yaml

Dependencies

#66, #82 (metrics exporter)

Complexity

M

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions