0
0
GCPcloud~10 mins

Cold start behavior in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to deploy a Cloud Function with minimum instances to reduce cold starts.

GCP
gcloud functions deploy my-function --runtime python39 --trigger-http --min-instances=[1]
Drag options to blanks, or click blank then click option'
A0
B5
C10
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Setting min-instances to 0 causes cold starts.
Using too many instances increases cost unnecessarily.
2fill in blank
medium

Complete the code to set the maximum instances to limit scaling and control cold start frequency.

GCP
gcloud functions deploy my-function --runtime python39 --trigger-http --max-instances=[1]
Drag options to blanks, or click blank then click option'
A1000
B10
C100
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting max-instances to 0 disables function.
Setting max-instances too high can increase cold starts.
3fill in blank
hard

Fix the error in the Cloud Run service configuration to reduce cold start latency by setting minimum instances.

GCP
gcloud run deploy my-service --image gcr.io/my-project/my-image --min-instances=[1]
Drag options to blanks, or click blank then click option'
A1
B0
C-1
D100
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or negative values for min-instances.
Setting min-instances too high increases cost.
4fill in blank
hard

Fill both blanks to configure Cloud Run service with CPU always allocated and minimum instances to reduce cold starts.

GCP
gcloud run deploy my-service --image gcr.io/my-project/my-image --execution-environment=[1] --min-instances=[2]
Drag options to blanks, or click blank then click option'
Agen1
B1
C0
Dgen2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'gen2' causes cold starts.
Setting min-instances to 0 does not keep instances warm.
5fill in blank
hard

Fill all three blanks to configure Cloud Function with memory, timeout, and minimum instances to optimize cold start behavior.

GCP
gcloud functions deploy my-function --runtime python39 --memory=[1] --timeout=[2] --min-instances=[3]
Drag options to blanks, or click blank then click option'
A512MB
B60s
C1
D128MB
Attempts:
3 left
💡 Hint
Common Mistakes
Using too much memory increases cold start time.
Setting min-instances to 0 causes cold starts.