Re: Can I have a look at your TuningWizard generated config file? - Mailing list pgsql-general

From Jennifer Trey
Subject Re: Can I have a look at your TuningWizard generated config file?
Date
Msg-id 863606ec0908010648n1bae70a9tcc745ffee4d5a6b0@mail.gmail.com
Whole thread Raw
In response to Re: Can I have a look at your TuningWizard generated config file?  (Greg Smith <gsmith@gregsmith.com>)
Responses Re: Can I have a look at your TuningWizard generated config file?
List pgsql-general
Hmm.. not done quite yet it seems :(

I tried initially to set shared_buffers to 1024MB but I got this message : 

2009-08-01 15:04:46 CESTFATAL:  could not create shared memory segment: Invalid argument
2009-08-01 15:04:46 CESTDETAIL:  Failed system call was shmget(key=5432001, size=1106247680, 03600).
2009-08-01 15:04:46 CESTHINT:  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 1106247680 bytes), reduce PostgreSQL's shared_buffers parameter (currently 131072) and/or its max_connections parameter (currently 153).
        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.

Lowered it to 64MB and same thing happen. Changed to 128kB and the server started. 

Reading on shared_buffers thing on  http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server I can see that this seems to be something expected, but I am confused on how to fix this ... 

sysctl -a | grep -i shm
error: permission denied on key 'net.ipv4.route.flush'
error: permission denied on key 'net.ipv6.route.flush'
kernel.shmmax = 33554432
kernel.shmall = 2097152
kernel.shmmni = 4096
vm.hugetlb_shm_group = 0

I am running Ubuntu Server 9.04 so I am guessing I should be looking under Linux on  http://www.postgresql.org/docs/current/static/kernel-resources.html

I am confused about this part : 
$ sysctl -w kernel.shmmax=134217728
$ sysctl -w kernel.shmall=2097152

In addition these settings can be saved between reboots in /etc/sysctl.conf.

Should I just append that file with two lines : 

kernel.shmmax=10486808576
kernel.shmmall=?? What should be here? Leave it alone? I am thinking I shouldn't include this, only the above one... right?

Thanks in advance / Jen

pgsql-general by date:

Previous
From: Garry Saddington
Date:
Subject: Re: distributing postgresql binaries
Next
From: Isak Hansen
Date:
Subject: Re: MSSQL to PostgreSQL