On 08/14/2011 08:51 AM, tv@xxxxxxxx wrote:
I've increased the test duration to 10 minutes, decreased the checkpoint timeout to 4 minutes and a checkpoint is issued just before the pgbench. That way the starting position should be more or less the same for all runs.
That's basically what I settled on for pgbench-tools. Force a checkpoint just before the test, so the beginning of each run is aligned more consistently, then run for long enough that you're guaranteed at least one checkpoint finishes[1] (and you might see more than one if you fill checkpoint_segments fast enough). I never bothered trying to compress that test cycle down by decreasing checkpoint_timeout. There's already too many things you need to do in order to get this test working well, and I didn't want to include a change I'd never recommend people make on a production server in the mix.
[1] If your checkpoint behavior goes pathological, for example the extended checkpoints possible when the background writer fsync queue fills, it's not actually guaranteed that the checkpoint will finish within 5 minutes after it starts. So a 10 minute run doesn't assure you'll a checkpoint begin and end in all circumstances, but it is the expected case.
-- Greg Smith 2ndQuadrant US greg@xxxxxxxxxxxxxxx Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance