pgsql fails to start due to shared buffer setting greater than kernel allows
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Won't Fix
|
Medium
|
Andy Whitcroft | ||
Jaunty |
Won't Fix
|
High
|
Unassigned | ||
postgresql-8.3 (Ubuntu) |
Won't Fix
|
High
|
Unassigned | ||
Jaunty |
Won't Fix
|
Undecided
|
Unassigned | ||
postgresql-9.1 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Jaunty |
Invalid
|
Undecided
|
Unassigned | ||
postgresql-common (Ubuntu) |
Invalid
|
High
|
Unassigned | ||
Jaunty |
Invalid
|
High
|
Unassigned |
Bug Description
Binary package hint: postgresql-8.3
Freshly installed pgsql 8.3 on hardy got me this error when restarting:
2008-09-03 09:16:39 EDT DETAIL: Failed system call was shmget(key=5432001, size=38207488, 03600).
2008-09-03 09:16:39 EDT 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 38207488 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 103).
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.
Checking the kernel settings:
sudo sysctl -a | grep -i shm
kernel.shmmax = 33554432
kernel.shmall = 2097152
kernel.shmmni = 4096
The shared_buffers setting defaults to 32MB. I changed this down to 25MB to test and then the server would start right up.
Changed in postgresql-common: | |
assignee: | nobody → pitti |
importance: | Medium → High |
status: | Confirmed → Triaged |
Changed in postgresql-8.3 (Ubuntu): | |
status: | New → Confirmed |
Changed in postgresql-8.3 (Ubuntu): | |
importance: | Undecided → High |
Changed in linux (Ubuntu): | |
assignee: | Colin King (colin-king) → Canonical Kernel Team (canonical-kernel-team) |
Changed in postgresql-8.3 (Ubuntu): | |
assignee: | Martin Pitt (pitti) → nobody |
Changed in postgresql-8.4 (Ubuntu Jaunty): | |
status: | New → Invalid |
Changed in postgresql-8.4 (Ubuntu): | |
status: | New → Confirmed |
Changed in postgresql-8.3 (Ubuntu): | |
status: | Confirmed → Won't Fix |
affects: | postgresql-8.4 (Ubuntu) → postgresql-9.1 (Ubuntu) |
This happens for me too in Intrepid on AMD64, except pgsql attempts to allocate 40MB while the shmax setting is still 32MB.
2008-11-02 00:31:09 GMT FATAL: could not create shared memory segment: Invalid argument
2008-11-02 00:31:09 GMT DETAIL: Failed system call was shmget(key=5432001, size=39288832, 03600).
2008-11-02 00:31:09 GMT 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 39288832 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 103).
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.