Re: fsync on ext4 does not work - Mailing list pgsql-general

From Havasvölgyi Ottó
Subject Re: fsync on ext4 does not work
Date
Msg-id CAOryeA1R-w0F0vJU-kG4tvfUMh=Sw_g6YBv=zGBKz47WXYNhLg@mail.gmail.com
Whole thread Raw
In response to Re: fsync on ext4 does not work  (Florian Weimer <fweimer@bfk.de>)
Responses Re: fsync on ext4 does not work
List pgsql-general


2011/12/19 Florian Weimer <fweimer@bfk.de>
* Havasvölgyi Ottó:

> Even though the TPS in pgbench about 700 with 1 client.
> I have tried other sync methods (fdatasync, open_sync), but all are similar.
> Should I disable write cache on HDD to make it work?

Did you mount your ext4 file system with the nobarrier option?

By default, ext4 is supposed to cope properly with hard disk caches,
unless the drive is lying about completing writes (but in that case,
disabling write caching is probably not going to help much with
reliability, either).

It is mounted with defaults, no other option yet, so it should flush.
These HDDs are 7200 rpm SATA with some low level software RAID1.
I cannot understand why disabling HDD write cache does not help either. Could you explain please?

There is also an InnoDB transaction log on this partition, but its commit time is quite longer. On the same workload PgSql's commit is about 1 ms, but InnoDB's is about 4-7 ms. I think 4-7 is also too short to flush something to such disk, am I right? Or perhaps does it do something different? It is set to fsync synchronously. Also a difference that as I increase concurrency, InnoDb's avg. commit time is going up quite quickly, however PgSql's one rather slowly. I wonder if this is because InnoDb really flushes to disk, or just because PostgreSQL is better :).

Best regards,
Otto


--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: New User: PostgreSQL Setup - "The Program 'postgress' is needed by initdb but was not found in the same directory..."
Next
From: Hannes Erven
Date:
Subject: Re: Feature Request: Better handling of foreign keys in DELETE statements