{
  "schema_version": "1.0",
  "id": "T-46926f219a4a",
  "url": "https://gpuatlas.top/articles/T-46926f219a4a/",
  "title": "vLLM 的 max-model-len 和并发数，为什么不能同时拉满？",
  "summary": "vLLM长度与并发共享缓存及计算，应测试联合范围，单项最大值不能直接同时使用。",
  "language": "zh-Hans",
  "category": {
    "id": "c-09",
    "name": "框架配置与故障",
    "url": "https://gpuatlas.top/categories/c-09/"
  },
  "topics": [
    {
      "id": "framework-87185e8f7f",
      "name": "vLLM",
      "kind": "framework",
      "description": "准备提供模型 API，或遇到张量并行和加载报错？从服务配置、量化支持与运行环境逐项检查。",
      "url": "https://gpuatlas.top/topics/framework-87185e8f7f/"
    }
  ],
  "body_text": "vLLM的max-model-len和并发不能直接同时拉满，因为长请求与更多活动序列共享状态空间和计算。一个长请求通过、许多短请求通过，不代表同数量长请求也能采用相同配置。\n\nmax-model-len涉及允许序列范围，活动序列和批处理参数决定同一时间处理哪些请求。实际预留与使用还取决于模型结构、缓存策略和版本，不能只用长度乘一个固定比例估全部显存。\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": "vllm-cache-config",
      "url": "https://raw.githubusercontent.com/vllm-project/vllm/main/vllm/config/cache.py",
      "retrieved_at": "2026-11-25T10:59:37.755333+00:00"
    },
    {
      "id": "transformers-kv-cache",
      "url": "https://raw.githubusercontent.com/huggingface/transformers/main/docs/source/en/kv_cache.md",
      "retrieved_at": "2026-11-25T10:07:29.175278+00:00"
    }
  ],
  "revision_note": "完善阅读结构；非硬件实测。",
  "representations": {
    "html": "https://gpuatlas.top/articles/T-46926f219a4a/",
    "json": "https://gpuatlas.top/data/articles/T-46926f219a4a.json",
    "markdown": "https://gpuatlas.top/data/articles/T-46926f219a4a.md"
  }
}
