pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: David Lang <dlang@invendra.net>
Cc: Mark Liberman <mliberman@mixedsignals.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Help in avoiding a query 'Warm-Up' period/shared buffer
Date: Thu, 5 Jan 2006 21:14:21 -0600
Message-ID: <20060106031421.GM43311@pervasive.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0601051848510.11046@qnivq.ynat.uz>
References: <200601041449.43557.mliberman@mixedsignals.com>
	<dpk922$slo$1@news.hub.org>
	<200601051815.36181.mliberman@mixedsignals.com>
	<Pine.LNX.4.62.0601051848510.11046@qnivq.ynat.uz>

On Thu, Jan 05, 2006 at 06:50:22PM -0800, David Lang wrote:
> On Thu, 5 Jan 2006, Mark Liberman wrote:
> 
> >Obviously, I will be testing this - but it might take a few days, as I 
> >haven't
> >figure out how to simulate the "period of inactivity" to get the data 
> >flushed
> >out of the cache ... so I have to run this each morning.
> 
> cat large_file >/dev/null
> 
> will probably do a pretty good job of this (especially if large_file is 
> noticably larger then the amount of ram you have)

The following C code is much faster...

/*
 * $Id: clearmem.c,v 1.1 2003/06/29 20:41:33 decibel Exp $
 *
 * Utility to clear out a chunk of memory and zero it. Useful for flushing disk buffers
 */

int main(int argc, char *argv[]) {
    if (!calloc(atoi(argv[1]), 1024*1024)) { printf("Error allocating memory.\n"); }
}

Compile it and then pass in the number of MB of memory to allocate on
the command line.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (6+ messages)

Message-ID: <20060106031421.GM43311@pervasive.com>
Permalink:  ../20060106031421.GM43311@pervasive.com/
Also on:    postgresql.org/message-id/20060106031421.GM43311@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, dlang@invendra.net, mliberman@mixedsignals.com
  Subject: Re: Help in avoiding a query 'Warm-Up' period/shared buffer
  In-Reply-To: <20060106031421.GM43311@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox