GCP custom machine types cost: paying only for the vCPU and memory you need
Compute Engine custom machine types let you pick vCPU and memory independently instead of taking a predefined shape, which can cut cost when your workload does not match a standard ratio. Here is how the pricing works and when custom pays off.
Quick answer
Custom machine types let you choose the number of vCPUs and the amount of memory independently rather than accepting a predefined ratio, and Compute Engine bills the vCPU and memory separately, for example roughly 0.033 dollars per vCPU-hour and 0.0045 dollars per GB-hour for N1 custom in a standard region before discounts. This saves money when your workload needs an unusual ratio, such as high memory with few cores, because you avoid paying for cores you would get for free in a predefined high-memory shape. Custom machines still earn sustained and committed use discounts. The rule of thumb is use a predefined type when your needs match a standard ratio, and a custom type when they do not, so you stop paying for unused vCPU or memory.
Predefined machine types are convenient, but they lock you into fixed ratios of vCPU to memory. If your workload needs, say, a lot of memory but few cores, the nearest predefined shape forces you to buy cores you do not need. Custom machine types solve that by letting you dial vCPU and memory independently, and because Compute Engine prices the two separately, you pay only for the mix you actually configure.
How custom machines are priced
| Component | Approximate N1 custom rate (standard region) |
|---|---|
| Each vCPU | About 0.0332 dollars per vCPU-hour |
| Each GB of memory | About 0.0045 dollars per GB-hour |
| Extended memory above the ratio limit | Higher per-GB rate |
The bill is simply the number of vCPUs times the vCPU rate plus the gigabytes of memory times the memory rate, summed for the hours the VM runs. N2 and other families have their own custom rates. Because you set each dimension yourself, a custom machine with 4 vCPUs and 16 GB costs exactly that combination rather than rounding up to a predefined shape. Custom machines still qualify for sustained use discounts and committed use discounts, so the flexibility does not cost you the automatic savings.
Extended memory
Each machine family has a maximum memory-per-vCPU ratio included at the base memory rate. If you need more memory per core than that ratio allows, you can add extended memory, which is billed at a higher per-GB rate. Extended memory is useful for memory-bound workloads like in-memory caches or large analytical jobs, but the premium means you should confirm the workload genuinely needs the extra memory rather than reaching for it out of caution, since a smaller predefined memory-optimized machine may be cheaper past a certain point.
When custom saves money
Custom pays off when your requirement sits between predefined shapes or off their standard ratio. Suppose your service needs 6 vCPUs and 12 GB. The predefined standard shapes jump from 4 vCPU to 8 vCPU, so you would take 8 vCPUs and pay for two cores you do not use. A custom 6 vCPU, 12 GB machine bills for exactly what you set, removing that waste. The same logic applies to memory-heavy workloads that would otherwise force you onto an oversized predefined tier. This is Compute Engine's version of right-sizing applied to the machine shape itself.
Choosing predefined or custom
Start by measuring the vCPU and memory your workload actually uses under real load. If that lands close to a predefined ratio, the predefined type is simplest and priced the same as the equivalent custom configuration. If it lands between shapes or off the standard ratio, a custom type removes the rounding waste. Avoid extended memory unless the workload truly needs it, and re-check the shape after profiling rather than sizing for a peak that never arrives. Price both the predefined and custom options against the resource catalog so the cheaper shape is chosen before the VM is running.
FAQ
How are GCP custom machine types priced?
Compute Engine bills the vCPU and memory of a custom machine separately, for example roughly 0.0332 dollars per vCPU-hour and 0.0045 dollars per GB-hour for N1 custom in a standard region before discounts. The total is the vCPU count times the vCPU rate plus the memory in gigabytes times the memory rate, for the hours the VM runs. Custom machines still earn sustained and committed use discounts.
When is a custom machine type cheaper than a predefined one?
When your requirement sits between predefined shapes or off their standard vCPU-to-memory ratio. If you need 6 vCPUs and 12 GB, a predefined type would round up to 8 vCPUs and charge for two unused cores, while a custom 6 vCPU, 12 GB machine bills for exactly what you set. Memory-heavy workloads that would otherwise force an oversized predefined tier also benefit.
What is extended memory on a custom machine type?
Each machine family includes a maximum memory-per-vCPU ratio at the base memory rate. Extended memory lets you add memory beyond that ratio, billed at a higher per-GB rate. It suits memory-bound workloads like in-memory caches, but because of the premium you should confirm the extra memory is genuinely needed, since a memory-optimized predefined machine may be cheaper past a certain point.
Do custom machine types get sustained and committed use discounts?
Yes. Custom machine types qualify for sustained use discounts, which reduce the effective rate by up to 30 percent for full-month usage on eligible families, and for committed use discounts when you commit to one or three years. So choosing a custom shape for right-sizing does not cost you the automatic or committed savings you would get on a predefined machine.
How does C3X help with custom machine type cost?
C3X prices your Compute Engine machine configuration from Terraform before you deploy, so the cost of a custom vCPU and memory combination is visible in the pull request. That lets you compare a custom shape against the nearest predefined type and confirm the custom configuration removes rounding waste, right-sizing the machine at design time rather than discovering an oversized predefined VM on the bill.
What to do next
Right-size your Compute Engine machine shape before you deploy. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.