We have postgres 9.1 running on Ubuntu box. The postgres db size is 155GB and it has about 13200 tables. The Ubuntu box has 120GB RAM. The Ubuntu box is a docker container.
When an attempt to backup the db was made, it failed saying:
pg_dump: WARNING: out of shared memory
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: out of shared memory
HINT: You might need to increase max_locks_per_transaction.
So we increased the value of max_locks_per_transaction
to 1024 in postgresql.conf
, but postgres wouldn't start.
root@abc:# /etc/init.d/postgresql restart
* Restarting PostgreSQL 9.1 database server
* The PostgreSQL server failed to start. Please check the log output:
2018-02-04 03:27:22 UTC FATAL: could not create shared memory segment: Invalid argument
2018-02-04 03:27:22 UTC DETAIL: Failed system call was shmget(key=5432001, size=70123520, 03600).
2018-02-04 03:27:22 UTC HINT: This error usually means that PostgreSQL's request for a shared memory
segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure
the kernel with larger SHMMAX. To reduce the request size (currently 70123520 bytes), reduce PostgreSQL's
shared memory usage, perhaps by reducing shared_buffers or max_connections. If the request size is
already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising
the request size or reconfiguring SHMMIN is called for. The PostgreSQL documentation contains more information
about shared memory configuration.
So when we attempted to change the value of SHMMAX
, it failed:
# echo 1134217728 >/proc/sys/kernel/shmmax
bash: /proc/sys/kernel/shmmax: Read-only file system
Any idea what's wrong and how to go about it?