AIP-C01 练习题

AIP-C01 题目讲解:自适应重试降低同步重试风暴

AIP-C01 练习题讲解。答案 C。ThrottlingException 表示请求达到服务限制,固定间隔一起重试可能再次同时冲击。

AIP-C01 免费试练题 · 考证匠讲解

题目

A developer is building a text-summarization application using Amazon Bedrock. During load testing, the application frequently encounters ThrottlingException errors from the Bedrock runtime API due to sporadic spikes in user traffic. The application logic is hosted on AWS Lambda using the AWS SDK for Python (Boto3). Which strategy provides the MOST resilient and cost-effective resolution to these errors without human intervention?

A. Implement a try-except block in the Lambda code. On exception, sleep for a fixed 5-second interval and retry the request up to 3 times.
B. Configure Provisioned Throughput for the Bedrock model to ensure reserved capacity is always available for peak loads.
C. Configure the AWS SDK Config object to use the adaptive retry mode, allowing the client to dynamically adjust request rates and retries based on the error responses.
D. Use Amazon API Gateway usage plans to throttle the client-side requests before they reach the Lambda function.

答案

答案 C。ThrottlingException 表示请求达到服务限制,固定间隔一起重试可能再次同时冲击。

拆题

  • ThrottlingException 表示请求达到服务限制,固定间隔一起重试可能再次同时冲击。
  • SDK adaptive mode 根据响应调节请求速率并退避,但仍需合适 client 隔离与超时。
  • Lambda 内等待会占运行时长,若持续负载超配额,仍需排队、并发限制或容量规划。

每个选项为什么对、为什么错

  • A:固定五秒重试可能所有调用同步再撞上限,没有 jitter 或动态控制。
  • B:预置吞吐可能解决持续容量,但成本高且需提前采购,不是短时抖动的最低自动恢复路径。
  • C(正确):SDK adaptive 模式提供请求速率与重试反馈调节,最贴合题中 sporadic spikes;实际支持与尝试数需明确配置。
  • D:API Gateway client throttle 可帮助入口治理,但 usage plans 并非 Bedrock 成本/容量的精准硬上限,也未处理已发请求的 SDK 重试。

放到具体场景里

教学例子:Config(retries={"mode":"adaptive","total_max_attempts":4}) 作为配置示意,实际版本需验证。为不同模型限流资源使用独立 client,给 Lambda 总超时留预算,并对仍失败请求返回可重试状态或入队。不能在用户交互请求无限等待。

检查对象本例条件或动作结果与边界
错误ThrottlingException容量反馈
策略adaptive + 有限尝试控制速率与退避
边界Lambda timeout / 队列持续超载需规划

遇到同类题的判断顺序

  1. 分类错误:仅对可重试失败处理。
  2. 配置 SDK:有限尝试与超时。
  3. 隔离资源:避免一模型节流拖累全部 client。
  4. 观测压力:持续超载加入队列或容量方案。
结论:重试提高韧性,不创造容量,也不能无限延长请求。

参考资料

继续练这门考试

同一门考试的免费试练题都附这样的完整讲解,做完再看讲解。