Skip to content

Running the lab on GCP

Lowest-cost practical approach

Use a temporary Compute Engine VM with Docker rather than a managed production database. A medium profile benefits from 8–16 vCPUs, 32–64 GB RAM, and a 250+ GB balanced persistent disk. Start smaller, observe, and resize only if the experiment requires it.

  1. Create an Ubuntu VM and restrict SSH ingress to your IP.
  2. Install Docker Engine and the Compose plugin.
  3. Clone or copy this repository.
  4. Keep PostgreSQL port 5432 private; use SSH tunneling if connecting remotely.
  5. Run make setup PROFILE=medium.
  6. Stop or delete the VM and disk when finished.

Cloud SQL alternative

Cloud SQL is useful for managed-service comparisons, but bootstrap data from a client VM in the same region. Do not install postgresql.conf; configure supported flags such as track_io_timing through the instance. Confirm extension availability before relying on pg_stat_statements.

Cost discipline

Use a disposable project or clear labels, budget alerts, private IP where practical, no public database exposure, and snapshots only when recreating the dataset is more expensive than storage. The large profile is not required for most modules.

Before provisioning cloud resources, validate the project with the local Docker workflow and review the dataset profiles.