Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc65f299

Browse files
committed
Add new Non-Durable Settings documentation section.
Document that synchronous_commit can lose transactions in a db crash,not just a OS crash.
1 parent400916b commitc65f299

File tree

2 files changed

+66
-3
lines changed

2 files changed

+66
-3
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.283 2010/06/25 13:11:25 sriggs Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.284 2010/06/28 21:57:17 momjian Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -1463,7 +1463,8 @@ SET ENABLE_SEQSCAN TO OFF;
14631463
really guaranteed to be safe against a server crash. (The maximum
14641464
delay is three times <xref linkend="guc-wal-writer-delay">.) Unlike
14651465
<xref linkend="guc-fsync">, setting this parameter to <literal>off</>
1466-
does not create any risk of database inconsistency: a crash might
1466+
does not create any risk of database inconsistency: an operating
1467+
system or database crash crash might
14671468
result in some recent allegedly-committed transactions being lost, but
14681469
the database state will be just the same as if those transactions had
14691470
been aborted cleanly. So, turning <varname>synchronous_commit</> off

‎doc/src/sgml/perform.sgml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/perform.sgml,v 1.80 2010/05/29 21:08:04 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/perform.sgml,v 1.81 2010/06/28 21:57:17 momjian Exp $ -->
22

33
<chapter id="performance-tips">
44
<title>Performance Tips</title>
@@ -1104,4 +1104,66 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
11041104
</sect2>
11051105
</sect1>
11061106

1107+
<sect1 id="non-durability">
1108+
<title>Non-Durable Settings</title>
1109+
1110+
<indexterm zone="non-durability">
1111+
<primary>non-durable</primary>
1112+
</indexterm>
1113+
1114+
<para>
1115+
Durability is a database feature that guarantees the recording of
1116+
committed transactions even if if the server crashes or loses
1117+
power. However, durability adds significant database overhead,
1118+
so if your site does not require such a guarantee,
1119+
<productname>PostgreSQL</productname> can be configured to run
1120+
much faster. The following are configuration changes you can make
1121+
to improve performance in such cases; they do not invalidate
1122+
commit guarantees related to database crashes, only abrupt operating
1123+
system stoppage, except as mentioned below:
1124+
1125+
<itemizedlist>
1126+
<listitem>
1127+
<para>
1128+
Place the database cluster's data directory in a memory-backed
1129+
file system (i.e. <acronym>RAM</> disk). This eliminates all
1130+
database disk I/O, but limits data storage to the amount of
1131+
available memory (and perhaps swap).
1132+
</para>
1133+
</listitem>
1134+
1135+
<listitem>
1136+
<para>
1137+
Turn off <xref linkend="guc-fsync">; there is no need to flush
1138+
data to disk.
1139+
</para>
1140+
</listitem>
1141+
1142+
<listitem>
1143+
<para>
1144+
Turn off <xref linkend="guc-full-page-writes">; there is no need
1145+
to guard against partial page writes.
1146+
</para>
1147+
</listitem>
1148+
1149+
<listitem>
1150+
<para>
1151+
Increase <xref linkend="guc-checkpoint-segments"> and <xref
1152+
linkend="guc-checkpoint-timeout"> ; this reduces the frequency
1153+
of checkpoints, but increases the storage requirements of
1154+
<filename>/pg_xlog</>.
1155+
</para>
1156+
</listitem>
1157+
1158+
<listitem>
1159+
<para>
1160+
Turn off <xref linkend="guc-synchronous-commit">; there might be no
1161+
need to write the <acronym>WAL</acronym> to disk on every
1162+
commit. This does affect database crash transaction durability.
1163+
</para>
1164+
</listitem>
1165+
</itemizedlist>
1166+
</para>
1167+
</sect1>
1168+
11071169
</chapter>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp