postgresql-k8s

Charmed PostgreSQL K8s

Channel Revision Published Runs on
latest/stable 20 20 Sep 2022
Ubuntu 20.04
14/stable 495 18 Feb 2025
Ubuntu 22.04
14/stable 494 18 Feb 2025
Ubuntu 22.04
14/candidate 495 11 Feb 2025
Ubuntu 22.04
14/candidate 494 11 Feb 2025
Ubuntu 22.04
14/beta 495 06 Feb 2025
Ubuntu 22.04
14/beta 494 06 Feb 2025
Ubuntu 22.04
14/edge 508 Today
Ubuntu 22.04
14/edge 507 Today
Ubuntu 22.04
16/edge 496 06 Feb 2025
Ubuntu 24.04
juju deploy postgresql-k8s --channel 14/stable
Show information

Platform:

Performance and resource allocation

This page covers topics related to measuring and configuring the performance of PostgreSQL

Performance testing

For performance testing and benchmarking charms, we recommend using the Charmed Sysbench operator. This is a tool for benchmarking database applications that includes monitoring and CPU/RAM/IO performance measurement.

Resource allocation

Charmed PostgreSQL K8s resource allocation can be controlled via the charm’s profile config option. There are two profiles: production and testing.

Value Description Tech details
production
(default)
Maximum performance 25% of the available memory for shared_buffers and the remain as cache memory (defaults mimic legacy charm behavior).
The max_connections=max(4 * os.cpu_count(), 100).
Use pgbouncer if max_connections are not enough (reasoning).
testing Minimal resource usage PostgreSQL 14 defaults.

Note: Pre-deployed application profile change is planned but currently is NOT supported.

You can set the profile during deployment using the --config flag. For example:

juju deploy postgresql-k8s --trust --config profile=testing

You can change the profile using the juju config action. For example:

juju config postgresql-k8s profile=production

For a list of all of this charm’s config options, see the Configuration tab.

Juju constraints

The Juju --constraints flag sets RAM and CPU limits for Kubernetes pods:

juju deploy postgresql-k8s --trust --constraints cores=8 mem=16G

Juju constraints can be set together with the charm’s profile:

juju deploy postgresql-k8s --trust --constraints cores=8 mem=16G --config profile=testing

Help improve this document in the forum (guidelines). Last updated 8 months ago.