﻿# Ray Serve max_queued_requests: each caller has its own queue limit

Understand why Ray Serve max_queued_requests limits each proxy or DeploymentHandle queue rather than imposing a single application-wide waiting-request cap.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-ray-serve-max-queued-per-caller-not-global-cap/
Language: en

## A supposedly bounded backlog grows with callers

A deployment has a configured queue limit and appears well controlled in a test using a single handle. Production introduces several orchestration callers and additional proxies. The total waiting population can now exceed what the operator expected from reading that individual limit as an application-wide cap.

Count the queues represented by the actual request topology. The question is not whether the option works, but which caller owns each waiting queue and how those queues contribute to the overall service backlog.

## The documented scope is each caller

The [configuration guide](https://docs.ray.io/en/latest/serve/configure-serve-deployment.html) defines max_queued_requests for each caller, including proxies and DeploymentHandle instances. It distinguishes that limit from the ongoing-request allowance assigned to deployment replicas.

An application-level queue budget requires reasoning about both layers and the number of callers. Do not treat a local queue setting as proof that the whole application retains at most that many waiting payloads under every deployment topology.

## Full queues trigger explicit backpressure

The [production guide](https://docs.ray.io/en/latest/serve/production-guide/best-practices.html) documents BackPressureError for handle calls when their queue limit is reached and HTTP rejection behavior at the proxy. This is a deliberate load-shedding boundary rather than a successful model response.

Decide how the caller observes and handles that outcome. An unbounded retry loop can reintroduce pressure elsewhere even though an individual Serve queue remains bounded. A retry policy should reflect the application operation and the actual rejection contract.

## Handles are part of the topology

The [handle API](https://docs.ray.io/en/latest/serve/api/doc/ray.serve.handle.DeploymentHandle.html) describes issuing calls to deployments. Inventory the calling components and the proxies used by real traffic, rather than inferring total backlog from a single local test fixture.

[Host memory pressure](/journal/cgroup-v2-memory-high-events/) helps investigate payload retention outside model tensors. [Terminal request consistency](/journal/provider-terminal-request-record-consistency/) supplies another useful distinction: rejection, retry and eventual success are different events that should not be collapsed into one accepted-request count.

## Test multiple callers and record rejection

Generate a controlled burst through several independent callers, observe where requests wait and verify how backpressure propagates. Record successful results and deliberate rejections alongside latency instead of reporting only the requests that eventually completed.

Revisit the evidence when changing proxy or orchestration topology. A valid per-caller limit remains useful, but its global effect depends on how many queues exist and how upstream components respond when those queues fill.
