PostgreSQL – Shared Memory and Sessions Configuration

atlassianconfigurationmemorypostgresqlshared-buffers

I have a standalone server which is running Jira and PostgreSQL 9.6. I have noticed that PostgreSQL has shared_buffers parameter is equal 128MB where RAM is 32GB. Because server is shared with application Jira then there is 16GB left for other usage (including postgres, httpd).
According to PostgreSQL documentation size of the shared_buffers should be 25% of RAM. It could be 16GB * 0,25 = 6,5GB.
Unfortunately I have doubts because application jira is using 20 connection sessions to PostgreSQL server. So I afraid that when I increase shared_buffers it will multiply it by 20 usage of entire memory.

Is it true:

approx. all memory consumed by postgres = shared_buffers*sessions

What will you suggest to do with shared_buffers parameter?

enter image description here

Best Answer

Yes, shared_buffer is not allocated per-session or per-user. It is shared amoung all sessions, and it is allocated only once. When parameter is not shared, it is clearly stated, i.e., on page https://www.postgresql.org/docs/9.6/runtime-config-resource.html you may see that on parameter temp_buffers description, it is stated that they are "temporary buffers used by each database session".