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?
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
| Instance | Arch | $/hr | RPS | p95 ms | RPS/$ | RPS/vCPU |
|---|---|---|---|---|---|---|
| m8g.xlarge | arm64 | $0.2014/hr | 67,985 | 1.86 | 337,498 | 16,996 |
| r8g.xlarge | arm64 | $0.2310/hr | 64,110 | 1.88 | 277,581 | 16,027 |
| r8g.large | arm64 | $0.1264/hr | 34,304 | 2.46 | 271,315 | 17,152 |
| m8g.large | arm64 | $0.1117/hr | 5,485 | 11.91 | 49,117 | 2,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.