databasepostgresqlcost-optimizationaws

PgBouncer vs RDS Proxy: what connection pooling actually costs

A managed proxy bills per vCPU-hour of the database it fronts. A self-hosted pooler bills as a small container. Both let you run a smaller database instance, which is where the real money is. Here is the arithmetic.

The C3X Team··7 min read

Quick answer

RDS Proxy is billed per vCPU of the database instance it fronts, at $0.015 per vCPU-hour in us-east-1, with a minimum of 2 vCPUs charged. Fronting a 2-vCPU db.m5.large costs 2 x $0.015 x 730 = about $21.90 per month; fronting a 16-vCPU db.m5.4xlarge costs about $175 per month. PgBouncer self-hosted on a t4g.small container costs roughly $12 per month plus your operational time. The decision rarely turns on the proxy fee itself: pooling lets you drop one or two instance sizes, and a step down from db.m5.2xlarge ($0.712/hr) to db.m5.xlarge ($0.356/hr) saves about $260 per month, which dwarfs either proxy bill.

Connection pooling is usually sold as a reliability feature: it stops a bursty application from exhausting the database's connection slots. That framing hides the more interesting story. Every idle PostgreSQL connection holds a backend process and its share of work_mem, so a database sized to survive 800 concurrent connections is a database sized mostly for connection overhead, not for query work. Pooling lets you buy the smaller instance, and the smaller instance is where the savings live.

What each option bills

OptionBilling modelMonthly cost example
RDS Proxy on db.m5.large (2 vCPU)$0.015 per vCPU-hour, 2 vCPU minimumabout $21.90
RDS Proxy on db.m5.2xlarge (8 vCPU)$0.015 per vCPU-hourabout $87.60
RDS Proxy on db.m5.4xlarge (16 vCPU)$0.015 per vCPU-hourabout $175.20
PgBouncer on t4g.small (2 vCPU, 2 GB)$0.0168 per hourabout $12.26
PgBouncer as a sidecar in an existing clusterMarginal CPU and memorynear zero incremental

Note the shape of the RDS Proxy meter: it scales with the size of the database, not with the traffic through the proxy. That is counterintuitive but important. If you succeed at pooling and shrink the database, the proxy bill shrinks with it. If you keep the database oversized, you pay the proxy fee on top of the waste you were trying to eliminate.

The saving that matters is the instance step-down

Memory is the binding constraint for a connection-heavy PostgreSQL workload. A conservative planning figure is 5 to 10 MB of resident memory per idle connection once you include the backend process, catalog caches, and per-connection buffers. At 600 connections that is 3 to 6 GB doing nothing but holding sockets open, before a single query runs. Add work_mem allocated per sort or hash node and the number climbs.

Pool those 600 client connections down to 40 server connections and the memory pressure largely disappears. That is what lets a team move from a db.m5.2xlarge (8 vCPU, 32 GB, $0.712 per hour on-demand in us-east-1, roughly $520 per month) to a db.m5.xlarge (4 vCPU, 16 GB, $0.356 per hour, roughly $260 per month). The step-down saves about $260 per month. Against that, the RDS Proxy fee on the smaller instance is 4 x $0.015 x 730, about $43.80. Net saving: roughly $216 per month on a single database, before any reserved-instance discount compounds it.

Where the two options genuinely differ

RDS Proxy is multi-AZ by default, handles IAM authentication and Secrets Manager rotation, and preserves connections across a failover, which can cut failover-visible downtime meaningfully. You pay for that in the vCPU-hour meter and in a small added latency hop. PgBouncer is faster and cheaper but it is now a component you own: you size it, monitor it, patch it, and make it highly available yourself. Running one PgBouncer instance in front of a multi-AZ database quietly converts your highly available database into a single-point-of-failure architecture, which is a cost you only discover during an incident.

There is also a functional difference that affects cost indirectly. PgBouncer in transaction pooling mode gives the highest connection multiplexing ratio but forbids session-level features such as prepared statements held across transactions, advisory locks, and temporary tables. If your ORM depends on those, you end up in session pooling mode, where the multiplexing ratio collapses toward 1:1 and the instance step-down you were counting on never materializes. Verify the mode your application can actually tolerate before you write the saving into a budget.

A worked comparison

Line itemNo poolingRDS ProxyPgBouncer
Instancedb.m5.2xlarge, $520db.m5.xlarge, $260db.m5.xlarge, $260
Proxy$0$43.80$12.26
Operational burdennonenonepatching, HA, monitoring
Monthly totalabout $520about $304about $272

The $32 monthly gap between the two pooling options is not a serious decision input for most teams. The $216 gap between pooling and not pooling is. Pick the proxy that fits your operational appetite, then spend the effort on actually shrinking the instance, because a proxy you deploy without resizing the database is pure added cost.

Serverless changes the arithmetic

On Aurora Serverless v2, RDS Proxy bills a minimum of 8 vCPUs regardless of how small the cluster scales, which is 8 x $0.015 x 730, about $87.60 per month. If your serverless cluster floors at 0.5 ACU (about $43.80 per month at $0.12 per ACU-hour), the proxy costs twice the database. In that configuration a self-hosted pooler, or the built-in pooling in your application framework, is usually the better call.

Price the database and the proxy together from Terraform before you merge, because the two meters move in opposite directions and only the combined number tells you whether pooling paid. Compare instance families and proxy configurations against the resource catalog, and read the broader connection pooling cost picture for context.

FAQ

How is RDS Proxy priced?

Per vCPU-hour of the database instance it fronts, at $0.015 per vCPU-hour in us-east-1, with a minimum of 2 vCPUs billed for provisioned instances and 8 vCPUs for Aurora Serverless v2. A 2-vCPU db.m5.large costs about $21.90 per month to front, an 8-vCPU db.m5.2xlarge about $87.60, and a 16-vCPU db.m5.4xlarge about $175.20. Note the meter scales with database size, not with traffic through the proxy.

Is PgBouncer cheaper than RDS Proxy?

In direct fees, yes. PgBouncer on a t4g.small costs about $12.26 per month versus $43.80 for RDS Proxy fronting a 4-vCPU instance, and as a sidecar in an existing cluster the incremental cost is near zero. But PgBouncer is a component you own: you size, patch, monitor, and make it highly available yourself. A single PgBouncer in front of a multi-AZ database reintroduces a single point of failure.

How much does connection pooling actually save?

The saving comes from the instance step-down, not the proxy fee. Idle PostgreSQL connections consume roughly 5 to 10 MB each, so 600 connections hold 3 to 6 GB before any query runs. Pooling to 40 server connections can let you move from db.m5.2xlarge (about $520 per month) to db.m5.xlarge (about $260), saving about $260 per month against a $44 proxy fee.

Does transaction pooling break applications?

It can. Transaction pooling gives the highest multiplexing ratio but forbids session-level features such as prepared statements held across transactions, advisory locks, and session-scoped temporary tables. If your ORM depends on those, you fall back to session pooling, where the multiplexing ratio approaches 1:1 and the instance step-down never materializes. Verify the mode your application tolerates before budgeting the saving.

Should I use RDS Proxy with Aurora Serverless v2?

Usually not on cost grounds. RDS Proxy bills a minimum of 8 vCPUs on Aurora Serverless v2, about $87.60 per month, regardless of how far the cluster scales down. If the cluster floors at 0.5 ACU (about $43.80 per month at $0.12 per ACU-hour) the proxy costs roughly twice the database. A self-hosted pooler or framework-level pooling is generally the better fit there.

How does C3X help with connection pooling cost?

C3X prices your database instance and proxy together from Terraform before you merge, which matters because the two meters move in opposite directions: a smaller instance shrinks both the instance bill and the RDS Proxy bill. Seeing the combined figure in the pull request tells you whether pooling actually paid, rather than discovering after deployment that you added a proxy fee without resizing the database.

What to do next

See what pooling saves before you deploy it. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.