From 750503cea56606b068f12dfb313013b008ddfdf7 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 19 Apr 2010 00:00:22 +0000 Subject: [PATCH] Provide better guidance for adjusting shared_buffers. This change was previously committed to HEAD, but the consensus seems to be in favor of back-patching it. I'm only backpatching as far as 8.3.X, however, because it's not clear to me to what degree this advice applies to older branches, and in any case our first advice to anyone attempting to tune those versions is likely to be "upgrade". --- doc/src/sgml/config.sgml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index d1edcd12bbc..460fabe7e3a 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1,4 +1,4 @@ - + Server Configuration @@ -766,9 +766,32 @@ SET ENABLE_SEQSCAN TO OFF; kilobytes times . (Non-default values of BLCKSZ change the minimum.) However, settings significantly higher than the minimum are usually needed - for good performance. Several tens of megabytes are recommended - for production installations. This parameter can only be set at - server start. + for good performance. This parameter can only be set at server start. + + + + If you have a dedicated database server with 1GB or more of RAM, a + reasonable starting value for shared_buffers is 25% + of the memory in your system. There are some workloads where even + large settings for shared_buffers are effective, but + because PostgreSQL also relies on the + operating system cache, it is unlikely that an allocation of more than + 40% of RAM to shared_buffers will work better than a + smaller amount. Larger settings for shared_buffers + usually require a corresponding increase in + checkpoint_segments, in order to spread out the + process of writing large quantities of new or changed data over a + longer period of time. + + + + On systems with less than 1GB of RAM, a smaller percentage of RAM is + appropriate, so as to leave adequate space for the operating system. + Also, on Windows, large values for shared_buffers + aren't as effective. You may find better results keeping the setting + relatively low and using the operating system cache more instead. The + useful range for shared_buffers on Windows systems + is generally from 64MB to 512MB.