In response to "Campbell, Lance" <lance(at)uiuc(dot)edu>:
> Thanks for your reply.
> You said:
> "Your operating-system should be doing the caching for you."
> My understanding is that as long as Linux has memory available it will
> cache files. Then from your comment I get the impression that since
> Linux would be caching the data files for the postgres database it would
> be redundant to have a large shared_buffers. Did I understand you
Keep in mind that keeping the data in the kernel's buffer requires
Postgres to make a syscall to read a file, which the kernel then realizes
is cached in memory. The kernel then has to make that data available
to the Postgres (userland) process.
If the data is in Postgres' buffers, Postgres can fetch it directly, thus
avoiding the overhead of the syscalls and the kernel activity. You still
have to make sysvshm calls, though.
So, it depends on which is able to manage the memory better. Is the
kernel so much more efficient that it makes up for the overhead of the
syscalls? My understanding is that in recent versions of Postgres,
this is not the case, and large shared_buffers improve performance.
I've yet to do any in-depth testing on this, though.
Collaborative Fusion Inc.
In response to
pgsql-performance by date
|Next:||From: Jeff Davis||Date: 2007-02-23 18:14:29|
|Subject: long checkpoint_timeout|
|Previous:||From: firstname.lastname@example.org||Date: 2007-02-23 17:55:20|
|Subject: Re: Very slow bytea data extraction|