{
  "id": "kafka/socket-server-max-too-low",
  "signature": "java.io.IOException: Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.",
  "signature_zh": "java.io.IOException: 无法建立与节点 -1 (localhost/127.0.0.1:9092) 的连接。代理可能不可用。",
  "regex": "java\\.io\\.IOException: Connection to node -1 \\(.*\\) could not be established\\. Broker may not be available\\.",
  "domain": "kafka",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The broker's socket server max connections limit is exhausted because too many concurrent connections from clients exceed the configured value of socket.server.max.connections.",
  "root_cause_type": "generic",
  "root_cause_zh": "代理的套接字服务器最大连接数限制已耗尽，因为来自客户端的并发连接数超过了配置的 socket.server.max.connections 值。",
  "versions": [
    {
      "version": "Kafka 3.4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kafka 3.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Restart the broker",
      "why_fails": "Restarting only temporarily resets connections; the underlying limit is unchanged and will be hit again quickly under high load.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase heap memory for the broker",
      "why_fails": "Socket server connections are not directly related to heap memory; the issue is a connection count limit, not memory pressure.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the socket.server.max.connections configuration in server.properties and restart the broker:\n\nsocket.server.max.connections=2000\n\nThen monitor connections using: netstat -an | grep :9092 | wc -l",
      "success_rate": 0.85,
      "how": "Increase the socket.server.max.connections configuration in server.properties and restart the broker:\n\nsocket.server.max.connections=2000\n\nThen monitor connections using: netstat -an | grep :9092 | wc -l",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce the number of concurrent connections from clients by implementing connection pooling or batching requests. For example, in a Java consumer, use a single shared KafkaConsumer instance instead of creating per-thread consumers.",
      "success_rate": 0.75,
      "how": "Reduce the number of concurrent connections from clients by implementing connection pooling or batching requests. For example, in a Java consumer, use a single shared KafkaConsumer instance instead of creating per-thread consumers.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase the socket.server.max.connections configuration in server.properties and restart the broker:\n\nsocket.server.max.connections=2000\n\nThen monitor connections using: netstat -an | grep :9092 | wc -l",
    "Reduce the number of concurrent connections from clients by implementing connection pooling or batching requests. For example, in a Java consumer, use a single shared KafkaConsumer instance instead of creating per-thread consumers."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#brokerconfigs_socket.server.max.connections",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-05-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}