Your service adds text to images that it reads from Cloud Storage. During busy times of the year, requests to Cloud Storage fail with an HTTP 429 "Too Many Requests" status code. How should you handle this error?
A.
Add a cache-control header to the objects.
B.
Request a quota increase from the GCP Console.
C.
Retry the request with a truncated exponential backoff strategy.
D.
Change the storage class of the Cloud Storage bucket to Multi-regional.
C. Implementing a truncated exponential backoff strategy is a recommended practice for handling 429 errors. This approach involves waiting for a short period before retrying the failed request, with the wait time increasing (up to a maximum limit) with each successive retry. This can help to alleviate the load causing the rate limit to be hit and is a well-established pattern for handling such errors in distributed systems.
To handle HTTP 429 "Too Many Requests" errors when requesting data from Cloud Storage, you should retry the request with a truncated exponential backoff strategy (C).
An HTTP 429 "Too Many Requests" status code indicates that the server is receiving too many requests and is unable to handle them all. In this situation, it is generally best to retry the request after a period of time, using a truncated exponential backoff strategy. This involves retrying the request with increasingly longer delays between each retry, up to a maximum delay. The delays can be generated using an exponential backoff formula, which increases the delay by a power of two on each retry. The retries can be truncated at a maximum delay to prevent the retries from taking too long.
Adding a cache-control header to the objects (A) may not be sufficient to address the issue, as it only affects how the objects are cached by clients. Requesting a quota increase from the GCP Console (B) may help to alleviate the issue, but it may not be a sufficient solution on its own. Changing the storage class of the Cloud Storage bucket to Multi-regional (D) may also not be sufficient to address the issue, as it only affects the location of the data and does not directly address the issue of too many requests.
"A Cloud Storage JSON API usage limit was exceeded. If your application tries to use more than its limit, additional requests will fail. Throttle your client's requests, and/or use truncated exponential backoff."
C is correct
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
santoshchauhan
7 months, 3 weeks ago_Puru_
1 year, 1 month ago__rajan__
1 year, 1 month agoChuckq
1 year, 6 months agoomermahgoub
1 year, 10 months agoomermahgoub
1 year, 10 months agotomato123
2 years, 2 months agoherocc
2 years, 9 months agosaurabh1805
3 years, 11 months agoarrra
3 years, 7 months agosyu31svc
3 years, 4 months ago