# INTERNAL: grpc: max concurrent streams exceeded on server: 128 active streams, limit 100

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

## Root Cause

The gRPC server has reached its configured maximum number of concurrent streams (default 100 in many implementations) and rejected new stream creation due to resource exhaustion.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC-go v1.58.0 | active | — | — |
| gRPC-java v1.57.0 | active | — | — |
| C-core v1.58.0 | active | — | — |

## Workarounds

1. **Increase the max concurrent streams limit in server configuration. In Go: server := grpc.NewServer(grpc.MaxConcurrentStreams(200)). In Java: NettyServerBuilder.forPort(port).maxConcurrentCallsPerConnection(200).** (85% success)
   ```
   Increase the max concurrent streams limit in server configuration. In Go: server := grpc.NewServer(grpc.MaxConcurrentStreams(200)). In Java: NettyServerBuilder.forPort(port).maxConcurrentCallsPerConnection(200).
   ```
2. **Enable client-side connection multiplexing by setting grpc.initial_conn_window_size to a higher value (e.g., 1MB) and use a load balancer to distribute streams across multiple server connections.** (80% success)
   ```
   Enable client-side connection multiplexing by setting grpc.initial_conn_window_size to a higher value (e.g., 1MB) and use a load balancer to distribute streams across multiple server connections.
   ```
3. **Implement stream pooling or batching on the client: instead of opening one stream per request, use client-side streaming to send multiple messages over a single stream, reducing the total stream count.** (75% success)
   ```
   Implement stream pooling or batching on the client: instead of opening one stream per request, use client-side streaming to send multiple messages over a single stream, reducing the total stream count.
   ```

## Dead Ends

- **** — Simply increasing the limit without addressing slow consumers or long-lived streams can lead to memory exhaustion and OOM kills. (80% fail)
- **** — Adding more server instances without adjusting client connection pooling may cause clients to still hit per-connection limits on each instance. (75% fail)
