1.2 Select and configure FMs
1.A company is using Amazon Bedrock to generate marketing copy. They have purchased Provisioned Throughput for a specific model to ensure consistent performance. However, during peak hours, the application occasionally receives `ThrottlingException` errors despite the provisioned capacity. The development team wants to implement a resilient retry strategy that prevents overwhelming the service during recovery. Which strategy should be implemented in the application logic?
- A.Implement an immediate retry mechanism that resends the request instantly upon receiving an exception to minimize latency.
- B.Use a fixed-interval retry strategy where the application retries the request every 5 seconds until it succeeds.
- C.Implement a retry strategy with exponential backoff and jitter to gradually increase the wait time between retries and randomize the delay.
- D.Increase the Provisioned Throughput units immediately via the Bedrock API whenever a throttling exception is detected.
Show answer & explanation
Correct answer: C — Implement a retry strategy with exponential backoff and jitter to gradually increase the wait time between retries and randomize the delay.
- A. Incorrect. An immediate retry does not allow the service any time to recover from the high load that caused the throttling. This approach can create a 'thundering herd' effect, where multiple clients bombard the service simultaneously, exacerbating the problem and leading to more failures.
- B. Incorrect. While better than an immediate retry, a fixed-interval strategy can lead to synchronized retries. Multiple clients that receive a throttling exception at the same time might retry in lockstep, causing repeated spikes in traffic that continue to overwhelm the service and prolong the recovery period.
- C. Correct. This is the industry best practice and recommended approach by AWS for handling throttling. Exponential backoff systematically increases the wait time between successive retries, giving the service a progressively longer window to recover. Adding jitter (a small, random amount of time) to the backoff delay prevents clients from retrying in synchronized waves. This combination effectively smooths out request bursts and maximizes the chance of success.
- D. Incorrect. This is an operational response, not an application-level retry strategy. Programmatically increasing Provisioned Throughput on every exception is not a scalable, timely, or cost-effective solution. The scaling process is not instantaneous, and this reactive approach could lead to significant over-provisioning and increased costs. The correct approach is to handle transient errors in the application with a proper retry strategy and use monitoring to make informed, strategic decisions about capacity adjustments.