Best EC2 Instance for PostgreSQL (Benchmarked)

PostgreSQL on AWS

3 min read Original article ↗

Guide

A data-backed answer, from real benchmarks: the best AWS EC2 instance types for self-managed PostgreSQL by price/performance, raw throughput, and cost — measured on a 90% read / 10% write OLTP workload.

Context

Workload
90% read / 10% write

PostgreSQL
17

Dataset
10 GB

Storage
gp3-baseline

Region
us-east-1

Heads up: this covers a limited, hand-picked set of 26 instance types across 8 EC2 families — not every instance AWS offers. Benchmarks last run .

TL;DR

If you want…PickBecause
Best price/performancem8g.xlarge337,498 req/s per $/hr — the most throughput per dollar of any instance tested.
Maximum throughputm8g.2xlarge81,055 req/s, the highest measured — when capacity beats cost.
Lowest running costt4g.small$0.0387/hr (~$28/mo) all-in, still serving 2,158 req/s.
Best Graviton (Arm)m8g.xlarge337,498 req/s per $/hr — top Arm value.
Best Intel (x86)m7i.xlarge282,820 req/s per $/hr — top x86 value.

Full ranking by price/performance

Ranked at a 10 GB dataset on gp3-baseline storage. Want a different size, disk, or workload? Open the interactive sizing tool to re-sort the full dataset, or read the methodology.

How to choose

There is no single “best” instance — it depends on what you are optimizing. Pick the smallest instance whose throughput clears your real peak (with headroom), then compare its cost-efficiency to the alternatives above. A few rules of thumb from the data:

  • Graviton (Arm) usually wins on cost-efficiency. At comparable throughput it carries a lower hourly price, so it leads the requests-per-dollar ranking for this workload.
  • Right-size to your working set. Throughput holds up while the dataset fits in RAM and drops once it spills to disk — so the winner can change with dataset size. Check your size in the sizing tool.
  • Burstable (t-family) is for spiky, low-average load. The numbers here reflect sustained credit mode; a credit-starved t3/t4g will perform worse under steady load.

FAQ

What is the best EC2 instance for PostgreSQL?

For price/performance, m8g.xlarge (arm64) leads at 337,498 req/s per $/hr. If you need the most raw throughput regardless of cost, m8g.2xlarge is fastest at 81,055 req/s. The right pick depends on whether you are optimizing for cost-efficiency or peak capacity.

Is AWS Graviton (Arm) faster than Intel (x86) for PostgreSQL?

In these benchmarks the best Graviton (Arm) instance, m8g.xlarge, delivers 337,498 req/s per $/hr versus 282,820 req/s per $/hr for the best Intel/x86 instance, m7i.xlarge. Graviton generally wins on cost-efficiency for this PostgreSQL workload because of its lower hourly price at comparable throughput.

How much does it cost to run PostgreSQL on EC2?

The cheapest benchmarked instance, t4g.small, costs $0.0387/hr (~$28/mo) including its gp3 EBS volume, while sustaining 2,158 req/s. Cost scales with instance size; compare the full table to find the smallest instance that meets your throughput target.

What workload were these PostgreSQL benchmarks run on?

A mixed OLTP pattern — 90% random primary-key reads and 10% single-row inserts — at 32 concurrent connections on PostgreSQL 17, in us-east-1, with a 10 GB dataset on a gp3-baseline gp3 volume. Full methodology is published, and the harness is open source.