Re: Estimating total amount of shared memory required by postmaster

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Estimating total amount of shared memory required by postmaster
Date: 2011-06-03 16:46:29
Message-ID: 1307119488-sup-3756@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excerpts from Tom Lane's message of jue jun 02 15:49:53 -0400 2011:
> Alexey Klyukin <alexk(at)commandprompt(dot)com> writes:

> > - Try to actually allocate the shared memory in a way postmaster does this
> > nowadays, if the process fails - analyze the error code to check whether the
> > failure is due to the shmmax or shmmall limits being too low. This would
> > need to be run as a separate process (not postmaster's child) to avoid
> > messing with the postmaster's own shared memory, which means that this would
> > be hard to implement as a user-callable stored function.
>
> The results of such a test wouldn't be worth the electrons they're
> written on anyway: you're ignoring the likelihood that two instances of
> shared memory would overrun the kernel's SHMALL limit, when a single
> instance would be fine.
>
> Given that you can't do it in the context of a live installation, just
> trying to start the postmaster and seeing if it works (same as initdb
> does) seems as good as anything else.

BTW the other idea we discussed at PGCon was that we could have a
postmaster option that would parse the config file and then report the
amount of shared memory needed to run with it. If we had that, then
it's easy to write a platform-specific shell script or program that
verifies that the given number is within the allowed limits.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2011-06-03 16:47:58 Re: creating CHECK constraints as NOT VALID
Previous Message Robert Haas 2011-06-03 16:44:45 Re: BUG #6041: Unlogged table was created bad in slave node