为 AgentCore 网关上的 AI 流量配置速率限制
摘要
AWS 为 Amazon Bedrock AgentCore 网关新增速率限制功能,支持按用户对工具、模型和代理流量进行精细管控,并提供请求率、Token 率与连接率三类指标。
核心要点
- AgentCore 网关提供 MCP、推理和 HTTP 直通三类目标,速率限制可对所有目标类型生效。
- 请求率限制以 RPS/RPM 计,每个请求无论耗时长短都计为一个单位;Token 率限制仅适用于推理目标,同时计入输入与输出 Token。
- Token 预扣机制:网关先用通用 tokenizer 估算输入 Token 并从限额桶中预扣,推理返回后再按真实用量校准。
- 连接率限制以 CPS 计,用于保护长时间流式会话,每个连接在整个持续时间内占用一个槽位。
- 维度键支持 targetName、toolName、qualifiedModelId、JWT claim、IAM principal 与 sourceIdentity;条目支持通配符 "*" 为每个值创建独立桶,命名条目优先级高于通配符。
原文佐证
- Rate limiting in AgentCore gateway gives you per-user control over how users consume your tools, inference models, and agents.
- Token rate limits , measured in tokens per minute (TPM), apply to inference targets only.
- AgentCore gateway uses a general-purpose tokenizer to estimate the incoming tokens for a request and deducts it from the rate-limit bucket upfront before the gateway dispatches the inference call.
AI 洞察
AgentCore 的速率限制标志着 AI 流量治理开始从网络层走向应用与成本层。通过 token 级的配额管理,企业能把模型调用与预算、权限、治理绑定,这为 AI 的大规模内部采用扫清障碍。未来,类似 API 网关的“AI 网关”将成为企业 AI 基础设施标配,并驱动围绕可观测、可治理、可计费的新工具链。