Skip to content

Commit

Permalink
docs: Improve postgreSQL setup (#9594)
Browse files Browse the repository at this point in the history
  • Loading branch information
tara-det-ai authored Jul 1, 2024
1 parent 462ed58 commit 8a47454
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/setup-cluster/checklists/_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ About Offline Installations
Set Up PostgreSQL
*******************

Determined uses a PostgreSQL database to store experiment and trial metadata. Choose the
installation method that best fits your environment and requirements.
Determined uses a :ref:`PostgreSQL <setup-postgresql>` database to store experiment and trial
metadata. Choose the installation method that best fits your environment and requirements.

.. note::

Expand Down
46 changes: 46 additions & 0 deletions docs/setup-cluster/checklists/postgresql-setup-guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. _postgresql-database-tuning:

############################
PostgreSQL Database Tuning
############################

When setting up PostgreSQL for your deployment, it's crucial to configure several key parameters to
ensure optimal performance. Below are the most important settings to consider:

#. **max_connections**: Ensure ``max_connections`` is set to at least 96.
#. **shared_buffers**: Set ``shared_buffers`` to approximately 25% of total system memory, adjust
based on system workloads.
#. **max_wal_size and min_wal_size**: Adjust ``max_wal_size`` and ``min_wal_size`` according to your
usage patterns for improved performance.

For more details, visit the relevant section below.

*****************
max_connections
*****************

``max_connections`` is the most important and universal parameter to adjust. We recommend confirming
that ``max_connections`` is set to at least 96. This setting ensures that your database can handle
the number of concurrent connections required for Determined.

****************
shared_buffers
****************

The ``shared_buffers`` setting determines how much memory PostgreSQL uses for caching data. It is
generally recommended to set this to around 25% of your system's total memory. However, you should
adjust this based on other workloads running on the same system.

*******************************
max_wal_size and min_wal_size
*******************************

The Write-Ahead Logging (WAL) settings, ``max_wal_size`` and ``min_wal_size``, are more dependent on
your specific usage patterns. Increasing these values can help improve performance for larger
deployments. For detailed information on configuring these settings, please refer to the `WAL
Configuration <https://www.postgresql.org/docs/current/wal-configuration.html>`__ page or the
`PostgreSQL Runtime Configuration
<https://www.postgresql.org/docs/current/runtime-config-resource.html>`__ page.

Properly configuring these settings will help you achieve optimal performance and reliability with
your PostgreSQL deployment.
3 changes: 2 additions & 1 deletion docs/setup-cluster/checklists/postgresql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Determined uses a PostgreSQL database to store experiment and trial metadata.
.. note::

If you are using an existing PostgreSQL installation, we recommend confirming that
``max_connections`` is at least 96, which is sufficient for Determined.
``max_connections`` is at least 96, which is sufficient for Determined. See: :ref:`Max
Connections <postgresql-database-tuning>`.

.. _install-postgres-docker:

Expand Down

0 comments on commit 8a47454

Please sign in to comment.