Topic 1 Question 95
You have an application that makes HTTP requests to Cloud Storage. Occasionally the requests fail with HTTP status codes of 5xx and 429. How should you handle these types of errors?
Use gRPC instead of HTTP for better performance.
Implement retry logic using a truncated exponential backoff strategy.
Make sure the Cloud Storage bucket is multi-regional for geo-redundancy.
Monitor https://status.cloud.google.com/feed.atom and only make requests if Cloud Storage is not reporting an incident.
ユーザの投票
コメント(17)
Answer is B You should use exponential backoff to retry your requests when receiving errors with 5xx or 429 response codes from Cloud Storage. https://cloud.google.com/storage/docs/request-rate
👍 32bigob4ek2019/11/11HTTP 408, 429, and 5xx response codes.
Exponential backoff algorithm For requests that meet both the response and idempotency criteria, you should generally use truncated exponential backoff.
Truncated exponential backoff is a standard error handling strategy for network applications in which a client periodically retries a failed request with increasing delays between requests.
An exponential backoff algorithm retries requests exponentially, increasing the waiting time between retries up to a maximum backoff time. See the following workflow example to learn how exponential backoff works:
You make a request to Cloud Storage.
If the request fails, wait 1 + random_number_milliseconds seconds and retry the request.
If the request fails, wait 2 + random_number_milliseconds seconds and retry the request.
If the request fails, wait 4 + random_number_milliseconds seconds and retry the request.
And so on, up to a maximum_backoff time.
Continue waiting and retrying up to a maximum amount of time (deadline), but do not increase the maximum_backoff wait period between retries
👍 8Sbgani2022/09/07- 👍 2bnlcnd2021/01/30
シャッフルモード