# UNAVAILABLE: grpc: server rejected stream due to max concurrent streams limit (100)

- **ID:** `grpc/max-concurrent-streams-server`
- **Domain:** grpc
- **Category:** resource_error
- **Error Code:** `GRPC_MAX_CONCURRENT_STREAMS`
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

Server has reached its configured maximum number of concurrent streams (e.g., 100), and new stream requests are rejected until existing streams complete.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC v1.52.x | active | — | — |
| gRPC v1.60.x | active | — | — |
| gRPC v1.65.x | active | — | — |

## Workarounds

1. **Increase the server's max concurrent streams: set `GRPC_ARG_HTTP2_MAX_STREAMS` to a higher value (e.g., 500) in the server builder. In C++: `channel_args->SetInt(GRPC_ARG_HTTP2_MAX_STREAMS, 500);` In Python: `grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_concurrent_streams', 500)])`.** (90% success)
   ```
   Increase the server's max concurrent streams: set `GRPC_ARG_HTTP2_MAX_STREAMS` to a higher value (e.g., 500) in the server builder. In C++: `channel_args->SetInt(GRPC_ARG_HTTP2_MAX_STREAMS, 500);` In Python: `grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_concurrent_streams', 500)])`.
   ```
2. **Implement a client-side connection pool: create multiple gRPC channels (e.g., 3-5) and distribute streams across them to avoid hitting the limit on a single channel.** (85% success)
   ```
   Implement a client-side connection pool: create multiple gRPC channels (e.g., 3-5) and distribute streams across them to avoid hitting the limit on a single channel.
   ```
3. **Use a load balancer (e.g., Envoy) to distribute streams across multiple server instances, effectively increasing the total stream capacity.** (80% success)
   ```
   Use a load balancer (e.g., Envoy) to distribute streams across multiple server instances, effectively increasing the total stream capacity.
   ```

## Dead Ends

- **** — Retries will still be rejected as long as the server is at capacity; it only adds latency without solving the bottleneck. (75% fail)
- **** — Keepalive pings do not affect stream limits; they only maintain connection health. (60% fail)
- **** — This setting controls the client's advertised limit, not the server's; the server independently enforces its own limit. (70% fail)
