On Thu, Oct 10, 2013 at 02:44:12PM -0400, Peter Eisentraut wrote:
> On 10/10/13 11:31 AM, Bruce Momjian wrote:
> > Let me walk through the idea of adding an available_mem setting, that
> > Josh suggested, and which I think addresses Robert's concern about
> > larger shared_buffers and Windows servers.
> 
> I think this is a promising idea.  available_mem could even be set
> automatically by packages.  And power users could just set available_mem
> = -1 to turn off all the magic.

Yes, I was thinking about that.  Imagine we have an initdb parameter
for available memory --- packagers could do something like:

        initdb -M $(awk '{print $2 * 1024; exit}' /proc/meminfo)

to pass in the available memory of the server, or to use 90% of RAM,
use:

        initdb -M $(awk '{printf "%.0f\n", $2 * 1024 * 0.9; exit}' 
/proc/meminfo)

This allows us to externalize all the OS-specific information and allow
the packagers to supply it.  The packagers could even ask the user if
they wish to control the percentage.

FYI, I hope people are OK with me replying a lot in this thread --- I do
think this is going to take a lot of discussion, but I think the
end-result will be worth it.

-- 
  Bruce Momjian  <br...@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to