Thread: What is the role of #fsync and #synchronous_commit in configuration file .

What is the role of #fsync and #synchronous_commit in configuration file .

From
keshav upadhyaya
Date:
Hi ,
I want to imporve  the performance for inserting of huge data in my table .
I have only one idex in table .

First question - i want to know the role played by

 #fsync   = on    and
 #synchronous_commit = on

They are commented by default in 8.4 .
When made like this :-
fsync = off             
synchronous_commit = off     


It improve the performance :)
and query took less time .

I want to understand more in details what exactly had happened  one is made them "off" , is it dangerous to do this ?  as it will not sync the data in each commit .

Pls help me out .

--
Thanks,
Keshav Upadhyaya

Re: What is the role of #fsync and #synchronous_commit in configuration file .

From
Josh Kupershmidt
Date:
On Tue, Oct 6, 2009 at 3:28 AM, keshav upadhyaya <ukeshav2009@gmail.com> wrote:

> First question - i want to know the role played by
>
>  #fsync   = on    and
>  #synchronous_commit = on

These configurations are discussed here:
http://developer.postgresql.org/pgdocs/postgres/runtime-config-wal.html

> I want to understand more in details what exactly had happened  one is made
> them "off" , is it dangerous to do this ?  as it will not sync the data in
> each commit .
>

There's plenty of discussion in the documentation and the list
archives about the
risks of disabling fsync and/or synchronous commit. Here's one:
http://archives.postgresql.org/pgsql-performance/2006-04/msg00631.php

If you're struggling with performance issues, I'd post a detailed
description of
your problem and what you've tried so far to the -performance list, instead of
turning fsync off.

Josh