Re: Why PostgreSQL doesn't start with shared_buffers=6GB ?

2012-11-06 Thread Shane Ambler

On 05/11/2012 11:24, Yuri wrote:

When I am setting shared_buffers=6GB in postgresql.conf it fails to start:
DETAIL:  Failed system call was shmget(key=5432001, size=6612361216, 03600).
even though kern.ipc.shmmax is set to ~7GB:
$ sysctl -a | grep shm
kern.ipc.shm_allow_removed: 0
kern.ipc.shm_use_phys: 0
kern.ipc.shmall: 1310720
kern.ipc.shmseg: 128
kern.ipc.shmmni: 192
kern.ipc.shmmin: 1
kern.ipc.shmmax: 70
kern.features.sysv_shm: 1
kern.features.posix_shm: 1

There are 17GB free memory as reported by top(1).

Why shmget fails despite kern.ipc.shmmax is being high enough?
Experimentally I found that shared_buffers=5GB also fails but 4GB
succeeds. Is there another system limit on shmem besides kern.ipc.shmmax ?


Been a few years since I looked at my postgresql settings --

Per process --
kern.ipc.shmmax: Maximum shared memory segment size
kern.ipc.shmseg: Number of segments per process

segments relate to allocation requests not total allocations.
eg 4 segments of 2G would be ok but 1 segment of 8G not ok
Postgresql shared_buffers should be done in 1 allocation.

System wide --
kern.ipc.shmall: Maximum number of pages available for shared memory
kern.ipc.shmmni: Number of shared memory identifiers

kern.ipc.shmseg and kern.ipc.shmmni need to be set in /boot/loader.conf
not /etc/sysctl.conf

getconf PAGE_SIZE returns 4096

With a pagesize of 4K your kern.ipc.shmall would equate to a max of 5G
so you probably need to increase that. If you want postgresql to
allocate 6G then shmmax needs to be at least 6G and shmall needs to
be at least 6G/4K or 1572864

Remember that total shared memory allocation is not postgresql only -
you may need it higher than what postgresql needs.

Also of note - postgresql settings like temp_buffers are per client
connection and work_mem can be allocated several times for one query.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Why PostgreSQL doesn't start with shared_buffers=6GB ?

2012-11-05 Thread Frank Broniewski

Hi,

I'm running Postgresql 9.1 on FreeBSD 9.0 with the following settings:

# postgresql.conf
shared_buffers = 8GB # pgtune wizard 2012-04-04

# /boot/loader.conf
kern.ipc.semmni=256
kern.ipc.semmns=512
kern.ipc.semmnu=256
kern.ipc.semumr=200
vm.pmap.shpgperproc=400
vm.pmap.pv_entry_max=50331648

# sysctl -a
kern.ipc.shm_allow_removed: 0
kern.ipc.shm_use_phys: 1
kern.ipc.shmall: 4189816
kern.ipc.shmseg: 128
kern.ipc.shmmni: 192
kern.ipc.shmmin: 1
kern.ipc.shmmax: 17161486336
kern.features.sysv_shm: 1
kern.features.posix_shm: 1


I hope that helps a little bit with value tuning,

Frank


Am 2012-11-05 01:54, schrieb Yuri:

When I am setting shared_buffers=6GB in postgresql.conf it fails to start:
DETAIL:  Failed system call was shmget(key=5432001, size=6612361216,
03600).
even though kern.ipc.shmmax is set to ~7GB:
$ sysctl -a | grep shm
kern.ipc.shm_allow_removed: 0
kern.ipc.shm_use_phys: 0
kern.ipc.shmall: 1310720
kern.ipc.shmseg: 128
kern.ipc.shmmni: 192
kern.ipc.shmmin: 1
kern.ipc.shmmax: 70
kern.features.sysv_shm: 1
kern.features.posix_shm: 1

There are 17GB free memory as reported by top(1).

Why shmget fails despite kern.ipc.shmmax is being high enough?
Experimentally I found that shared_buffers=5GB also fails but 4GB
succeeds. Is there another system limit on shmem besides kern.ipc.shmmax ?

9.1-RC3 and64

Yuri
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
freebsd-questions-unsubscr...@freebsd.org




--
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Why PostgreSQL doesn't start with shared_buffers=6GB ?

2012-11-04 Thread Yuri

When I am setting shared_buffers=6GB in postgresql.conf it fails to start:
DETAIL:  Failed system call was shmget(key=5432001, size=6612361216, 03600).
even though kern.ipc.shmmax is set to ~7GB:
$ sysctl -a | grep shm
kern.ipc.shm_allow_removed: 0
kern.ipc.shm_use_phys: 0
kern.ipc.shmall: 1310720
kern.ipc.shmseg: 128
kern.ipc.shmmni: 192
kern.ipc.shmmin: 1
kern.ipc.shmmax: 70
kern.features.sysv_shm: 1
kern.features.posix_shm: 1

There are 17GB free memory as reported by top(1).

Why shmget fails despite kern.ipc.shmmax is being high enough?
Experimentally I found that shared_buffers=5GB also fails but 4GB 
succeeds. Is there another system limit on shmem besides kern.ipc.shmmax ?


9.1-RC3 and64

Yuri
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org