# A downstream service slows from 100ms to 2 seconds

Canonical URL: <https://datadriven.io/problems/a-downstream-service-slows-from-100ms-to-2-seconds-the-pipe-649caeb6>

Domain: Pipeline Design · Difficulty: medium

## Problem

A downstream service slows from 100ms to 2 seconds. The pipeline's worker queue (currently unbounded) accepts every put() instantly. Memory grows without limit. The producer crashes when memory exhausts; the producer's upstream begins to fill its own queue, and the failure cascades backward. The section's mitigation: every queue between two components has a maximum size, and when full the producer blocks (backpressure). Load-shedding is a complement when blocking is unacceptable. Apply backpressure by renaming the unbounded queue to one with maxsize and blocking semantics, and add a load-shedding policy on the source side.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/a-downstream-service-slows-from-100ms-to-2-seconds-the-pipe-649caeb6)
- [System Design Interview Questions](https://datadriven.io/data-engineering-system-design)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.