public inbox for [email protected]  
help / color / mirror / Atom feed
From: Roberto Mello <[email protected]>
To: PostgreSQL Developers <[email protected]>
Subject: [DOC] Add detail regarding resource consumption wrt max_connections
Date: Mon, 13 Nov 2023 14:40:08 -0700
Message-ID: <CAKz==bJBCWrvN77fmuZ2XqD3jazWEb=E80AA4Yv9C9tQ61YDdQ@mail.gmail.com> (raw)

The documentation for max_connections does not mention that just by having
a higher value for max_connections, PostgreSQL will use more resources.

While working with different customers, I noticed that several of them set
max_connections to very high numbers, even though they never expected to
actually have that many connections to their PostgreSQL instance.

In one extreme case, the user set max_connections to 200000 and was
befuddled that the instance was using more memory than another with the
same number of connections.

This patch adds language to the documentation pointing to the fact that
higher value of max_connections leads to higher consumption of resources by
Postgres, adding one paragraph to doc/src/sgml/config.sgml

       <para>
        PostgreSQL sizes certain resources based directly on the value of
        <varname>max_connections</varname>. Increasing its value leads to
        higher allocation of those resources, including shared memory.
       </para>

Sincerely,

Roberto Mello


Attachments:

  [application/octet-stream] max-connections-guc-detail.patch (683B, ../CAKz==bJBCWrvN77fmuZ2XqD3jazWEb=E80AA4Yv9C9tQ61YDdQ@mail.gmail.com/3-max-connections-guc-detail.patch)
  download | inline diff:
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index bd70ff2e4b..c3e40a548e 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -705,6 +705,12 @@ include_dir 'conf.d'
         only be set at server start.
        </para>
 
+       <para>
+        PostgreSQL sizes certain resources based directly on the value of
+        <varname>max_connections</varname>. Increasing its value leads to
+        higher allocation of those resources, including shared memory.
+       </para>
+
        <para>
         When running a standby server, you must set this parameter to the
         same or higher value than on the primary server. Otherwise, queries


view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: [DOC] Add detail regarding resource consumption wrt max_connections
  In-Reply-To: <CAKz==bJBCWrvN77fmuZ2XqD3jazWEb=E80AA4Yv9C9tQ61YDdQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox