Quick revision
The short answer
A single channel runs into the server's SETTINGS_MAX_CONCURRENT_STREAMS, often about 100 to 128 in proxies and servers, so extra calls queue on the client while the server sits at 30 percent CPU; one TCP connection is also limited by HTTP/2 flow control, because a 1 Gbit per second link with a 60 ms round trip needs about 7.5 MB in flight and the protocol's default window is 65,535 bytes. Raise the server's stream limit if it can cope, or spread calls over several channels or subchannels, check gRPC Java's flow control windows, and fix RESOURCE_EXHAUSTED, caused by the default 4 MB maximum inbound message size, by raising maxInboundMessageSize deliberately or, better, streaming large results as smaller messages.
What to remember
In this answer, we saw that one channel to one address means one HTTP/2 connection, limited by SETTINGS_MAX_CONCURRENT_STREAMS, so calls beyond about 100 queue on the client while the server idles, and by flow control windows, which must approach the 7.5 MB bandwidth-delay product of a 1 Gbit per second, 60 ms link. We raise the server's stream limit or spread calls over several channels, check gRPC Java's windows, fix RESOURCE_EXHAUSTED by raising maxInboundMessageSize deliberately or streaming smaller messages, and measure client queueing separately from server time.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
A single channel runs into the server's SETTINGS_MAX_CONCURRENT_STREAMS, often about 100 to 128 in proxies and servers, so extra calls queue on the client while the server sits at 30 percent CPU; one TCP connection is also limited by HTTP/2 flow control, because a 1 Gbit per second link with a 60 ms round trip needs about 7.5 MB in flight and the protocol's default window is 65,535 bytes. Raise the server's stream limit if it can cope, or spread calls over several channels or subchannels, check gRPC Java's flow control windows, and fix RESOURCE_EXHAUSTED, caused by the default 4 MB maximum inbound message size, by raising maxInboundMessageSize deliberately or, better, streaming large results as smaller messages.
Why this question is asked
When throughput stops growing while the server is mostly idle, the bottleneck is somewhere between the two, and with gRPC it is very often the single connection that one channel uses. Interviewers ask this to see whether we know the limits built into HTTP/2 and gRPC and how to tell transport limits from a slow service. In this answer, we will look at the stream limit, then at flow control and the bandwidth-delay product, change the client and server, deal with the message size error, and finally measure queueing separately from server time.
1A Quick Recap: What a Channel Really Is
In grpc-java, a ManagedChannel is a logical connection to a target. Underneath, it holds one HTTP/2 connection per backend address, called a subchannel, and with a single address or a single proxy in front, that means one TCP connection. Every call becomes an HTTP/2 stream on that connection. Multiplexing makes this efficient, but it also means that every limit of a single HTTP/2 connection applies to the whole batch job.
2Limit 1: Maximum Concurrent Streams
When an HTTP/2 connection opens, each side sends a SETTINGS frame, and one setting is SETTINGS_MAX_CONCURRENT_STREAMS: how many streams the peer may have open at once on this connection. Many servers and proxies set about 100 to 128; NGINX and some cloud load balancers use 128. The grpc-java client respects it: when 100 calls are in flight, call 101 waits in the client until one finishes.
That explains the plateau. If each call spends about 100 milliseconds in flight, a 60 ms round trip plus 40 ms of server work, then 100 concurrent streams give at most about 1,000 calls per second, no matter how many calls the batch job starts. Calls beyond that sit in the client's queue, so client latency rises, while the server sees a steady 100 calls in progress and uses 30 percent of its CPU.
- Batch job starts callthousands in parallel
- Fewer than 100 streams open?YesOpen a streamNoWait in client queue
- Flow control window has room?YesSend and receive dataNoWait for WINDOW_UPDATE
- Response under 4 MB?YesDeliver the messageNoFail: RESOURCE_EXHAUSTED
4 steps in order. Play them, or step through them one at a time.
Each decision is a limit of the single connection, not of the server's CPU.
3Limit 2: Flow Control and the Bandwidth-Delay Product
HTTP/2 also has flow control: a receiver grants the sender a window of bytes it may send, per stream and per connection, and enlarges it with WINDOW_UPDATE frames as it consumes data. The protocol's default initial window is 65,535 bytes. A sender can have at most one window of data in flight before it must wait for an update, which takes a round trip.
To fill a link, the window must be at least the bandwidth-delay product, the amount of data in flight during one round trip. For 1 Gbit per second, which is 125 MB per second, and a 60 ms round trip, that is 125 MB times 0.06, about 7.5 MB. A 64 KB window allows only about 1 MB per second, roughly 9 Mbit per second, on that link. gRPC Java uses a larger default window, about 1 MB, and can auto-tune it from measurements of the round trip, but whether tuning applies and how far windows grow depends on the version and on whether we set a fixed window, so check the settings. For 5 MB responses across 60 ms, windows decide a large part of the latency.
4Changing the Server and the Client
If the server can handle more concurrent calls, which 30 percent CPU suggests it can, raise its stream limit. In grpc-java that is maxConcurrentCallsPerConnection on the server builder; on a proxy in between, it is the proxy's own setting. Raise it with care: the limit also protects the server from a single client overwhelming it.
On the client, the more robust change is to use several connections. A simple pool of channels, with calls spread round robin across them, multiplies both the stream limit and the flow control capacity, and spreads the work over several TCP connections, so one lost packet does not stall every call. Where the target resolves to several backends, the round_robin policy already creates a subchannel per address.
Notice that separately built channels each open their own connection; that is the point here. Within one channel, gRPC reuses a connection per address, which is why a single channel to a single proxy address gives one connection.
5RESOURCE_EXHAUSTED on 5 MB Responses
The failures on large responses have a different cause. gRPC Java limits the size of a single inbound message, 4 MB by default, to protect the receiver's memory. A 5 MB response exceeds it, and the client fails the call with RESOURCE_EXHAUSTED. We can raise the limit with maxInboundMessageSize on the channel, for example to 16 MB, but we should do it deliberately, knowing the largest message we expect.
The better fix is usually to change the API: return large results as a server-streaming call that sends many messages of a few hundred kilobytes each. The client can process each piece as it arrives, memory stays bounded, flow control works smoothly, and no single message approaches the limit.
6Measure Queueing Separately From Server Time
The reason this problem was hard to spot is that the client measured only total call latency, which includes time waiting for a free stream. Record both: client-side attempt duration and server-side call duration, which grpc-java's OpenTelemetry metrics provide, or server processing time returned in a response header. When client latency grows while server time stays flat, the extra time is queueing in the transport, and the fix is in the connection, not in the service.
7Follow-up questions
Why are huge single messages a problem even with a raised limit?
A message must be fully received and held in memory before it is deserialized and delivered, so each in-flight 50 MB message costs at least 50 MB of memory on both sides, and much more during parsing. Many concurrent large calls can exhaust the heap. A large message also occupies the connection's flow control window and delays smaller calls behind it, the caller cannot start processing until the last byte arrives, and if the call fails near the end, the whole message must be sent again. Streaming smaller messages avoids all of these.
Would HTTP/3 solve this?
Not the stream limit or the message size; those are HTTP/2 and gRPC settings that exist in any transport. QUIC would reduce the effect of packet loss on many streams sharing a connection, but on a 60 ms data centre link the main fixes are still more connections, suitable windows and smaller messages.
8Conclusion
In this answer, we saw that one channel to one address means one HTTP/2 connection, limited by SETTINGS_MAX_CONCURRENT_STREAMS, so calls beyond about 100 queue on the client while the server idles, and by flow control windows, which must approach the 7.5 MB bandwidth-delay product of a 1 Gbit per second, 60 ms link. We raise the server's stream limit or spread calls over several channels, check gRPC Java's windows, fix RESOURCE_EXHAUSTED by raising maxInboundMessageSize deliberately or streaming smaller messages, and measure client queueing separately from server time.
Open with
A single ManagedChannel to one address is one HTTP/2 connection, and that connection has limits. The server advertises SETTINGS_MAX_CONCURRENT_STREAMS, often around 100 to 128, so once 100 calls are in flight the client queues the rest.
Then, if they want more
With about 100 milliseconds per call over a 60 ms link, that caps us near 1,000 calls per second, which is why throughput plateaus, client latency grows and the server sits at 30 percent.
The connection is also limited by HTTP/2 flow control: the protocol's default window is 65,535 bytes, but a 1 Gbit per second link with 60 ms round trip needs about 7.5 MB in flight. gRPC Java uses larger windows and can auto-tune them, so I would check what is actually configured.
To fix it, I would raise the server's stream limit if it has capacity, for example maxConcurrentCallsPerConnection, or more robustly spread calls over a small pool of channels or several subchannels, so we get several connections. The RESOURCE_EXHAUSTED errors are separate: gRPC Java's default maximum inbound message size is 4 MB and the responses are 5 MB.
I could raise maxInboundMessageSize deliberately, but I would rather stream large results as smaller messages. Finally, I would measure client-side queueing separately from server time, so a transport limit is not mistaken for a slow service.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "What limits the single channel, and what do you change?": https://scrivio-interview-library.netlify.app/architecture/load-balancing-networking/58a31ce838/