Professional Cloud Architect Practice Questions

Google Cloud Professional Cloud Architect exam preparation

Professional Cloud Architect practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 120 minutes.

Professional Cloud Architect free question 3 / 10 · Domain 1: Designing and planning a cloud solution architecture

A web application running as a Cloud Run service wrote files uploaded by users to the container’s local file system. After traffic dropped and instances scaled in, some of the files could no longer be found. According to the “What is Cloud Run” page, which fix is right?

  1. On receiving SIGTERM, send the files to another instance of the same service so they are kept
  2. Set a minimum number of instances so that instances never go away
  3. Allocate more memory to the container to increase how much it can write to the file system
  4. Store the files by integrating with Cloud Storage or by mounting an NFS
Show the answer and explanation

Answer: D

Why this is correct
The page says Cloud Run instances are disposable. Each container has a writable in-memory file system, and what is written there does not persist after the container stops. Cloud Run decides when to stop sending requests to an instance and stop it, for example when scaling in. To keep files persistently, integrate with Cloud Storage or mount a network file system (NFS). Before it stops, your code can also trap SIGTERM and flush local buffers to an external data store.

Why the other options are wrong
"Set a minimum number of instances so that instances never go away" … Minimum instances keep a set number of instances active so the service does not scale to zero, which avoids a delay on the first request. Each individual instance is still disposable.
"Allocate more memory to the container to increase how much it can write to the file system" … The container’s writable file system lives in memory and does not persist after the container stops. Increasing how much you can write does not help, because the contents disappear when instances scale in. Use Cloud Storage or NFS to keep files.
"On receiving SIGTERM, send the files to another instance of the same service so they are kept" … The page says Cloud Run instances are disposable, and every container has a writable in-memory file system that does not persist after it stops. SIGTERM is for flushing to an external data store; files sent to another instance are lost when that instance stops.

Key point
When there are no requests, even the last instance is removed (scale to zero), so you are not charged while the service is idle unless you set minimum instances. Billing applies to the CPU and memory you allocate, in 100-millisecond increments.

Go to the Professional Cloud Architect practice app (10 free questions; purchase unlocks all questions)

See the full practice set