We’re on CentOS release 6.6, PostgreSQL version 8.4.20. (Yes, this is not bleeding edge.)
In postgresql.conf
, we have:
shared_buffers = 4096MB
kernel shm values are set nice and high:
[root@green data]# sysctl -a | grep shm
kernel.shmmax = 15922077696
kernel.shmall = 3887226
kernel.shmmni = 4096
kernel.shm_rmid_forced = 0
We have plenty of memory:
[root@green data]# free
total used free shared buffers cached
Mem: 31097812 30474972 622840 2873672 1961088 20565360
-/+ buffers/cache: 7948524 23149288
Swap: 1959920 93852 1866068
Yet the value for shared_buffers
reported by pg_settings
is only 512MB, not the 4GB set in postgresql.conf
:
postgres=# select name, setting, min_val, max_val, context from
pg_settings where name='shared_buffers';
name | setting | min_val | max_val | context
----------------+---------+---------+------------+------------
shared_buffers | 524288 | 16 | 1073741823 | postmaster
Yes, we’ve done a full restart, and SHOW config_file
confirms that I’ve edited the right postgresql.conf
.
My very great thanks to anyone who can provide insight into this mystery.