Re: Increasing checkpoint_segments - Any bad thing might happen? - Mailing list pgsql-general

From Craig Ringer
Subject Re: Increasing checkpoint_segments - Any bad thing might happen?
Date
Msg-id 4BE77833.6010205@postnewspapers.com.au
Whole thread Raw
In response to Increasing checkpoint_segments - Any bad thing might happen?  (Yan Cheng CHEOK <yccheok@yahoo.com>)
List pgsql-general
On 10/05/10 08:54, Yan Cheng CHEOK wrote:
> I realize that, when I have 1 threads perform frequent read, and another 3 threads to perform frequent write. I will
getthe following error log *sometimes* 
>
> 2010-05-07 17:16:10 MYT LOG checkpoints are occurring too frequently (22 seconds apart)
> 2010-05-07 17:16:10 MYT HINT Consider increasing the configuration parameter "checkpoint_segments".
> 2010-05-07 17:31:37 MYT LOG checkpoints are occurring too frequently (29 seconds apart)
> 2010-05-07 17:31:37 MYT HINT Consider increasing the configuration parameter "checkpoint_segments".

This is a performance warning.

> My observation is, even the above logging happen, "write" operation is success when I exam the content of database.
>
> What happen is that, the read operation fail.

Er, what?

> read thread is spawned after 3 write threads, and read thread will only be considered as "success", only when its
readresult is same as what is being written by the 3 threads. The read threads will perform retry for every 200ms,
lastedfor 4 seconds. 

OOOoooh, the readers aren't failing at all, they're just not returning
the results you expect.

At a guess, your code has a race condition, where readers are not
synchronizing themselves properly with writers. Remember that readers
cannot see what writers have written until the writer commits that work.

> I was thinking, what is the consequent of increasing "checkpoint_segments", say, from 3 to 6. Any bad thing might
happen?

No, nothing bad. It can increase the size of the WAL stored on disk, but
that's about it.

--
Craig Ringer

pgsql-general by date:

Previous
From: Yan Cheng CHEOK
Date:
Subject: Increasing checkpoint_segments - Any bad thing might happen?
Next
From: "Boyd, Craig"
Date:
Subject: Re: Query that produces index information for a Table