Re: [DOC] Add detail regarding resource consumption wrt max_connections

Cary Huang <cary.huang@highgo.ca>

From: Cary Huang <cary.huang@highgo.ca>
To: pgsql-hackers@lists.postgresql.org
Cc: Roberto Mello <roberto.mello@gmail.com>
Date: 2024-01-12T22:14:38Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Document that increasing max_connections uses more resources.

The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       tested, passed
Spec compliant:           tested, passed
Documentation:            tested, passed

I think it is good to warn the user about the increased allocation of memory for certain parameters so that they do not abuse it by setting it to a huge number without knowing the consequences.

It is true that max_connections can increase the size of proc array and other resources, which are allocated in the shared buffer, which also means less shared buffer to perform regular data operations. I am sure this is not the only parameter that affects the memory allocation. "max_prepared_xacts" can also affect the shared memory allocation too so the same warning message applies here as well. Maybe there are other parameters with similar effects. 

Instead of stating that higher max_connections results in higher allocation, It may be better to tell the user that if the value needs to be set much higher, consider increasing the "shared_buffers" setting as well.

thank you

-----------------------
Cary Huang
Highgo Software Canada
www.highgo.ca