{
  "id": "grpc/max-concurrent-streams-server",
  "signature": "UNAVAILABLE: grpc: server rejected stream due to max concurrent streams limit (100)",
  "signature_zh": "不可用：gRPC 服务器因最大并发流限制（100）拒绝流",
  "regex": "UNAVAILABLE: grpc: server rejected stream due to max concurrent streams limit \\(\\d+\\)",
  "domain": "grpc",
  "category": "resource_error",
  "subcategory": null,
  "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器已达到配置的最大并发流数（例如 100），新流请求被拒绝，直到现有流完成。",
  "versions": [
    {
      "version": "gRPC v1.52.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC v1.60.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC v1.65.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Retries will still be rejected as long as the server is at capacity; it only adds latency without solving the bottleneck.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Keepalive pings do not affect stream limits; they only maintain connection health.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This setting controls the client's advertised limit, not the server's; the server independently enforces its own limit.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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)])`.",
      "success_rate": 0.9,
      "how": "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)])`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "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.",
      "success_rate": 0.85,
      "how": "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.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a load balancer (e.g., Envoy) to distribute streams across multiple server instances, effectively increasing the total stream capacity.",
      "success_rate": 0.8,
      "how": "Use a load balancer (e.g., Envoy) to distribute streams across multiple server instances, effectively increasing the total stream capacity.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "增加服务器最大并发流数：设置 `GRPC_ARG_HTTP2_MAX_STREAMS` 为更高值（如 500）。在 Python 中：`grpc.server(..., options=[('grpc.max_concurrent_streams', 500)])`。",
    "实现客户端连接池：创建多个 gRPC 通道（如 3-5 个），将流分布到不同通道，避免单个通道达到限制。",
    "使用负载均衡器（如 Envoy）将流分发到多个服务器实例，有效增加总流容量。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/performance/#server-streams",
  "official_doc_section": null,
  "error_code": "GRPC_MAX_CONCURRENT_STREAMS",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2024-06-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}