Overview

In this blog, I want to focus on the autoscaling strategy for a common scenario that's both common and critical in modern cloud computing: scaling queue workers based on message queues.z

While some strategies might appear effective at first glance, they may not deliver the expected results in practice. We'll dissect these common approaches, spotlighting their pitfalls, before introducing a more robust method: queue-based scaling.

This technique not only excels in efficiency but also ingeniously leverages the principles of a negative feedback control system. I’ll discuss its characteristics and demonstrate why it stands out as the superior choice for autoscaling queue workers.

Understanding Queue Workers

Queue workers, integral to active applications, pose distinct challenges for effective autoscaling.

<aside> 💡 Important: In this article we are only talking bout the case where lag is acceptable. If the goal is to process messages ASAP instead of maximize resource utilization. Over provision and starving of consumers are unavoidable.

</aside>

Traditional Autoscaling Strategies - An Overview

Strategy: CPU-Based Scaling

CPU-Based Scaling for active applications, watch the CPU usage of application.

metrics:
- type: Resource
  resource:
    name: cpu
    target:
      type: Utilization
      averageUtilization: 80

Key Characteristics

Conclusion

While CPU-Based Scaling offers a straightforward approach, it’s obvious a bad choice for dynamic, active applications with queue-based workloads because