Softwr

Cloud · head to head

Google Cloud Run vs PgBouncer

Google Cloud Run logo

Google Cloud Run

Cloud

Managed platform for running containers and functions on Google Cloud

From
On request
Free plan
No
PgBouncer logo

PgBouncer

Databases

Lightweight open-source connection pooler for PostgreSQL

From
Free
Free plan
Yes

The short version

  • PgBouncer is an open-source connection pooler.
  • PgBouncer is free; Google Cloud Run prices on request.
  • Only Google Cloud Run lists deploy any container image; only PgBouncer lists session pooling.
  • Where Google Cloud Run falls short: runs only on Google Cloud, so there is no self-hosted option.
  • Where PgBouncer falls short: works with PostgreSQL only; it cannot pool connections for other database engines.

How do Google Cloud Run and PgBouncer differ?

Google Cloud Run and PgBouncer differ on starting price (On request against Free), pricing model (Usage-based against Open-source) and free tier (No against Yes). Only the attributes on which Google Cloud Run and PgBouncer actually diverge.

Attributes where Google Cloud Run and PgBouncer differ
AttributeGoogle Cloud RunPgBouncer
Starting priceOn requestFree
Pricing modelUsage-basedOpen-source
Free tierNoYes
PlatformsWebLinux, macOS, Windows
CategoryCloudDatabases

Which features does each one have?

They share no listed features; 9 appear only for Google Cloud Run and 9 only for PgBouncer. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in Google Cloud Run

  • Deploy any container image
  • Source-based builds for common languages
  • Services with automatic scaling and scale to zero
  • Jobs for scheduled or manual tasks
  • Worker pools for background processing
  • Traffic splitting and rollback between revisions
  • Custom domains and managed TLS
  • Request-based and instance-based billing

Only in PgBouncer

  • Session pooling
  • Transaction pooling
  • Statement pooling
  • Low memory use per connection
  • Online reconfiguration of most settings
  • Online restart and upgrade without dropping clients
  • Backends on different hosts
  • TLS support via OpenSSL

What is each one used for?

Google Cloud Run is most often brought in for hosting web APIs and microservices; PgBouncer for reducing open connections to a busy PostgreSQL server. The jobs each tool is most often brought in to do.

Google Cloud Run

  • Hosting web APIs and microservicesnot PgBouncer
  • Scheduled batch jobsnot PgBouncer
  • Queue consumers on worker poolsnot PgBouncer
  • Deploying containers without managing clustersnot PgBouncer
  • Event-driven backends with Pub/Subnot PgBouncer

PgBouncer

  • Reducing open connections to a busy PostgreSQL servernot Google Cloud Run
  • Pooling connections from serverless or short-lived application processesnot Google Cloud Run
  • Fronting databases spread across several hostsnot Google Cloud Run
  • Rolling upgrades without dropping client connectionsnot Google Cloud Run

Where do Google Cloud Run and PgBouncer fall short?

Google Cloud Run's most cited limit: runs only on Google Cloud, so there is no self-hosted option. PgBouncer's: works with PostgreSQL only; it cannot pool connections for other database engines. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

Google Cloud Run

  • Runs only on Google Cloud, so there is no self-hosted option
  • The container file system is in memory and not persistent
  • Worker pools do not autoscale natively and need at least one instance
  • Services are stateless, so state needs external storage

PgBouncer

  • Works with PostgreSQL only; it cannot pool connections for other database engines
  • Transaction pooling disables session features such as LISTEN, SET/RESET and session-level advisory locks
  • Windows support is limited to MinGW builds; Cygwin and Visual toolchains are not supported
  • Configured through files and an admin console, with no built-in graphical interface
  • Does not provide failover, replication management or read-replica load balancing

How much do Google Cloud Run and PgBouncer cost?

PgBouncer is free to use. Plan by plan below, from each vendor's own pricing page.

Google Cloud Run

On request

No published plan breakdown. See the Google Cloud Run review.

PgBouncer

Free

No published plan breakdown. See the PgBouncer review.

Which should you pick?

Choose Google Cloud Run if

  • You need deploy any container image.
  • You also want source-based builds for common languages.

Choose PgBouncer if

  • You need session pooling.
  • You want to start without paying.
  • You work on Linux, macOS, Windows.
  • You also want transaction pooling.

Questions people ask

Is Google Cloud Run or PgBouncer better?
It depends on the job. Google Cloud Run fits hosting web APIs and microservices; PgBouncer fits reducing open connections to a busy PostgreSQL server. Google Cloud Run starts at On request and PgBouncer at Free.
Which is cheaper, Google Cloud Run or PgBouncer?
PgBouncer has a free tier; the other does not. Paid plans start at On request for Google Cloud Run and Free for PgBouncer.
Does Google Cloud Run or PgBouncer run on more platforms?
Google Cloud Run runs on Web. PgBouncer runs on Linux, macOS, Windows.
Can I use PgBouncer for free?
Yes. PgBouncer has a free tier, so you can try it without paying. Google Cloud Run starts at On request.
What is Google Cloud Run best used for?
Google Cloud Run is most often used for hosting web apis and microservices, scheduled batch jobs, queue consumers on worker pools, deploying containers without managing clusters. Of those, hosting web apis and microservices and scheduled batch jobs are not what PgBouncer is typically brought in for.
What can Google Cloud Run do that PgBouncer cannot?
Google Cloud Run covers Deploy any container image, Source-based builds for common languages, Services with automatic scaling and scale to zero, Jobs for scheduled or manual tasks. PgBouncer covers Session pooling, Transaction pooling, Statement pooling, Low memory use per connection.

Answered from the vendors’ own pages

Google Cloud Run: What can Cloud Run run?

Any container image, or source code for Go, Node.js, Python, Java.NET and Ruby that Google builds into a container.

Source
PgBouncer: What is PgBouncer used for?

PgBouncer is a lightweight connection pooler for PostgreSQL. It lets many client connections share fewer server connections, which lowers the load of holding many connections open.

Source
Google Cloud Run: How is Cloud Run billed?

Allocated CPU and memory are billed in 100 millisecond granularity, in request-based or instance-based mode. A free tier is available.

Source
PgBouncer: What pooling modes does PgBouncer support?

It supports session, transaction and statement pooling. Session pooling supports all PostgreSQL features, while transaction and statement pooling restrict some session-based features.

Source
Google Cloud Run: Can Cloud Run scale to zero?

Yes. Services scale to zero when idle unless a minimum number of instances is set.

Source
PgBouncer: Does PgBouncer run on Windows?

The project's build instructions support Windows only through MinGW. It states that Cygwin and Visual toolchains are not supported, and that LDAP is not supported on Windows.

Source
PgBouncer: What do I need to build PgBouncer from source?

The README lists a C11-capable compiler, Libevent 2.0 or newer, pkg-config and, for TLS, OpenSSL 1.0.1 or newer. Optional components include c-ares, LDAP libraries and PAM libraries.

Source
Share

Related pages

Other head to heads