nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #168

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?

The correct answer is B. Package application configuration and static data into the application image during build time.. Cloud Run scales by starting new container instances on demand. Instance startup latency (cold start) is a key contributor to slow responses during spikes. Packaging application configuration and static data directly into the container image means no external calls to a database

Optimizing performance

Question

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?

Options

  • ARead application configuration and static data from the database on application startup.
  • BPackage application configuration and static data into the application image during build time.
  • CPerform as much work as possible in the background after the response has been returned to the
  • DEnsure that timeout exceptions and errors cause the Cloud Run instance to exit quickly so a

How the community answered

(16 responses)
  • A
    6% (1)
  • B
    69% (11)
  • C
    19% (3)
  • D
    6% (1)

Explanation

Cloud Run scales by starting new container instances on demand. Instance startup latency (cold start) is a key contributor to slow responses during spikes. Packaging application configuration and static data directly into the container image means no external calls to a database or storage service are needed at startup or request time, reducing both cold start latency and per-request latency. Reading from a database at startup (A) adds latency and creates a bottleneck. Background work after response (C) doesn't speed up the initial response. Exiting quickly on timeout (D) recycles bad instances but doesn't reduce response times for normal requests.

Topics

#Cloud Run#Performance Optimization#Cold Starts#Container Images

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice