logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·02.11.26
← Back to news

Show HN: PostgreSQL performance and cost across 23 EC2 instance types

Original article
postgres.saneengineer.com|61 points|10 comments|by anivan_|Jul 7, 2026

Analysis: PostgreSQL Performance & Cost Across 23 AWS EC2 Instance Types

Source: The Sane Engineer Objective: Provide a data-driven framework for sizing PostgreSQL servers on AWS by balancing data volume, required throughput, and budget.

Stop guessing your instance sizes. Instead, use benchmarked data to find the intersection of performance and price.

🛠️ Benchmark Methodology

The tests were designed to simulate a realistic production environment with the following parameters:

  • Database Engine: PostgreSQL 17
  • AWS Region: us-east-1
  • Pricing Model: On-demand
  • Concurrency: 32 simultaneous connections
  • Workload Distribution: Read=90%∣Write=10%\text{Read} = 90\% \quad | \quad \text{Write} = 10\%Read=90%∣Write=10%

The Selection Process

To choose the right instance, follow this logic flow:

  1. Define your Dataset Size.
  2. Define your Target Throughput (Requests Per Second).
  3. Identify all instances that exceed that throughput.
  4. Select the one with the lowest monthly cost.

📉 Case Study: 1 GB Dataset

For a small dataset of 1 GB with a target of 33,000 RPS, the results are as follows:

Recommendation Summary

GoalRecommended InstanceDiskArchCost/MoPerformance
Cheapestm8g.largegp3-baselineGraviton$8245,515 RPS (1.4×\times× target)
Safe Pickm8g.largegp3-baselineGraviton$82≥20%\ge 20\%≥20% headroom
Max Efficiencyc8i.largegp3-baselinex86-64~$8452,203 RPS (Best RPS/$)

Requirement Checklist:

  • Clear 33,000 RPS
  • Minimize monthly spend
  • Maintain stability (headroom)

Note: 30 out of 52 tested configurations successfully cleared the 33,000 RPS threshold for a 1 GB dataset.

Performance Frontier Graph Figure 1: The dashed line represents the cost/performance frontier. Green points denote arm64 (Graviton) and slate points denote x86-64.


📊 Comprehensive Benchmark Results (1 GB)

The following table details the performance of various instance ×\times× disk combinations.

Instance FamilyArchDiskvCPURAM (GiB)RPSRPS/$$/hr$/moAvg msp95 msp99 msRPS/vCPURPS/GiBHeadroom
c8i.largex86-64gp3-baseline2452,203 ±0.4%\pm 0.4\%±0.4%451,476$0.1156~$840.612.162.7926,10213,0511.6×\times×
m8g.largearm64gp3-baseline2845,515 ±0.1%\pm 0.1\%±0.1%407,555$0.1117~$820.702.022.7622,7575,6891.4×\times×
m8g.xlargearm64gp3-baseline41670,871 ±0.1%\pm 0.1\%±0.1%351,826$0.2014~$1470.451.832.3217,7184,4292.1×\times×
m7i.largex86-64gp3-baseline2841,305 ±0.4%\pm 0.4\%±0.4%336,586$0.1227~$900.772.333.1120,6535,1631.3×\times×
m7g.xlargearm64gp3-baseline41658,726 ±0.4%\pm 0.4\%±0.4%317,234$0.1851~$1350.541.982.4414,6813,6701.8×\times×
c8i.xlargex86-64gp3-baseline4864,585 ±0.1%\pm 0.1\%±0.1%308,522$0.2093~$1530.501.852.2716,1468,0732.0×\times×
r8g.largearm64gp3-baseline21638,531 ±1.6%\pm 1.6\%±1.6%304,746$0.1264~$920.832.353.0619,2662,4081.2×\times×
m7i.xlargex86-64gp3-baseline41665,582 ±0.2%\pm 0.2\%±0.2%293,410$0.2235~$1630.491.862.3016,3964,0992.0×\times×
r8g.xlargearm64gp3-baseline43264,627 ±0.6%\pm 0.6\%±0.6%279,821$0.2310~$1690.491.892.3216,1572,0202.0×\times×
m8g.mediumarm64gp3-baseline1416,670 ±0.4%\pm 0.4\%±0.4%249,555$0.0668~$491.923.444.2816,6704,1670.5×\times×
m7g.largearm64gp3-baseline2824,669 ±0.4%\pm 0.4\%±0.4%238,304$0.1035~$761.302.833.5812,3343,0840.7×\times×
r8g.mediumarm64gp3-baseline1816,482 ±0.2%\pm 0.2\%±0.2%222,197$0.0742~$541.943.514.2916,4822,0600.5×\times×
m7g.2xlargearm64gp3-baseline83277,197 ±1.6%\pm 1.6\%±1.6%221,629$0.3483~$2540.411.812.229,6502,4122.3×\times×
m8g.2xlargearm64gp3-baseline83281,451 ±0.7%\pm 0.7\%±0.7%213,807$0.3810~$2780.391.752.1310,1812,5452.5×\times×
c8i.largex86-64gp3-max2453,444 ±0.4%\pm 0.4\%±0.4%211,563$0.2526~$1840.602.172.8326,72213,3611.6×\times×
c8i.xlargex86-64gp3-max4869,067 ±0.2%\pm 0.2\%±0.2%199,429$0.3463~$2530.461.852.3017,2678,6332.1×\times×
m8g.xlargearm64gp3-max41667,428 ±0.2%\pm 0.2\%±0.2%199,242$0.3384~$2470.471.862.3016,8574,2142.0×\times×
r8g.xlargearm64gp3-max43269,292 ±0.2%\pm 0.2\%±0.2%188,322$0.3679~$2690.461.872.3617,3232,1652.1×\times×
m5.xlargex86-64gp3-baseline41639,959 ±0.7%\pm 0.7\%±0.7%186,794$0.2139~$1560.802.222.689,9902,4971.2×\times×
m7g.xlargearm64gp3-max41657,738 ±0.1%\pm 0.1\%±0.1%179,252$0.3221~$2350.552.002.4814,4343,6091.7×\times×
m7g.mediumarm64gp3-baseline1410,986 ±0.1%\pm 0.1\%±0.1%175,171$0.0627~$462.914.765.8310,9862,7470.3×\times×
m7i.2xlargex86-64gp3-baseline83273,190 ±0.5%\pm 0.5\%±0.5%172,163$0.4251~$3100.441.802.189,1492,2872.2×\times×
m5.largex86-64gp3-baseline28