Comparison

m8g vs r8g for PostgreSQL

Graviton4 general-purpose (m8g, 4 GiB/vCPU) vs memory-optimized (r8g, 8 GiB/vCPU) for PostgreSQL — does the extra RAM pay off, and when?

Workload 90% read / 10% writePostgreSQL 17Dataset 10 GBStorage gp3-baseline

Verdict

For this PostgreSQL workload, m8g.xlarge (arm64) is the best value at 337,498 req/s per $/hr — a 22% cost-efficiency lead over r8g.xlarge. The highest raw throughput comes from m8g.xlarge at 67,985 req/s.

Side by side

m8g vs r8g for PostgreSQL: PostgreSQL benchmark comparison
InstanceArch$/hrRPSp95 msRPS/$RPS/vCPU
m8g.xlargearm64$0.2014/hr67,9851.86337,49816,996
r8g.xlargearm64$0.2310/hr64,1101.88277,58116,027
r8g.largearm64$0.1264/hr34,3042.46271,31517,152
m8g.largearm64$0.1117/hr5,48511.9149,1172,743

Measured at a 10 GB dataset on gp3-baseline storage. Open the sizing tool to change the dataset size, disk, or metric, or browse the full benchmark data.

Frequently asked questions

Which is better for PostgreSQL, m8g.large or r8g.large or m8g.xlarge or r8g.xlarge?

On cost-efficiency, m8g.xlarge leads at 337,498 req/s per $/hr. For raw throughput, m8g.xlarge is fastest at 67,985 req/s. Choose by whether you optimize for throughput per dollar or peak capacity.

m8g.xlarge vs r8g.xlarge: what's the difference for PostgreSQL?

m8g.xlarge delivers 67,985 req/s at 337,498 req/s per $/hr; r8g.xlarge delivers 64,110 req/s at 277,581 req/s per $/hr. That is a 22% cost-efficiency edge for m8g.xlarge on this workload.

What workload and configuration were these numbers measured on?

A mixed OLTP pattern — 90% primary-key reads, 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. The benchmark harness is open source.