views:

79

answers:

3

Hi all, I tried to enlarge the value of the "shared_buffers" settings to be larger then a default 24Mb, and the server doesn't starts with other values (I tried some) except of the default one. Just an empty logfile is created. It's a clean installation of the postgresql on the linux server, so all other settings are default. Does anybody know what could be the reason.

+1  A: 

Does it complain about something? Check the logs.

If the only thing you changed was the shared_buffers, then you might have hit the limit of the OS, and in that case it will tell you in the log.

If that is the case, then have a look at http://www.postgresql.org/docs/8.3/interactive/kernel-resources.html#SYSVIPC how to set it to a correct value.

Update:

A lot of other parameters are depending on the shared_buffers, but not the opposite, so there is nothing else that you would have to change as well. However, only because the server have 32GB of RAM doesn't mean that the OS allow you to use it. You have to make sure that the output of sysctl -a | grep kernel.shmmax is higher than the value of what you have set the shared_buffers to.

Does it stop working no matter how little you change the value, or do it work if you just add, say 1MB?

Also, as John is saying, the support for named values were introduced in 8.2, so if you are using a version before that you have to specify it in blocks instead of memory.

Another thing. It might be quite picky about the semantics. So, make sure that you have written MB and not Mb or mb.

It is however strange that you only get an empty log file, try to start the process manually either by doing as John is suggesting, or the easier one pg_ctl start as the user postgres (as long as the silent mode is not enabled, it will still output things to your terminal)

Jimmy Stenke
I've added that the log file is empty. I just get the message that "server starting" and nothing happens.The OS has 32Gb of RAM and enlarging the shared_buffers by number of Megas leads to that problem. Should I change any other setting that should suit the change in the shared_buffers?
jutky
I've commented some things in the John's post.About the sysctl - I probably don't have permissions to run it I get "bash: sysctl: command not found". I don't have a root on the machine, so I'll talk to the system group about it. Thanks for the advices.
jutky
hmm, I am not certain if you still can run it unless you are root, but it should be possible (you can just not set the values). The application should reside in either /sbin or /usr/sbin, so try adding those paths (like /sbin/sysctl -a). Or you can query the /proc directly by doing `cat /proc/sys/kernel/shmmax`
Jimmy Stenke
"more /proc/sys/kernel/shmmax" gave result:33554432, is it in bytes? if so it's 32 Mb, so maybe I can't get to close to that value because there are also other memory allocations and all of them lays in the same chunk.By the way I can run java on that server and give even 20Gb to the heap of the JVM, does it says something?
jutky
Yes, it should be in bytes. I am not certain how the shared memory works, but it could be that you hit that limit. See if your system administrators can raise the limit and then see if it goes better. It should however be per process, so the java server shouldn't matter (unless you run out of total memory, but 12GB should be enough for what you need for Postgres)
Jimmy Stenke
That helped, thanks a lot
jutky
A: 

What version of PostgreSQL is this? I've run into issues using the "Mb" syntax for older version of PostgreSQL (it did not work on 8.1, but it works on 8.3).

I've found that if I manually start the postmaster process, not using the init.d script, I will see error messages printed to the console. Typically you have to su into the postgres account on your machine, the launch the postmaster binary, which on Ubuntu is at /usr/lib/postgresql/8.4/bin/postmaster (change according to your PostgreSQL and distro). My money is that you will see an error related to what Jimmy is describing.

John Paulett
It's 8.3 version.Starting manually gives same result. When I tried to change "MB" to "Mb" I got the error: FATAL: invalid value for parameter "shared_buffers": "48Mb"HINT: Valid units for this parameter are "kB", "MB", and "GB".But when I fixed it back to MB -> same result as previously. So I understand that it reads my settings, it just don't likes them for some reason :( I tried not to specify the units and just to set it to 20000 (it is in blocks of 8Kb so this equal 160Mb) -> same result. I tried to add one Mb at a time and maximum i succeeded was to run it with 26MB.
jutky
+1  A: 

You probably have hit the kernel.shmmax limit. Set it higher with

sysctl -w kernel.shmmax=xxxx

To make this persist between boots, add a kernel.shmmax entry to /etc/sysctl.conf.

ChristopheD