|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.279 2010/05/26 23:49:18 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.280 2010/05/31 15:50:48 momjian Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter Id="runtime-config">
|
4 | 4 | <title>Server Configuration</title>
|
@@ -1413,34 +1413,23 @@ SET ENABLE_SEQSCAN TO OFF;
|
1413 | 1413 | </para>
|
1414 | 1414 |
|
1415 | 1415 | <para>
|
1416 |
| - However, using <varname>fsync</varname> results in a |
1417 |
| - performance penalty: when a transaction is committed, |
1418 |
| - <productname>PostgreSQL</productname> must wait for the |
1419 |
| - operating system to flush the write-ahead log to disk. When |
1420 |
| - <varname>fsync</varname> is disabled, the operating system is |
1421 |
| - allowed to do its best in buffering, ordering, and delaying |
1422 |
| - writes. This can result in significantly improved performance. |
1423 |
| - However, if the system crashes, the results of the last few |
1424 |
| - committed transactions might be completely lost, or worse, |
1425 |
| - might appear partially committed, leaving the database in an |
1426 |
| - inconsistent state. In the |
1427 |
| - worst case, unrecoverable data corruption might occur. |
1428 |
| - (Crashes of the database software itself are <emphasis>not</> |
1429 |
| - a risk factor here. Only an operating-system-level crash |
1430 |
| - creates a risk of corruption.) |
| 1416 | + While turning off <varname>fsync</varname> is often a performance |
| 1417 | + benefit, this can result in unrecoverable data corruption in |
| 1418 | + the event of an unexpected system shutdown or crash. Thus it |
| 1419 | + is only advisable to turn off <varname>fsync</varname> if |
| 1420 | + you can easily recreate your entire database from external |
| 1421 | + data. |
1431 | 1422 | </para>
|
1432 | 1423 |
|
1433 | 1424 | <para>
|
1434 |
| - Due to the risks involved, there is no universally correct |
1435 |
| - setting for <varname>fsync</varname>. Some administrators |
1436 |
| - always disable <varname>fsync</varname>, while others only |
1437 |
| - turn it off during initial bulk data loads, where there is a clear |
1438 |
| - restart point if something goes wrong. Others |
1439 |
| - always leave <varname>fsync</varname> enabled. The default is |
1440 |
| - to enable <varname>fsync</varname>, for maximum reliability. |
1441 |
| - If you trust your operating system, your hardware, and your |
1442 |
| - utility company (or your battery backup), you can consider |
1443 |
| - disabling <varname>fsync</varname>. |
| 1425 | + Examples of safe circumstances for turning off |
| 1426 | + <varname>fsync</varname> include the initial loading a new |
| 1427 | + database cluster from a backup file, using a database cluster |
| 1428 | + for processing statistics on an hourly basis which is then |
| 1429 | + recreated, or for a reporting read-only database clone which |
| 1430 | + gets recreated frequently and is not used for failover. High |
| 1431 | + quality hardware alone is not a sufficient justification for |
| 1432 | + turning off <varname>fsync</varname>. |
1444 | 1433 | </para>
|
1445 | 1434 |
|
1446 | 1435 | <para>
|
@@ -1572,12 +1561,10 @@ SET ENABLE_SEQSCAN TO OFF;
|
1572 | 1561 |
|
1573 | 1562 | <para>
|
1574 | 1563 | Turning this parameter off speeds normal operation, but
|
1575 |
| - might lead to a corrupt database after an operating system crash |
1576 |
| - or power failure. The risks are similar to turning off |
1577 |
| - <varname>fsync</>, though smaller. It might be safe to turn off |
1578 |
| - this parameter if you have hardware (such as a battery-backed disk |
1579 |
| - controller) or file-system software that reduces |
1580 |
| - the risk of partial page writes to an acceptably low level (e.g., ZFS). |
| 1564 | + might lead to either unrecoverable data corruption, or silent |
| 1565 | + data corruption, after a system failure. The risks are similar to turning off |
| 1566 | + <varname>fsync</varname>, though smaller, and it should be turned off |
| 1567 | + only based on the same circumstances recommended for that parameter. |
1581 | 1568 | </para>
|
1582 | 1569 |
|
1583 | 1570 | <para>
|
|
0 commit comments