# INTERNAL: grpc: stream creation failed due to max concurrent streams limit (128) on server

- **ID:** `grpc/stream-creation-failure-max-streams`
- **Domain:** grpc
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

The gRPC server reached its configured maximum number of concurrent streams (default 100 or 128), rejecting new stream creation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC C++ 1.63.0 | active | — | — |
| gRPC Java 1.61.0 | active | — | — |
| gRPC Python 1.64.0 | active | — | — |

## Workarounds

1. **Increase `GRPC_ARG_HTTP2_MAX_CONCURRENT_STREAMS` to a higher value (e.g., 256) on server: `server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_concurrent_streams', 256)])`** (80% success)
   ```
   Increase `GRPC_ARG_HTTP2_MAX_CONCURRENT_STREAMS` to a higher value (e.g., 256) on server: `server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_concurrent_streams', 256)])`
   ```
2. **Implement client-side connection pooling to reuse streams: `channel = grpc.insecure_channel('localhost:50051', options=[('grpc.use_local_subchannel_pool', 1)])`** (75% success)
   ```
   Implement client-side connection pooling to reuse streams: `channel = grpc.insecure_channel('localhost:50051', options=[('grpc.use_local_subchannel_pool', 1)])`
   ```

## Dead Ends

- **Increase max streams limit to an extremely high value like 10000** — May cause memory exhaustion and degrade performance; doesn't address inefficient stream usage. (60% fail)
- **Disable the stream limit entirely by setting to 0** — gRPC interprets 0 as unlimited, but may cause resource starvation and DoS vulnerability. (70% fail)
- **Restart server every time it hits limit** — Temporary fix; the issue recurs as traffic grows. (90% fail)
