Topic 1 Question 151
Users are complaining that your Cloud Run-hosted website responds too slowly during traffic spikes. You want to provide a better user experience during traffic peaks. What should you do?
Read application configuration and static data from the database on application startup.
Package application configuration and static data into the application image during build time.
Perform as much work as possible in the background after the response has been returned to the user.
Ensure that timeout exceptions and errors cause the Cloud Run instance to exit quickly so a replacement instance can be started.
ユーザの投票
コメント(5)
- 正解だと思う選択肢: B
B is the answer.
https://cloud.google.com/blog/topics/developers-practitioners/3-ways-optimize-cloud-run-response-times Instead of computing things upon startup, compute them lazily. The initialization of global variables always occurs during startup, which increases cold start time. Use lazy initialization for infrequently used objects to defer the time cost and decrease cold start times.
👍 3zellck2022/12/22 - 正解だと思う選択肢: B
B. Package application configuration and static data into the application image during build time.
By packaging application configuration and static data into the application image during build time, the application can quickly serve requests without having to make additional requests to a database, thus reducing response time. Additionally, you might consider caching static data in the application to reduce latency and provide faster responses to user requests, also you could move some of the computation that is not time critical to be done asynchronously.
👍 2omermahgoub2023/01/11 - 正解だと思う選択肢: C
Not A - should store static data as global variables Not B - the larger the image, could slow down the startup time Not D - no errors were mentioned, app is only slowing down when traffic spikes
C - process in backgrounds
👍 1gardislan182022/12/03
シャッフルモード