Skip to main content

pgagroal manual · Explanation · upstream 2.1.0

Pipelines

From the upstream pgagroal manual, rendered in the Elevarq documentation style. Single-sourced from the pinned pgagroal release.

\newpage

[pgagroal][pgagroal] supports 3 different pipelines that determine how connections are managed and what features are available.

The pipeline is defined in pgagroal.conf under the setting:

pipeline = auto

When pipeline = auto is used, the performance pipeline is selected by default. [pgagroal][pgagroal] downgrades to the session pipeline at startup when any of the following are configured:

Performance Pipeline

The performance pipeline is the fastest pipeline as it is a minimal implementation of the pipeline architecture.

However, it doesn't support Transport Layer Security (TLS), failover support and the disconnect_client setting.

A DISCARD ALL query is run after each client session.

Configuration

Select the performance pipeline by:

pipeline = performance

Use Cases

The performance pipeline is ideal for:

Limitations

Session Pipeline

The session pipeline supports all features of [pgagroal][pgagroal].

A DISCARD ALL query is run after each client session.

Configuration

Select the session pipeline by:

pipeline = session

Features

The session pipeline supports:

Use Cases

The session pipeline is ideal for:

Transaction Pipeline

The transaction pipeline will release the connection back to the pool after each transaction completes. This feature will support many more clients than there are database connections.

Configuration

Select the transaction pipeline by:

pipeline = transaction

Features

Use Cases

The transaction pipeline is ideal for:

Considerations

Pipeline Comparison

FeaturePerformanceSessionTransaction
SpeedFastestFastModerate
TLS SupportNoYesYes
Failover SupportNoYesYes
Connection ReuseSession-basedSession-basedTransaction-based
Client CapacityLimited by pool sizeLimited by pool sizeHigh
State PreservationSessionSessionNone
ComplexityLowMediumHigh

Choosing the Right Pipeline

Performance Pipeline

Choose when:

Session Pipeline

Choose when:

Transaction Pipeline

Choose when:

Configuration Examples

High-Performance Setup

[pgagroal]
pipeline = performance
max_connections = 100
validation = off

Production Setup with TLS

[pgagroal]
pipeline = session
max_connections = 50
tls = on
tls_cert_file = /path/to/cert.pem
tls_key_file = /path/to/key.pem
failover = on
failover_script = /path/to/failover.sh

High-Concurrency Setup

[pgagroal]
pipeline = transaction
max_connections = 20
# Support many more clients than connections