Re: [PERFORM] upping checkpoints on production server

2003-09-25 Thread Robert Treat
On Wed, 2003-09-24 at 17:57, Tom Lane wrote:
> Robert Treat <[EMAIL PROTECTED]> writes:
> > In .conf file I have default checkpoints set to 3, but I noticed that in
> > my pg_xlog directory I always seem to have at least 8 log files. Since
> > this is more than the suggested 7, I'm wondering if this means I ought
> > to bump my checkpoint segments up to 4?
> 
> Hm.  What is the typical delta in the mod times of the log files?  It
> sounds like you are in a regime where checkpoints are always triggered
> by checkpoint_segments and never by checkpoint_timeout, in which case
> increasing the former might be a good idea.  Or decrease the latter,
> but that could put a drag on performance.
> 

# ls -lht /var/lib/pgsql/data/pg_xlog/
total 129M
-rw---1 postgres postgres  16M Sep 25 11:12 006E0059
-rw---1 postgres postgres  16M Sep 25 11:12 006E005A
-rw---1 postgres postgres  16M Sep 25 11:08 006E0058
-rw---1 postgres postgres  16M Sep 25 11:05 006E005F
-rw---1 postgres postgres  16M Sep 25 11:02 006E005E
-rw---1 postgres postgres  16M Sep 25 10:59 006E005D
-rw---1 postgres postgres  16M Sep 25 10:55 006E005B
-rw---1 postgres postgres  16M Sep 25 10:51 006E005C

#ls -lht /var/lib/pgsql/data/pg_xlog/
total 129M
-rw---1 postgres postgres  16M Sep 25 10:52 006E0054
-rw---1 postgres postgres  16M Sep 25 10:51 006E0053
-rw---1 postgres postgres  16M Sep 25 10:49 006E0052
-rw---1 postgres postgres  16M Sep 25 10:45 006E0059
-rw---1 postgres postgres  16M Sep 25 10:40 006E0057
-rw---1 postgres postgres  16M Sep 25 10:37 006E0058
-rw---1 postgres postgres  16M Sep 25 10:33 006E0056
-rw---1 postgres postgres  16M Sep 25 10:29 006E0055






from the 7.4 docs:

 "Checkpoints are fairly expensive because they force all dirty kernel
buffers to disk using the operating system sync() call. Busy servers may
fill checkpoint segment files too quickly, causing excessive
checkpointing." 

it goes on to mention checkpoint_warning, which I don't have in 7.3, but
I think this is a case where I'd likely see those warnings. The server
in question has a fairly high write/read ratio and is fairly busy (over
100 tps iirc). 

since more often than not I don't make it to 5 minutes, seems like
upping checkpoint segments is the way to go, right?

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PERFORM] upping checkpoints on production server

2003-09-24 Thread Tom Lane
Robert Treat <[EMAIL PROTECTED]> writes:
> In .conf file I have default checkpoints set to 3, but I noticed that in
> my pg_xlog directory I always seem to have at least 8 log files. Since
> this is more than the suggested 7, I'm wondering if this means I ought
> to bump my checkpoint segments up to 4?

Hm.  What is the typical delta in the mod times of the log files?  It
sounds like you are in a regime where checkpoints are always triggered
by checkpoint_segments and never by checkpoint_timeout, in which case
increasing the former might be a good idea.  Or decrease the latter,
but that could put a drag on performance.

regards, tom lane

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


[PERFORM] upping checkpoints on production server

2003-09-24 Thread Robert Treat
All this talk of checkpoints got me wondering if I have them set at an
optimum level on my production servers. I noticed the following in the
docs:

 "There will be at least one 16 MB segment file, and will normally not
be more than 2 * checkpoint_segments + 1 files. You can use this to
estimate space requirements for WAL. Ordinarily, when old log segment
files are no longer needed, they are recycled (renamed to become the
next segments in the numbered sequence). If, due to a short-term peak of
log output rate, there are more than 2 * checkpoint_segments + 1 segment
files, the unneeded segment files will be deleted instead of recycled
until the system gets back under this limit." 

In .conf file I have default checkpoints set to 3, but I noticed that in
my pg_xlog directory I always seem to have at least 8 log files. Since
this is more than the suggested 7, I'm wondering if this means I ought
to bump my checkpoint segments up to 4?  I don't really want to bump it
up unnecessarily as quick recover time is important on this box, however
if i would get an overall performance boost it seems like it would be
worth it, and given that I seem to be using more than the default number
anyways... I've always treated wal logs as self maintaining, am I over
analyzing this?

Another thought popped into my head, is it just coincidence that I
always seem to have 8 files and that wal_buffers defaults to 8? Seems
like it's not but I love a good conspiracy theory.

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings