pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: captainx0r@yahoo.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Sun vs. Mac
Date: Tue, 14 Jan 2003 13:15:54 -0500
Message-ID: <17342.1042568154@sss.pgh.pa.us> (raw)
In-Reply-To: <20030114175004.15074.qmail@web21101.mail.yahoo.com>
References: <20030114175004.15074.qmail@web21101.mail.yahoo.com>

CaptainX0r <captainx0r@yahoo.com> writes:
> Well, I've got the Sun box now, but I don't really have acces to
> the G3.  FWIW, top shows postgres slowly taking up all the CPU -
> over the course of a minute or so it gradually ramps up to
> around 90%.  Once the query is complete, however, top shows the
> CPU ramping down slowly, ~1-2% per second over the next 2
> minutes which I find very strange.

I believe top's percent-of-CPU numbers for individual processes are time
averages over a minute or so, so the ramping effect is unsurprising.

> This doesn't really tell me much, except I'm guessing that PG is
> CPU bound?

Yup, that seems pretty clear.  Next step is to find out what the heck
it's doing.  My instinct would be to use gprof.  Recompile with
profiling enabled --- if you're using gcc, this should work
	cd postgres-distribution/src/backend
	make clean
	make PROFILE=-pg all
	make install-bin	-- may need to stop postmaster before install
Next run some sample queries (put them all into one session).  After
quitting the session, find gmon.out in the $PGDATA/base/nnn/
subdirectory corresponding to your database, and feed it to gprof.
The results should show where the code hotspot is.

			regards, tom lane



view thread (20+ messages)  latest in thread

Message-ID: <17342.1042568154@sss.pgh.pa.us>
Permalink:  ../17342.1042568154@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17342.1042568154@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, captainx0r@yahoo.com
  Subject: Re: Sun vs. Mac
  In-Reply-To: <17342.1042568154@sss.pgh.pa.us>
  References: <20030114175004.15074.qmail@web21101.mail.yahoo.com> <17342.1042568154@sss.pgh.pa.us>

* 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