Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b910d7e

Browse files
committed
Increase the default value of effective_cache_size to 4GB.
Per discussion, the old value of 128MB is ridiculously small on modern machines; in fact, it's not even any larger than the default value of shared_buffers, which it certainly should be. Increase to 4GB, which is unlikely to be any worse than the old default for anyone, and should be noticeably better for most. Eventually we might have an autotuning scheme for this setting, but the recent attempt crashed and burned, so for now just do this.
1 parent a16d421 commit b910d7e

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

doc/src/sgml/config.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3194,8 +3194,8 @@ include 'filename'
31943194
memory allocated by <productname>PostgreSQL</productname>, nor
31953195
does it reserve kernel disk cache; it is used only for estimation
31963196
purposes. The system also does not assume data remains in
3197-
the disk cache between queries. The default is 128 megabytes
3198-
(<literal>128MB</>).
3197+
the disk cache between queries. The default is 4 gigabytes
3198+
(<literal>4GB</>).
31993199
</para>
32003200
</listitem>
32013201
</varlistentry>

doc/src/sgml/release-9.4.sgml

+9-9
Original file line numberDiff line numberDiff line change
@@ -720,27 +720,27 @@
720720
</para>
721721
</listitem>
722722

723-
<listitem>
724-
<para>
725-
Auto-tune <link
726-
linkend="guc-effective-cache-size"><varname>effective_cache_size</></link>
727-
to be four-times shared buffers (Bruce Momjian, Tom Lane)
728-
</para>
729-
</listitem>
730-
731723
<listitem>
732724
<para>
733725
Increase <link
734726
linkend="guc-work-mem"><varname>work_mem</></link> and <link
735727
linkend="guc-maintenance-work-mem"><varname>maintenance_work_mem</></link>
736-
defaults by four-times (Bruce Momjian)
728+
defaults by four times (Bruce Momjian)
737729
</para>
738730

739731
<para>
740732
The new defaults are 4MB and 64MB respectively.
741733
</para>
742734
</listitem>
743735

736+
<listitem>
737+
<para>
738+
Increase the default setting of <link
739+
linkend="guc-effective-cache-size"><varname>effective_cache_size</></link>
740+
to 4GB (Bruce Momjian, Tom Lane)
741+
</para>
742+
</listitem>
743+
744744
<listitem>
745745
<para>
746746
Allow terabyte units to be specified for configuration variable

src/backend/utils/misc/postgresql.conf.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
#cpu_tuple_cost = 0.01 # same scale as above
284284
#cpu_index_tuple_cost = 0.005 # same scale as above
285285
#cpu_operator_cost = 0.0025 # same scale as above
286-
#effective_cache_size = 128MB
286+
#effective_cache_size = 4GB
287287

288288
# - Genetic Query Optimizer -
289289

src/include/optimizer/cost.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define DEFAULT_CPU_INDEX_TUPLE_COST 0.005
2828
#define DEFAULT_CPU_OPERATOR_COST 0.0025
2929

30-
#define DEFAULT_EFFECTIVE_CACHE_SIZE 16384 /* measured in pages */
30+
#define DEFAULT_EFFECTIVE_CACHE_SIZE 524288 /* measured in pages */
3131

3232
typedef enum
3333
{

0 commit comments

Comments
 (0)