Re: fsync on ext4 does not work

From: Havasvölgyi Ottó <havasvolgyi(dot)otto(at)gmail(dot)com>
To: Florian Weimer <fweimer(at)bfk(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: fsync on ext4 does not work
Date: 2011-12-19 21:34:02
Message-ID: CAOryeA1R-w0F0vJU-kG4tvfUMh=Sw_g6YBv=zGBKz47WXYNhLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2011/12/19 Florian Weimer <fweimer(at)bfk(dot)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(at)bfk(dot)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
>

In response to

Responses

Browse pgsql-general by date

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