💰 Compute Models — How They Charge
A compute model defines how the cloud provider bills CPU, memory, and networking resources for a Docker container.
📑 Table of Contents
- 💰 Compute Models — How They Charge
- 🏎 Performance Characteristics — What Impacts Cost
- 🧩 OCI Shape Details
- ⚙️ GCP Machine Types
- 📦 Container Deployment — Cost Drivers
- 🐍 Docker Runtime Overheads
- 🔗 Networking & Storage Costs
- 📊 Cost Comparison — Numbers in Practice
- 🟩 Final Thoughts
- ❓ Frequently Asked Questions
- What is the main difference between OCI and GCP pricing models for Docker containers?
- Do network egress charges differ significantly between OCI and GCP?
- Can I combine OCI and GCP in a single deployment?
- 📚 References & Further Reading
🏎 Performance Characteristics — What Impacts Cost
Performance characteristics of the underlying VM determine the CPU time a Docker container consumes, which directly influences the compute bill.
🧩 OCI Shape Details
OCI shapes expose a fixed number of OCPUs and a guaranteed memory bandwidth. The scheduler maps each OCPU to a physical core, avoiding hyper‑threading and providing predictable latency.
$ oci compute shape list -name VM.Standard2.4
Shape: VM.Standard2.4
OCPUs: 4
Memory (GB): 64
Network Bandwidth (Gbps): 10
⚙️ GCP Machine Types
GCP machine types share physical cores among multiple virtual CPUs via hyper‑threading. Consequently, each vCPU may contend for the same execution resources, leading to variable per‑core performance. GCP also offers burstable CPU credits, which can reduce cost when a container sporadically exceeds its baseline allocation.
$ gcloud compute machine-types describe n1-standard-4 -format=json
{ "name": "n1-standard-4", "guestCpus": 4, "memoryMb": 15360, "maxPersistentDisks": 16, "deprecated": {}
}
Key point: OCI’s dedicated cores give consistent performance, while GCP’s shared cores can lower average CPU usage but introduce variability that affects cost calculations.
📦 Container Deployment — Cost Drivers
Docker container deployment choices add overhead that appears in the final compute bill.
🐍 Docker Runtime Overheads
A Docker container runs an isolated process namespace on the host kernel. The Docker daemon and namespace management consume CPU cycles and memory, typically adding 2–5 % overhead per active container.
# Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]
What this does:
- Uses a slim base image to keep the image size low.
- Installs only production dependencies, reducing runtime memory.
- Sets the working directory and copies application code.
🔗 Networking & Storage Costs
Both OCI and GCP charge for egress traffic and persistent disk usage. When containers write logs to a network file system, those I/O operations generate additional cost.
$ oci compute instance get -instance-id ocid1.instance.oc1..example
{ "id": "ocid1.instance.oc1..example", "state": "RUNNING", "publicIp": "152.67.123.45", "privateIp": "10.0.0.5"
}
In GCP, the equivalent command shows the external IP and attached disks.
$ gcloud compute instances describe my-instance -format=json
{ "id": "1234567890123456789", "status": "RUNNING", "networkInterfaces": [ { "networkIP": "10.128.0.2", "accessConfigs": [ {"natIP": "35.224.0.12"} ] } ], "disks": [ {"deviceName": "my-instance", "type": "pd-standard", "sizeGb": 100} ]
}
Key point: Even when the container itself is tiny, network egress and attached storage can dominate the compute bill if not monitored.
📊 Cost Comparison — Numbers in Practice
This section presents a concrete cost comparison for a 30‑day month running a single Docker container that uses 2 vCPU and 4 GiB memory.
| Provider | Resource | Hourly Rate (USD) | Monthly Cost (30 days) |
|---|---|---|---|
| OCI | VM.Standard.E2.2 | 0.145 | 104.40 |
| GCP | e2-standard-2 | 0.134 (pre‑discount) | 96.48 (after 30 % sustained‑use) |
To obtain the OCI price, the CLI query is shown below. The output matches the shape used in the table.
$ oci compute shape list -name VM.Standard.E2.2
Shape: VM.Standard.E2.2
OCPUs: 2
Memory (GB): 16
Price per hour (USD): 0.145
For GCP, the pricing API returns the base rate; the sustained‑use discount is applied manually.
$ gcloud compute regions describe us-central1 -format=json | jq '.quotas[] | select(.metric=="CPUS")'
{ "metric": "CPUS", "limit": 24, "usage": 2
}
Assuming the container runs continuously, the OCI cost is $104.40 while GCP’s discounted cost is $96.48—a ~7 % difference in favor of GCP for this specific workload.
Key point: GCP’s sustained‑use discount can make it cheaper for always‑on containers, whereas OCI’s flat pricing can be advantageous for short‑lived or bursty workloads that do not qualify for discounts.
🟩 Final Thoughts
When evaluating OCI vs GCP compute pricing for Docker workloads, the decision hinges on usage patterns. OCI’s per‑core pricing provides predictable costs for workloads that spin up and down frequently, while GCP’s sustained‑use model rewards long‑running containers with automatic discounts.
Both platforms charge for ancillary services such as networking and persistent storage, so a holistic view of total cost of ownership is required. Measuring actual CPU utilization, memory pressure, and egress traffic lets you map abstract pricing tables to real‑world spend and select the provider that aligns with your operational profile.
❓ Frequently Asked Questions
What is the main difference between OCI and GCP pricing models for Docker containers?
OCI uses a flat hourly rate per shape, while GCP applies a sustained‑use discount that reduces the hourly price after a certain amount of usage within a month.
Do network egress charges differ significantly between OCI and GCP?
Both providers charge for outbound traffic, but OCI’s egress rates are tiered based on volume, whereas GCP applies a uniform rate that can be lower for the first few terabytes.
Can I combine OCI and GCP in a single deployment?
Yes, multi‑cloud deployments are possible by exposing containers through a common service mesh or API gateway, but cross‑cloud data transfer costs must be accounted for.
💡 Want to practise this hands-on? DigitalOcean gives new accounts $200 free credit for 60 days — enough to spin up a full Linux/Docker/Kubernetes environment at no cost.
📚 Recommended reading: Best DevOps & cloud books on Amazon — from Linux fundamentals to Kubernetes in production, curated for working engineers.
📚 References & Further Reading
- Official OCI Compute Pricing – detailed pricing tables and shape definitions: oracle.com
- Google Cloud Compute Engine Pricing – documentation of sustained‑use discounts and machine types: cloud.google.com
- Docker Official Documentation – container runtime basics and best practices: docker.com

Top comments (0)