Skip site navigation (1) Skip section navigation (2)

Shared memory usage calculations

From: Thom Brown <thombrown(at)gmail(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Shared memory usage calculations
Date: 2009-10-10 12:52:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-docs
I've had a look at the documentation for how much shared memory (in bytes)
Postgres uses:
However, after using these calculations to work out the shared memory usage
for my own setup, the numbers I came up with are clearly wrong.  Here's what
I put my values down as:

max_locks_per_transaction = 64
max_connections = 220
autovacuum_max_workers = 3
max_prepared_transactions = 0
block_size = 8192
shared_buffers = 196000000 (196MB)
wal_block_size = 8192
wal_buffers = 8000000 (8MB)

Using the calculations on that page, it puts my shared memory requirements
up to 1.7 terabytes, but my server is running along fine with these

If I convert the sizes to kilobytes instead of bytes, it shows a total value
of 47 megabytes, which, while not extreme, looks too low.  And I am
surprised that max_connections has relatively little bearing on the shared
memory requirements.  Is this right, or should is it more a case of it
affecting semaphores?  I was under the impression that the maximum number of
connections played a large role in deciding shared memory limits.

My SHMMAX is currently set at 268435456, which I thought was just enough to
cover my config settings.

Is the documentation flawed, or am I using the wrong units?




pgsql-docs by date

Next:From: Tom LaneDate: 2009-10-10 13:57:33
Subject: Re: Shared memory usage calculations
Previous:From: Pavel GolubDate: 2009-09-29 09:01:57
Subject: pg_restore listing

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group