I'm trying to create a parameter group in Amazon Web Services for an Postgres 9.5 RDS instance. I'm a little confused by the units being used for things such as shared_buffers
and min_wal_size
. Typically these would be specified in postgresql.conf
with units, like 4GB
or 128kB
. If I enter the same in AWS I get an error that the value I specified was invalid, but strictly numeric values seem to be fine. Does anyone know what units these parameters are expecting?
2 Answers
Amazon RDS documentation provides a table of units for each parameter under the "Working with PostgreSQL Parameters" topic. Units are also usually included in the description of each parameter in the parameter group edit UI from the Amazon RDS web console.
min_wal_size (Postgres 9.5 Parameter Group Family)
- Default:
16
- Units:
MB
- Allowed Values: 2-201326592
- Description: (16MB) Sets the minimum size to shrink the WAL to.
shared_buffers (Postgres 9.5 Parameter Group Family)
- Default:
{DBInstanceClassMemory/32768}
- Units:
8kB
- Allowed Values: 16-1073741823
- Description: (8kB) Sets the number of shared memory buffers used by the server.
Regarding shared_buffers
specifically, the documentation has this to say:
Note that some parameters use units that you might not be familiar with; for example, shared_buffers sets the number of 8 KB shared memory buffers used by the server.
Anthony's answer explains pretty well how RDS use those parameters. I just would like to add more comments to it.
You should follow table of contents for RDS.
The units may be seemed little bit weird to you if you compare it with postgresql.conf
units. I just want to give an example;
Let's say you want to set shared_buffers
to 1GB.
The unit of the shared_buffers
in RDS is 8KB
. Which means you should put n
numbers of 8kb
to make it 1 GB
.
Which means; 1 GB -> 1024 MB -> 1048576 KB
.
So you should set the value to 1048576 KB / 8 KB
which is 131072
So the value should be 131072
in RDS parameter groups.
I hope it helps.
-
-
@RDFozz you are totally right. I just wanted to show how it needs to be set. Commented Mar 29, 2018 at 11:11
-
be especially weary of
max_wal_size
andmin_wal_size
. Their units change with pgv10. Commented Aug 2, 2021 at 7:46