Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 01:09 AM
jao@geophile.com
Guest
 
Posts: n/a
Default Trying to minimize the impact of checkpoints (resend)

[Sorry if this is a repeat. I think the first message may have
been rejected due to an attachment.]

I'm using PostgreSQL 7.3.4 on RH9. Data and logs are on separate
disks. (These are low-end IDE disks. That part of the problem
is out of my control.)

When a checkpoint occurs, all operations slow way, way down.
iostat of the data disk shows that, during a checkpoint, reads/sec
drops from 25-30 to under 0.5. Writes/sec go up, from 40-45
before the checkpoint, to 80-85 during. My test program does
a mixture of 1/2 reads and 1/2 inserts, so it basically comes
to a stop during checkpoints.

What can I do about this? The variability in read and insert times is
really hurting us. I know how to make checkpoints less frequent. I
know that the background writer will show up in 7.5. But what can I do
now?

Does anyone have any experience in modifying the priority of the
checkpoint process itself, (re-nicing it)?

- Would this be effective in slowing down checkpointing, allowing
concurrent work to get done more quickly?

- Is this a dangerous thing to do?

- How would it be done? (From outside postgresql if possible, but
we'll tweak the source if necessary.)

Jack Orenstein

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

  #2  
Old November 23rd, 2005, 01:09 AM
Doug McNaught
Guest
 
Posts: n/a
Default Re: Trying to minimize the impact of checkpoints (resend)

jao@geophile.com writes:
[color=blue]
> Does anyone have any experience in modifying the priority of the
> checkpoint process itself, (re-nicing it)?[/color]

Unfortunately for you, re-nicing doesn't generally affect a processes
I/O rate--it's meant for CPU-bound processes.

It might be possible to add code to "throttle" the checkpoint process
(similar to what was done for VACUUM) but I don't know for sure...

-Doug

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

  #3  
Old November 23rd, 2005, 01:09 AM
Doug McNaught
Guest
 
Posts: n/a
Default Re: Trying to minimize the impact of checkpoints (resend)

jao@geophile.com writes:
[color=blue]
> Does anyone have any experience in modifying the priority of the
> checkpoint process itself, (re-nicing it)?[/color]

Unfortunately for you, re-nicing doesn't generally affect a processes
I/O rate--it's meant for CPU-bound processes.

It might be possible to add code to "throttle" the checkpoint process
(similar to what was done for VACUUM) but I don't know for sure...

-Doug

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

  #4  
Old November 23rd, 2005, 01:09 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: Trying to minimize the impact of checkpoints (resend)

jao@geophile.com writes:[color=blue]
> I'm using PostgreSQL 7.3.4 on RH9. Data and logs are on separate
> disks. (These are low-end IDE disks. That part of the problem
> is out of my control.)[/color]
[color=blue]
> When a checkpoint occurs, all operations slow way, way down.[/color]

Not too surprising; you haven't got enough I/O bandwidth.
[color=blue]
> Does anyone have any experience in modifying the priority of the
> checkpoint process itself, (re-nicing it)?[/color]

That would be a waste of time, because your problem is with I/O usage
not CPU usage, and nice doesn't impact I/O scheduling AFAIK.

You might be able to get somewhere by inserting intrapage delays into
the checkpoint write loop, similar to what's been done to VACUUM since
7.4. (I have a todo item to do this for CVS tip, in fact.) You'd not
want this to happen during a shutdown checkpoint, but for ordinary
checkpoints I don't believe there's any problem with spacing out the
writes.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

  #5  
Old November 23rd, 2005, 01:09 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: Trying to minimize the impact of checkpoints (resend)

jao@geophile.com writes:[color=blue]
> I'm using PostgreSQL 7.3.4 on RH9. Data and logs are on separate
> disks. (These are low-end IDE disks. That part of the problem
> is out of my control.)[/color]
[color=blue]
> When a checkpoint occurs, all operations slow way, way down.[/color]

Not too surprising; you haven't got enough I/O bandwidth.
[color=blue]
> Does anyone have any experience in modifying the priority of the
> checkpoint process itself, (re-nicing it)?[/color]

That would be a waste of time, because your problem is with I/O usage
not CPU usage, and nice doesn't impact I/O scheduling AFAIK.

You might be able to get somewhere by inserting intrapage delays into
the checkpoint write loop, similar to what's been done to VACUUM since
7.4. (I have a todo item to do this for CVS tip, in fact.) You'd not
want this to happen during a shutdown checkpoint, but for ordinary
checkpoints I don't believe there's any problem with spacing out the
writes.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles