ZFS sub-optimal performance with default setting

Ivan Voras ivoras at freebsd.org
Wed Jan 9 14:49:24 UTC 2013


I don't know if I understand your questions correctly; you should
provide more details: what is the performance you get from the system
(numbers) and what do you want it to be (again, numbers).

On 09/01/2013 15:31, Patrick Dung wrote:

> a) I use OTRS ticketing system version 3.1, the backend is PostgreSQL.
> The user interactive response is not slow (switching web pages or create a change).

How did you conclude the database and ZFS are the problem? What
measurements from iostat and similar tools do you get which support that
conclusion?


> I have done some research on web, with below settings (just one change, not both), the performance returned to normal:
> 
> 1) Disabled sync in the pgsql dataset in ZFS
> zfs set sync=disabled mydata/pgsql
> or 
> 2) In
>  postgresql.conf, set synchronous_commit from on to off
> 
> I know the above setting would lead to data loss (e.g.power goes off), any comments?

Those two settings have almost the same idea behind them - delaying disk
data sync in such a way that it doesn't impact the data already
committed, and preserve metadata structures, but they do it on different
levels.

In theory, with ZFS "sync=disabled", you will survive a crash with the
file system structures intact, but with some file data lost (e.g. the
last 30 seconds before the crash). This may include any random file data.

With PostgreSQL's "synchronous_commit=off", you will survive a crash
with PostgreSQL's data structures intact (if the file system synces
properly), but you could lose data within the database since the last
time fsync was called.

The difference is that in the first case (ZFS), you may end up with a
sane file system but with corrupted PostgreSQL data, and in the second
case the PostgreSQL files will be sane and only some database data can
be lost. The second case is always better.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20130109/904f5e6b/attachment.sig>


More information about the freebsd-fs mailing list