a9s PostgreSQL Resources Considerations

This document describes concerns and limitations to be considered when allocating resources for your a9s PostgreSQL plans.

Max Connections

a9s PostgreSQL allows the user to specify the number of supported max_connections. However, this configuration depends on the amount of memory and file descriptors. Each connection allocates a buffer for itself (work_mem) in a way that the total amount of consumed memory is number_of_connections * work_mem, the sum of this should not go over the shared_buffer too much on the penalty of performance degradation when the number of connection increases.

By default, the a9s PostgreSQL overcommit this value, considering that on average, connections do not execute big queries that could use up all the work_mem, our default configuration considers that only half of the reserved work_mem is used per connection on average.

In any case, the bigger the number of connections, the less performant your queries will be, and more memory will be needed to improve performance.

It is also important to notice that each connection uses at least one file descriptor. Currently, a9s PostgreSQL instances use a maximum of 1024 open file descriptors, if a higher number of files are open, the a9s PostgreSQL instance will present unpredictable behavior.

Replication Slots

a9s PostgreSQL clusters use replications slots to achieve replication stream between the primary and the standby nodes. When a standby node is down for any reason, the primary node will not recycle WAL files, and this will increase the persistent disk storage usage. Consider this when allocating the persistent disks for the a9s PostgreSQL service plans.

If a standby node is down or in a network partition and the storage is growing, you can delete the replication slot, and manually execute clean up on the standby before starting it again.

Note: this also means that if a standby node is down for too long, double of the written data may be occupying the persistent disk. Keep also in mind that when a9s-parachute detects that 80% (default) of the persistent disk storage is used, all processes will shut down, leaving your cluster in an unhealthy state.