Is it better to use OS cache or max out memory usage of PostgreSQL? - Mailing list pgsql-general

From Andy DePue
Subject Is it better to use OS cache or max out memory usage of PostgreSQL?
Date
Msg-id 3CE26E07.9080908@eworksmart.com
Whole thread Raw
Responses Re: Is it better to use OS cache or max out memory usage of PostgreSQL?
List pgsql-general
Hello all,
  I think I've figured out that posting to the newsgroup doesn't work. :-)
  Which is more effecient, to setup PostgreSQL to use as much system RAM as possible (for example, setting up 800MB for PostgreSQL on a 1GB system), or to keep PostgreSQL memory usage to something like 25% of RAM and depend on the OS (in this case, Linux) file system cache to optimize memory usage?
  At first glance, it would seem that depending on the OS file system cache would not be the way to go... If PostgreSQL needs data and that data is not in PostgreSQL's shared memory, then PostgreSQL must go out and retrieve the data from the filesystem (I'm guessing).  If the OS has cached the data, then the data is effectively copied from the OS cache into PostgreSQL's memory... not only is there the overhead of copying the data, but now there are two copies of it in memory.  However, I have been told in the past that it is indeed better to keep PostgreSQL memory usage small and depend more on the OS file system cache.  What is the right balance?

   Thanks in advance,
        Andy

pgsql-general by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: Spped of max
Next
From: Bill Gribble
Date:
Subject: (security) Rules of thumb for escaping user input?