{
  "id": "cloud/azure-app-service-connection-limit-exceeded",
  "signature": "System.Net.Http.HttpRequestException: The connection limit for the host was exceeded",
  "signature_zh": "System.Net.Http.HttpRequestException：主机的连接数限制已超出",
  "regex": "connection limit for the host was exceeded",
  "domain": "cloud",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Azure App Service plan has a default connection limit (e.g., 300 per instance) that is exhausted due to insufficient scaling or long-lived connections.",
  "root_cause_type": "generic",
  "root_cause_zh": "Azure应用服务计划有默认连接限制（如每个实例300个），因扩展不足或长连接耗尽。",
  "versions": [
    {
      "version": "Azure App Service Windows 2022",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": ".NET 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This only affects outgoing HTTP connections; the error is about incoming connections to the App Service, not outbound.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Restart resets connections temporarily but does not address the root cause; connections quickly rebuild and exceed the limit again.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling keep-alive may increase connection churn and worsen the issue, as each request opens a new connection.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Scale out the App Service plan to more instances (e.g., increase instance count from 1 to 3) to distribute connections",
      "success_rate": 0.85,
      "how": "Scale out the App Service plan to more instances (e.g., increase instance count from 1 to 3) to distribute connections",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable Always On in App Service settings to prevent idle connection drops and reduce churn",
      "success_rate": 0.8,
      "how": "Enable Always On in App Service settings to prevent idle connection drops and reduce churn",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set `ServicePointManager.DefaultConnectionLimit = int.MaxValue` in Global.asax.cs to increase outbound connection limit (if error is outbound)",
      "success_rate": 0.75,
      "how": "Set `ServicePointManager.DefaultConnectionLimit = int.MaxValue` in Global.asax.cs to increase outbound connection limit (if error is outbound)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Scale out the App Service plan to more instances (e.g., increase instance count from 1 to 3) to distribute connections",
    "Enable Always On in App Service settings to prevent idle connection drops and reduce churn",
    "Set `ServicePointManager.DefaultConnectionLimit = int.MaxValue` in Global.asax.cs to increase outbound connection limit (if error is outbound)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs#connection-limits",
  "official_doc_section": null,
  "error_code": "HTTP 503",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2024-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}