Google PCD: Cost, Governance and Sustainable Application Operations — Study Guide

Part of the Google Professional Cloud Developer — Study Guide. Practice with verified answers in the Google exam hub, or take timed practice tests on ExamRoll.io.

Overview

Cost, governance, and sustainable operations are inseparable in modern Google Cloud application development. The goal is to expose and control spend, design services that scale economically, and enforce guardrails that keep environments secure, compliant, and clean—while balancing performance and reliability. This section details practical mechanisms (billing and labels, autoscaling knobs, quotas and policies), workload-specific economics (Cloud Run, GKE, data platforms), and the sustainability-aware choices that reduce idle waste and carbon impact without undermining user experience.

Cost Controls and Visibility

Example: add labels gcloud compute instances update web-01 –labels=team=payments,app=checkout,env=prod

Example: list Compute Engine quotas gcloud services quota list
–service=compute.googleapis.com
–consumer=projects/$PROJECT_ID

Elasticity and Compute Economics

Example: Cloud Run configuration (service.yaml) apiVersion: serving.knative.dev/v1 kind: Service metadata: name: img-api annotations: autoscaling.knative.dev/minScale: “2” spec: template: spec: containerConcurrency: 40 containers: - image: gcr.io/PROJECT/img-api resources: limits: memory: “512Mi”

Example: GKE deployment with requests/limits apiVersion: apps/v1 kind: Deployment metadata: name: api spec: replicas: 3 template: spec: containers: - name: api image: gcr.io/PROJECT/api:stable resources: requests: cpu: “500m” memory: “512Mi” limits: cpu: “1” memory: “768Mi”

Data, Analytics, and Network Cost Governance

Example: Cloud Storage lifecycle cat > policy.json « ‘EOF’ { “rule”: [ { “action”: {“type”: “SetStorageClass”, “storageClass”: “COLDLINE”}, “condition”: {“age”: 30} }, { “action”: {“type”: “Delete”}, “condition”: {“age”: 365} } ] } EOF gsutil lifecycle set policy.json gs://my-bucket

Example: cap query cost bq query –use_legacy_sql=false –maximum_bytes_billed=1000000000
‘SELECT user_id, COUNT(*) FROM proj.ds.events WHERE _PARTITIONDATE >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY) GROUP BY user_id’

Organizational Governance and Environment Hygiene

Practical Problem Scenario

NimbusMarket, an e-commerce company, experiences spiky traffic during flash sales and growing analytics spend. They run customer APIs on Cloud Run, background workers on GKE, and product analytics in BigQuery. Leadership asks for 25 percent cost reduction without compromising the 99.9 percent API SLO.

Approach:

  1. Establish cost visibility and guardrails

    • Create budgets with forecast alerts at 60, 90, and 100 percent for the billing account, with Pub/Sub notifications routed to on-call.
    • Standardize labels (team, app, env, cost-center) and enforce via CI on Terraform plans; add an org policy that restricts resource locations to approved regions. Rationale: Budgets give early warning; labels unlock per-team reports; policies prevent accidental high-egress regions and improve compliance.
  2. Tune Cloud Run for economic scaling

    • Set containerConcurrency to 40 for the stateless API after profiling confirms 30 ms average CPU time and non-blocking IO. Configure minScale=2 to avoid cold starts during normal hours; set a scheduled policy to drop minScale to 0 overnight. Rationale: Higher concurrency improves utilization and reduces instance count; minimal steady instances preserve SLOs with limited baseline cost that is removed off-hours.
  3. Right-size GKE workloads and enable efficient autoscaling

    • Apply requests of 500m CPU/512Mi and limits of 1 CPU/768Mi to the worker pods based on profiling. Enable HPA on queue depth and processing latency, and VPA in recommend mode to iteratively refine requests. Verify PodDisruptionBudgets allow scale-down. Enable Cluster Autoscaler on the pool with multiple smaller nodes. Rationale: Accurate requests drive effective scheduling and autoscaling; HPA aligns capacity to backlog; VPA avoids drift; multiple small nodes reduce stranded capacity and speed scale events.
  4. Adopt Spot capacity for fault-tolerant batch

    • Move image thumbnail generation to Spot-backed node pool with checkpointing. Implement preStop hooks to flush in-flight work and a controller to reschedule interrupted jobs. Rationale: Thumbnailing is idempotent and time-flexible, making it ideal for Spot savings with minimal impact on user experience.
  5. Reduce analytics scan costs and isolate workloads

    • Partition and cluster the events table by event_date and customer_id. Add table expiration for raw events after 180 days. Assign marketing analysts to a separate BigQuery reservation with a slot cap; enforce maximum_bytes_billed in their scheduled queries. Convert nightly reports to batch priority. Rationale: Partitioning and clustering curb per-query bytes; expiration enforces governance; reservations isolate noisy neighbors; batch reduces contention and cost for non-urgent jobs.
  6. Optimize storage lifecycle and egress

    • Store product images in dual-region near customers; move images untouched for 30 days to Coldline via lifecycle rules; serve via Cloud CDN. Co-locate Cloud Run services with Cloud SQL in the same region and enable Private Service Connect to Google APIs. Rationale: CDN reduces egress and latency; lifecycle shifts cold content to cheaper storage; co-location minimizes egress and improves performance.
  7. Implement cleanup automation and sustainability checks

    • Tag ephemeral environments with ttl-hours and run a nightly Cloud Run job that deletes expired resources. Use Carbon Footprint reports to consider moving batch jobs to a lower-carbon region and schedule them during off-peak carbon hours. Rationale: Automated cleanup prevents cost leaks; carbon-aware scheduling reduces environmental impact without affecting SLOs.
  8. Validate with SLO-aware load tests and cost models

    • Run load tests that replay flash-sale patterns; verify p95 latency and error budgets. Compare cost before/after using billing export dashboards. Rationale: Confirms that tuning meets reliability targets while delivering measurable savings aligned to goals.

By executing these steps, NimbusMarket aligns spend with demand, prevents idle waste, and enforces governance, achieving targeted savings while maintaining the 99.9 percent API SLO and improving sustainability posture.


Testing · All domains

Practice these questions → · Timed practice on ExamRoll.io →

Pass the whole exam — not just this question

You found this answer. Get every verified question and explanation in one place, and save hours of prep. Free to start.

Pass your exam →

Browse Google →

Related guides

All-in-one access

One subscription. Every exam.

Every plan unlocks unlimited answer search, practice tests, AI explanations, and the full resource library — in 20+ languages.

Monthly
24.87
Just €0.83/day
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

Best value
12 months
179.87
Just €0.49/daySave 40%
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

✓ Free plan included · ✓ Cancel anytime · ✓ All plans unlock the full product