|
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 $ --> |
2 | 2 |
|
3 | 3 | <chapter id="performance-tips">
|
4 | 4 | <title>Performance Tips</title>
|
@@ -1104,4 +1104,66 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
|
1104 | 1104 | </sect2>
|
1105 | 1105 | </sect1>
|
1106 | 1106 |
|
| 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 | + |
1107 | 1169 | </chapter>
|
0 commit comments