Re: Moving pgstat.stat and pgstat.tmp

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-general(at)postgresql(dot)org, Erik Jones <erik(at)myemma(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Moving pgstat.stat and pgstat.tmp
Date: 2007-12-05 12:22:41
Message-ID: 20071205122241.GA5847@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Robert Treat wrote:
> On Monday 03 December 2007 20:22, Erik Jones wrote:

> > Interesting. If this is anything you'd like to look into I can
> > provide whatever diagnostic output you need (iostat, vmstat, dtrace
> > script outputs, etc...) but I do have to reiterate that we are an
> > extreme corner case due to out schema size. For now, is renaming the
> > #define'd paths for the stats file and temp file sufficient for
> > moving them? Basically, we'd like to move them onto a RAM disk to
> > give our disks a break.
>
> Yeah, we've noticed the same problem (pgstat is the most active file on the
> system... uncovered in much the same way... go solaris). Actually I was
> wondering if it could be done with symlinks, a la moving xlogs.

Not really, because a new file is created and renamed in place each time
it's going to be rewritten. So the symlink would be lost in the first
file rewrite.

The first idea that comes to mind is to make the path configurable via
GUC, so the user could set it to be written to an in-memory filesystem
(/tmp in Solaris?). But then I thought, why do we need it to be a file
at all? Why not use a mmap'ed memory area or something like that, and
only write it to a file on postmaster shutdown? (Losing the file on
unclean shutdown is not a problem, because the file is removed anyway.)

--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
"Prefiero omelette con amigos que caviar con tontos"
(Alain Nonnet)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2007-12-05 13:00:33 Re: [GENERAL] PostgreSQL Beta4 released
Previous Message A. Kretschmer 2007-12-05 12:04:06 Re: SQL Query