Re: PGSQL, checkpoints, and file system syncs - Mailing list pgsql-performance

From Shaun Thomas
Subject Re: PGSQL, checkpoints, and file system syncs
Date
Msg-id 0683F5F5A5C7FE419A752A034B4A0B97978B5EBE@sswchi5pmbx2.peak6.net
Whole thread Raw
In response to PGSQL, checkpoints, and file system syncs  (Reza Taheri <rtaheri@vmware.com>)
Responses Re: PGSQL, checkpoints, and file system syncs  (Bruce Momjian <bruce@momjian.us>)
List pgsql-performance
> Is there something I can set in the PGSQL parameters or in the file system
> parameters to force a steady flow of writes to disk rather than waiting for
> a sync system call? Mounting with "commit=1" did not make a difference.

The PostgreSQL devs actually had a long talk with the Linux kernel devs over this exact issue, actually. While we wait
forthe results of that to bear some fruit, I'd recommend using the dirty_background_bytes and dirty_bytes settings both
onthe VM side, and on the host server. To avoid excessive flushes, you want to avoid having more dirty memory than the
systemcan handle in one gulp. 

The dirty_bytes setting will begin flushing disks synchronously when the amount of dirty memory reaches this amount.
Whiledirty_background_bytes will flush in the background when the amount of dirty memory hits the specified limit. It's
thebackground flushing that will prevent your current problems, and it should be set at the same level as the amount of
writecache your system has available. 

So if you are on a 1GB RAID card, set it to 1GB. Once you have 1GB of dirty memory (from a checkpoint or whatever),
Linuxwill begin flushing. 

This is a pretty well-known issue on Linux systems with large amounts of RAM. Most VM servers fit that profile, so I'm
notsurprised it's hurting you. 

--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd | Suite 400 | Chicago IL, 60604
312-676-8870
sthomas@optionshouse.com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: query against large table not using sensible index to find very small amount of data
Next
From: Gerardo Herzig
Date:
Subject: Re: performance drop when function argument is evaluated in WHERE clause