{
  "schema_version": "1.0",
  "id": "T-30315af5c3a8",
  "url": "https://gpuatlas.top/articles/T-30315af5c3a8/",
  "title": "API 请求排队很久，应该加显卡还是调并发？",
  "summary": "API排队先看活动执行和饱和位置，再决定调并发、减少无关工作或按副本及切分方式扩容。",
  "language": "zh-Hans",
  "category": {
    "id": "c-07",
    "name": "服务性能与成本",
    "url": "https://gpuatlas.top/categories/c-07/"
  },
  "topics": [],
  "body_text": "API排队很久，先把等待队列、输入处理和生成时间分开。客户端总等待长，不证明必须加卡，也不能仅靠提高并发解决，先看活动请求和设备实际状态。\n\n设备有余量、活动上限偏低时，可逐档提高并发，用原长短比例验证缓存与峰值。权重能加载不表示状态无限增加，显存尚有空间也可能计算已经超出响应目标。\n\n设备持续饱和时，更多活动请求可能让每个人更慢。先检查不必要历史、输出、模型与调度，保持任务质量，再比较扩容；队列更长只允许更多等待，不创造完成能力。\n\n测试固定到达负载，分列排队、首字、完整延迟、有效完成与失败。客户端一个完成才发下一个，可能掩盖真实突发，缓存命中也应明确，不能只用最佳短句结果判断。\n\n扩容前先确认模型能否在单卡承载日常状态：能承载就有条件比较独立副本分流，不能承载才考虑受支持切分。用原来的到达负载检查排队是否缩短、完整响应是否达标，并核算增加的成本。加卡后的路由或通信也要一起验证，不能把队列变短的最好轮次当成稳定服务能力。",
  "published_at": null,
  "modified_at": "2026-11-26T15:17:38.690397+00:00",
  "evidence": {
    "type": "documentation_and_conditional_estimates",
    "hardware_tested": false,
    "note": "资料解释与条件估算，非硬件实测。"
  },
  "sources": [
    {
      "id": "vllm-memory",
      "url": "https://raw.githubusercontent.com/vllm-project/vllm/main/docs/configuration/conserving_memory.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "id": "llamacpp-server",
      "url": "https://raw.githubusercontent.com/ggml-org/llama.cpp/master/tools/server/README.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    },
    {
      "id": "vllm-troubleshooting",
      "url": "https://raw.githubusercontent.com/vllm-project/vllm/main/docs/usage/troubleshooting.md",
      "retrieved_at": "2026-11-25T09:52:45.997121+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-30315af5c3a8/",
    "json": "https://gpuatlas.top/data/articles/T-30315af5c3a8.json",
    "markdown": "https://gpuatlas.top/data/articles/T-30315af5c3a8.md"
  }
}
