Topic 1 Question 238
You are a lead developer working on a new retail system that runs on Cloud Run and Firestore in Datastore mode. A web UI requirement is for the system to display a list of available products when users access the system and for the user to be able to browse through all products. You have implemented this requirement in the minimum viable product (MVP) phase by returning a list of all available products stored in Firestore.
A few months after go-live, you notice that Cloud Run instances are terminated with HTTP 500: Container instances are exceeding memory limits errors during busy times. This error coincides with spikes in the number of Datastore entity reads. You need to prevent Cloud Run from crashing and decrease the number of Datastore entity reads. You want to use a solution that optimizes system performance. What should you do?
Modify the query that returns the product list using integer offsets.
Modify the query that returns the product list using limits.
Modify the Cloud Run configuration to increase the memory limits.
Modify the query that returns the product list using cursors.
ユーザの投票
コメント(4)
- 正解だと思う選択肢: D
While increasing the memory limits of Cloud Run instances could help alleviate the issue temporarily, it would not address the root cause of the problem, which is the high number of Datastore entity reads during busy times. Over time, as more products are added to the system, this problem would only become more severe, and you would have to continually increase the memory limits to prevent Cloud Run from crashing.
Using cursors to paginate the results and retrieve a limited number of products at a time is a more sustainable solution as it reduces the amount of data that needs to be read from Datastore and decreases the memory usage of your Cloud Run instances. This way, you can maintain the performance of the system and prevent it from crashing, even as more products are added over time.
👍 2mrvergara2023/02/04 - 正解だと思う選択肢: C
The issue is with the memory limits. https://cloud.google.com/run/docs/configuring/memory-limits#optimizing https://cloud.google.com/run/docs/configuring/memory-limits#optimizing
👍 1TNT872023/01/31 - 正解だと思う選択肢: A
Note: To conserve memory and improve performance, a query should, whenever possible, specify a limit on the number of results returned.
https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets
👍 1Pime132023/02/19
シャッフルモード