Skip site navigation (1) Skip section navigation (2)

Re: SSDs with Postgresql?

From: Robert Treat <rob(at)xzilla(dot)net>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: Florian Weimer <fweimer(at)bfk(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: SSDs with Postgresql?
Date: 2011-04-28 19:34:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Thu, Apr 21, 2011 at 12:10 PM, Greg Smith <greg(at)2ndquadrant(dot)com> wrote:
> On 04/21/2011 11:33 AM, Florian Weimer wrote:
>> Is there an easy way to monitor WAL traffic in away? It
>> does not have to be finegrained, but it might be helpful to know if
>> we're doing 10 GB, 100 GB or 1 TB of WAL traffic on a particular
>> database, should the question of SSDs ever come up.
> You can use functions like pg_current_xlog_location() :
> Save a copy of this periodically:
> select now(),pg_current_xlog_location();
> And you can see WAL volume over time given any two points from that set of
> samples.
> To convert the internal numbers returned by that into bytes, you'll need to
> do some math on them.  Examples showing how that works and code in a few
> languages:
> (by hand)
> (in Perl)
> (in C)
> (in bash with bc(!), other links)
> What I keep meaning to write is something that does that as part of the SQL
> itself, so it gets pulled out of the database already in bytes.

We have an open task to work on this same problem. What we had cobbled
together so far was some sql which converted the xlog value into an
integer (it's pretty ugly, but I could send it over if you think it
would help), which we could then stick in a monitoring system and
graph. To get an idea of traffic, I just multiplied this by 16MB. End
result ended up looking like this:

Couldn't decide on exactly where to go from there. That's graphing
MB/sec, which does map easily in my mind, since xlogs streams are in
16mb bursts. It would make more sense for wal streaming though (but in
that case we'd probably want to measure it more precisely).

Robert Treat

In response to


pgsql-general by date

Next:From: Basil BourqueDate: 2011-04-28 19:46:50
Subject: "OLD." || myColumnNameVar (How to generically access columns in a trigger's OLD or NEW records)
Previous:From: Ernesto LozanoDate: 2011-04-28 19:05:51
Subject: Re: [ANNOUNCE] [HACKERS] PostgreSQL Core Team

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group