Skip to main content

Back Pressure

  1. Back pressure is a mechanism used in message queues, task queues, and network systems to prevent overloading a system when it cannot process incoming requests fast enough. It helps maintain system stability by slowing down producers or rejecting new tasks when consumers (workers) are overwhelmed.

Why Occurs​

  1. Producer sends tasks/messages faster than consumer can process.
  2. Workers are slow due to hight CPU/memory usage
  3. Queue storage is full

Techniques to handle back pressure​

TechniqueHow It WorksUse Case
ThrottlingLimit request ratePrevent API abuse, control traffic
Load SheddingDrop low-priority tasksLogging, analytics, monitoring
Auto ScalingAdd more workers when neededCloud-based systems, Kubernetes
Queue AcknowledgmentProcess tasks only when readyRabbitMQ, Kafka, Redis Streams
Circuit BreakerStop requests to overloaded servicesMicroservices, APIs