too low NAPTIME_PER_CYCLE /too many wakeups in walreceiver.c

Started by Andres Freundalmost 14 years ago2 messageshackers
Jump to latest
#1Andres Freund
andres@anarazel.de

Hi,

Currently the walreceiver wakeups NAPTIME_PER_CYCLE=100 miliseconds in idle
state. This is rather frequent. I don't really see any reason to do so.
A nice fix would be to latchify that with WaitLatchOrSocket + a SetLatch in
the signal handler for shutdown but that seems to be too invasive at that
point. So I suggest simply increasing NAPTIME_PER_CYCLE to 500 or 1000ms?

Andres

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

#2Fujii Masao
masao.fujii@gmail.com
In reply to: Andres Freund (#1)
Re: too low NAPTIME_PER_CYCLE /too many wakeups in walreceiver.c

On Wed, May 30, 2012 at 9:57 PM, Andres Freund <andres@2ndquadrant.com> wrote:

Hi,

Currently the walreceiver wakeups NAPTIME_PER_CYCLE=100 miliseconds in idle
state. This is rather frequent. I don't really see any reason to do so.
A nice fix would be to latchify that with WaitLatchOrSocket + a SetLatch in
the signal handler for shutdown but that seems to be too invasive at that
point. So I suggest simply increasing NAPTIME_PER_CYCLE to 500 or 1000ms?

Or calculate the sleep time from wal_receiver_status_interval in each
cycle and use it?

Regards,

--
Fujii Masao