# 内部错误：客户端上针对服务器 localhost:8080 的最大并发流数已超出

- **ID:** `grpc/max-concurrent-streams-exceeded-client`
- **领域:** grpc
- **类别:** resource_error
- **错误码:** `ECONCSTRM`
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

客户端 gRPC 流多路复用超出了每个 HTTP/2 连接配置的最大并发流限制（默认 100）。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| gRPC v1.62.0 | active | — | — |
| gRPC v1.59.0 | active | — | — |
| gRPC v1.56.0 | active | — | — |
| Go gRPC v1.63.0 | active | — | — |

## 解决方案

1. ```
   通过通道配置增加客户端最大并发流数：Go 中使用 `grpc.ChannelConfig{MaxConcurrentStreams: 200}`，C++ 中使用 `withMaxConcurrentStreams(200)`。
   ```
2. ```
   创建多个 gRPC 通道以将流分布到多个连接上。每个通道都有自己的 HTTP/2 连接。
   ```

## 无效尝试

- **Increasing server-side max concurrent streams** — The error is client-side; server config doesn't affect client limits. (95% 失败率)
- **Restarting the client without code changes** — The limit is hit again under the same load pattern. (90% 失败率)
- **Disabling HTTP/2 flow control** — Flow control and stream limits are separate; disabling flow control doesn't increase stream count. (85% 失败率)
