Re: [DOCS] [HACKERS] no universally correct setting for fsync

2010-05-07 Thread Josh Berkus
Folks,

This is what I have to replace the current fsync entry in config.sgml.

I believe that the note about needing fsync for Warm Standby to work
correctly is true, but could someone verify it?

=

 
  
   fsync configuration parameter
  
  fsync (boolean)
  
   
If this parameter is on, the PostgreSQL server
will try to make sure that updates are physically written to
disk, by issuing fsync() system calls or various
equivalent methods (see ).
This ensures that the database cluster can recover to a
consistent state after an operating system or hardware crash.
   

   
While turning off fsync is often a performance
benefit, this can result in unrecoverable data corruption in the
event
of an unexpected shutdown. Thus it is only advisable to turn off
fsync if you can easily recreate
your entire database from external data.  fsync
must be on for WAL archiving to work correctly
(see ).
   

   
In many situations, turning off 
for noncritical transactions can provide much of the potential
performance benefit of turning off fsync, without
the attendant risks of data corruption.
   

   
fsync can only be set in the
postgresql.conf
file or on the server command line.
If you turn this parameter off, also consider turning off
.
   
  
 

-- 
  -- Josh Berkus
 PostgreSQL Experts Inc.
 http://www.pgexperts.com

-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


Re: [DOCS] [HACKERS] no universally correct setting for fsync

2010-05-07 Thread Tom Lane
Josh Berkus  writes:
> This is what I have to replace the current fsync entry in config.sgml.

s/unexpected shutdown/system crash/, perhaps.  The wording you have
suggests that a forced Postgres stoppage produces a problem, which it
doesn't.  It takes a failure at the OS level or below to cause a
problem.

> I believe that the note about needing fsync for Warm Standby to work
> correctly is true, but could someone verify it?

AFAIK that's nonsense.  The filesystem state that pg_standby could see
will be updated in any case; pg_standby has no direct access to the bits
on the platters, any more than Postgres does.

regards, tom lane

-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


Re: [DOCS] [HACKERS] no universally correct setting for fsync

2010-05-07 Thread Josh Berkus
On 5/7/10 5:13 PM, Tom Lane wrote:
> Josh Berkus  writes:
>> This is what I have to replace the current fsync entry in config.sgml.
> 
> s/unexpected shutdown/system crash/, perhaps.  The wording you have
> suggests that a forced Postgres stoppage produces a problem, which it
> doesn't.  It takes a failure at the OS level or below to cause a
> problem.

I actually meant "unexpected *system* shutdown", i.e. power-out.  A lot
of people think "crash" just means kernel dump, whereas a UPS failure or
tripped power cord is a lot more likely (except maybe on Windows).

Revised:

==


 
  
   fsync configuration parameter
  
  fsync (boolean)
  
   
If this parameter is on, the PostgreSQL server
will try to make sure that updates are physically written to
disk, by issuing fsync() system calls or various
equivalent methods (see ).
This ensures that the database cluster can recover to a
consistent state after an operating system or hardware crash.
   

   
While turning off fsync is often a performance
benefit, this can result in unrecoverable data corruption in the
event
of an unexpected system shutdown or crash.  Thus it is only
advisable
to turn off  fsync if you can easily recreate
your entire database from external data.
   

   
In many situations, turning off 
for noncritical transactions can provide much of the potential
performance benefit of turning off fsync, without
the attendant risks of data corruption.
   

   
fsync can only be set in the
postgresql.conf
file or on the server command line.
If you turn this parameter off, also consider turning off
.
   
  
 



-- 
  -- Josh Berkus
 PostgreSQL Experts Inc.
 http://www.pgexperts.com

-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs