HomeReadTools deskPostgreSQL on EC2 benchmark shows Graviton's cost-per-transaction lead
Tools·Jul 7, 2026

PostgreSQL on EC2 benchmark shows Graviton's cost-per-transaction lead

A detailed performance and cost analysis of PostgreSQL across 23 AWS EC2 instance types. The results provide a clear roadmap for founders optimizing database spend, with ARM-based Graviton instances…

A detailed performance and cost analysis of PostgreSQL across 23 AWS EC2 instance types. The results provide a clear roadmap for founders optimizing database spend, with ARM-based Graviton instances emerging as winners.

THE ANSWER UP FRONT

For founders and engineers choosing EC2 instances for self-hosted PostgreSQL, this benchmark is an essential read. It provides clear, actionable data showing that AWS's ARM-based Graviton instances (M7g, R7g) offer the best performance-per-dollar for general-purpose database workloads. Teams already committed to x86 should look at AMD's M7a instances as a strong alternative. Skip this if you exclusively use managed services like RDS, as the findings may not directly translate. The bottom line: for new deployments, default to Graviton for self-hosted Postgres on EC2 to maximize your infrastructure budget.

METHODOLOGY

This review analyzes the public benchmark published by "saneengineer.com" on July 7, 2026. The source provides a detailed performance comparison of PostgreSQL 16 running on 23 different AWS EC2 instance types, including Intel (M6i, M7i), AMD (M6a, M7a), and ARM/Graviton (M6g, M7g) families. The benchmark used pgbench, a standard PostgreSQL load testing tool, with a scale factor of 1000 (approximately 15GB of data) to measure transactions per second (TPS) and latency. All instances were configured with Ubuntu 24.04, a 500GB gp3 EBS volume (16,000 IOPS, 1000 MB/s throughput), and standardized PostgreSQL configurations. This v0 review is based entirely on the author's published methodology and results at the provided URL; we have not independently reproduced these tests. Our analysis covers the reported TPS, latency, and cost-per-transaction metrics.

WHAT IT DOES

Measures raw transaction throughput

The core of the benchmark is its measurement of Transactions Per Second (TPS) using pgbench. The tests were run on instances with varying vCPU counts (2, 4, 8, 16). The results show a clear performance hierarchy. For example, at the 16-vCPU size, the Graviton3-based m7g.4xlarge instance achieved a reported 20,011 TPS, outperforming the Intel-based m7i.4xlarge (18,487 TPS) and the AMD-based m7a.4xlarge (19,451 TPS). This provides a direct comparison of CPU architecture performance for a common database workload.

Calculates cost-effectiveness

The benchmark translates raw performance into a business-critical metric: cost per million transactions. By combining the measured TPS with on-demand EC2 pricing (us-east-1), it identifies the most cost-effective instances. The ARM-based Graviton instances consistently lead in this category. For instance, the m7g.large (2 vCPU) is reported to have the lowest cost per million transactions at $0.005, making it a standout choice for smaller workloads. This analysis moves beyond "which instance is fastest?" to "which instance provides the most performance for my dollar?"

Compares instance generations and families

The study systematically compares Intel, AMD, and ARM instances across multiple generations (e.g., M6 vs. M7 series). A key finding is the significant performance uplift in newer generation instances. The author also highlights that for x86-only workloads, AMD's M7a instances often present a better cost-performance profile than their Intel M7i counterparts. This level of detail allows teams with specific architecture constraints to still make an informed, cost-conscious decision.

WHAT'S INTERESTING / WHAT'S NOT

The most significant takeaway is the unambiguous validation of AWS's Graviton strategy for database workloads. For years, the promise of ARM in the data center has been about power efficiency and cost savings. This benchmark provides concrete, independent data showing that for a mainstream workload like PostgreSQL, the performance-per-dollar is not just incrementally better, it's category-defining. The fact that the cheapest instance to run a million transactions is an M7g instance is a powerful signal for any founder provisioning new infrastructure.

What's less surprising, but still valuable to see quantified, is the generational improvement. The M7 series instances consistently outperform their M6 counterparts, reinforcing the simple advice to avoid using old hardware if you can.

The benchmark's primary limitation is its reliance on pgbench. While a standard tool, its workload is synthetic and may not represent the specific query patterns of a real-world application (e.g., complex analytical queries vs. simple transactional updates). The test also focuses purely on compute performance, holding storage (a high-performance gp3 volume) and networking constant. A production system might be bottlenecked by storage I/O or network latency, which this benchmark does not explore. It's a CPU-centric comparison, and should be understood as such.

PRICING

The benchmark itself is a public resource, available free of charge. The key data within the benchmark relates to AWS EC2 on-demand pricing.

  • Benchmark Cost: Free
  • EC2 Pricing Snapshot: Based on us-east-1 on-demand prices as of July 2026.
  • Key Finding: The lowest cost-per-million-transactions was achieved by the m7g.large (ARM/Graviton) instance.
  • Cost Data: The author provides a full table of instance costs and calculated cost-per-transaction, ranging from $0.005 to over $0.010 per million transactions depending on the instance type.

VERDICT

This is a high-signal, no-fluff benchmark for any team self-hosting PostgreSQL on EC2. The data makes a compelling case for adopting AWS Graviton instances as the default choice for new deployments to achieve the best cost-efficiency. The m7g family, in particular, stands out. For teams with a strict dependency on the x86 architecture, the benchmark points towards AMD's m7a instances as the next best option over Intel. While the synthetic pgbench workload isn't a perfect mirror of every production environment, the performance gaps are large enough to be a decisive factor in infrastructure planning.

WHAT WE'D TEST NEXT

A follow-up analysis should expand in two directions. First, workload diversity: re-running the tests using a more complex, realistic benchmark suite like TPC-C or a custom workload that mirrors a typical SaaS application with more complex joins and read/write patterns. Second, platform diversity: comparing these self-hosted EC2 results against managed services like Amazon RDS and Aurora. While managed services have a higher sticker price, a total cost of ownership (TCO) analysis that includes operational overhead could reveal a different cost-efficiency landscape. Finally, testing with different storage configurations (e.g., io2 Block Express) would help identify at what point the bottleneck shifts from CPU to I/O.

The investor read

The benchmark's clear results in favor of ARM/Graviton solidify a major trend in cloud infrastructure: the unbundling of x86's dominance. This signals a durable shift in enterprise and startup spend towards ARM-based compute for mainstream workloads, not just niche applications. For investors, this has several implications. First, it validates AWS's long-term silicon investment and strengthens its competitive moat. Second, it creates opportunities for tooling companies that specialize in ARM migration, performance monitoring, and compilation (e.g., CI/CD, container base images). Any software infrastructure tool that lacks robust ARM64 support is now accumulating significant technical debt. The market for performance-tuning consultancies that can navigate this architectural transition will also likely grow.

Pull quote: “The bottom line: for new deployments, default to Graviton for self-hosted Postgres on EC2 to maximize your infrastructure budget.”

Sources · how we verified
  1. Show HN: PostgreSQL performance and cost across 23 EC2 instance types

Every claim ties to a primary source. See our methodology.

Reported by the Riley desk on Founderr Pulse’s Tools beat. Every factual claim is tied to a primary source and linked; anything that can’t be stood up doesn’t run. Founderr (RIKHATH LLC) is the accountable publisher and corrects in place. How we work · About · File a correction.
R
Riley

The Riley desk covers tools — what founders are building with, switching to, and abandoning. Every claim is sourced and linked. Operated by Founderr (RIKHATH LLC) See the desk →

Founderr Pulse — free & independent. The desk for people who build & back.