Re: wal_sender_delay is still required?

Lists: pgsql-hackers
From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: wal_sender_delay is still required?
Date: 2010-12-06 08:13:10
Message-ID: AANLkTim4cdyXoT5ZvXbhNq0eLP-jQLJh_3R7u9LL6ofY@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Walsender doesn't need the periodic wakeups anymore, thanks to
the latch feature. So wal_sender_delay is basically useless now.
How about dropping wal_sender_delay or increasing the default
value?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2010-12-06 15:08:21
Message-ID: 25969.1291648101@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> Walsender doesn't need the periodic wakeups anymore, thanks to
> the latch feature. So wal_sender_delay is basically useless now.
> How about dropping wal_sender_delay or increasing the default
> value?

If we don't need it, we should remove it.

regards, tom lane


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2010-12-07 02:37:25
Message-ID: AANLkTikEk-Cqd3=L7A3eOWG7z2Te8N=tPdguXM__RCHM@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Dec 7, 2010 at 12:08 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>> Walsender doesn't need the periodic wakeups anymore, thanks to
>> the latch feature. So wal_sender_delay is basically useless now.
>> How about dropping wal_sender_delay or increasing the default
>> value?
>
> If we don't need it, we should remove it.

The attached patch removes wal_sender_delay and uses hard-coded
10 seconds instead of wal_sender_delay as the delay between activity
rounds for walsender.

One problem with the patch is that it takes longer (at most 10s) to
detect the unexpected death of postmaster (by calling PostmasterIsAlive()).
This is OK for me. But does anyone want to specify the delay to detect
that within a short time?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
drop_wal_sender_delay_v1.patch application/octet-stream 4.5 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2010-12-07 02:49:52
Message-ID: 7487.1291690192@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> One problem with the patch is that it takes longer (at most 10s) to
> detect the unexpected death of postmaster (by calling PostmasterIsAlive()).
> This is OK for me. But does anyone want to specify the delay to detect
> that within a short time?

Oh. Hm. I'm hesitant to remove the setting if there's still some
behavior that it would control. Maybe we should just crank up the
default value instead.

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2010-12-07 03:02:00
Message-ID: 1291690732-sup-5802@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from Tom Lane's message of lun dic 06 23:49:52 -0300 2010:
> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> > One problem with the patch is that it takes longer (at most 10s) to
> > detect the unexpected death of postmaster (by calling PostmasterIsAlive()).
> > This is OK for me. But does anyone want to specify the delay to detect
> > that within a short time?
>
> Oh. Hm. I'm hesitant to remove the setting if there's still some
> behavior that it would control. Maybe we should just crank up the
> default value instead.

Maybe we should have a single tunable for processes that just sleep
waiting for events or postmaster death. For example pgstats has a
hardcoded 2 seconds, and the archiver process has a hardcoded value too
AFAICS.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2010-12-07 03:07:20
Message-ID: AANLkTi=oWz9XUqORUHH3Fx_ee+4dKkzDMfvO7_NBFGsf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Dec 7, 2010 at 11:49 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>> One problem with the patch is that it takes longer (at most 10s) to
>> detect the unexpected death of postmaster (by calling PostmasterIsAlive()).
>> This is OK for me. But does anyone want to specify the delay to detect
>> that within a short time?
>
> Oh.  Hm.  I'm hesitant to remove the setting if there's still some
> behavior that it would control.  Maybe we should just crank up the
> default value instead.

Fair enough. How about increasing the default to 10 seconds?
Since bgwriter has already using 10s as a nap time if there is no
configured activity, I think that 10s is non-nonsense default value.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2010-12-07 03:22:57
Message-ID: AANLkTike+VzydFsEgjqTCKcobp302izpiRYHa==wgdMB@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Dec 6, 2010 at 10:07 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Tue, Dec 7, 2010 at 11:49 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>>> One problem with the patch is that it takes longer (at most 10s) to
>>> detect the unexpected death of postmaster (by calling PostmasterIsAlive()).
>>> This is OK for me. But does anyone want to specify the delay to detect
>>> that within a short time?
>>
>> Oh.  Hm.  I'm hesitant to remove the setting if there's still some
>> behavior that it would control.  Maybe we should just crank up the
>> default value instead.
>
> Fair enough. How about increasing the default to 10 seconds?
> Since bgwriter has already using 10s as a nap time if there is no
> configured activity, I think that 10s is non-nonsense default value.

What do we get out of making this non-configurable?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2010-12-07 03:51:58
Message-ID: AANLkTinO2Xm9c+szttMc3WpeU_CfAcymZK7rQk_8mAn3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Dec 7, 2010 at 12:22 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> Fair enough. How about increasing the default to 10 seconds?
>> Since bgwriter has already using 10s as a nap time if there is no
>> configured activity, I think that 10s is non-nonsense default value.
>
> What do we get out of making this non-configurable?

Which would make the setting of replication simpler, I think.
But I agree to just increase the default value of wal_sender_delay
rather than dropping it.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2010-12-07 05:22:14
Message-ID: 14769.1291699334@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Maybe we should have a single tunable for processes that just sleep
> waiting for events or postmaster death. For example pgstats has a
> hardcoded 2 seconds, and the archiver process has a hardcoded value too
> AFAICS.

That would make sense once we get to the point where for all of those
processes, the sleep delay *only* affects the time to notice postmaster
death. Right now I think there are still several other behaviors mixed
in with that, and not all of them necessarily want the same response
time.

regards, tom lane


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wal_sender_delay is still required?
Date: 2011-02-26 21:12:59
Message-ID: 4D696CDB.1080103@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 07.12.2010 05:51, Fujii Masao wrote:
> On Tue, Dec 7, 2010 at 12:22 PM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
>>> Fair enough. How about increasing the default to 10 seconds?
>>> Since bgwriter has already using 10s as a nap time if there is no
>>> configured activity, I think that 10s is non-nonsense default value.
>>
>> What do we get out of making this non-configurable?
>
> Which would make the setting of replication simpler, I think.
> But I agree to just increase the default value of wal_sender_delay
> rather than dropping it.

I dropped the ball on this one..

For comparison, the archiver process and autovacuum launcher wake up
once a second to check if postmaster is still alive. bgwriter, when
bgwriter_lru_maxpages and archive_timeout are set to 0 to disable it,
checks for dead postmaster every 10 seconds.

I'll bump the default for wal_sender_delay to 1 second. Maybe an even
higher value would be good, but it also seems good to kill replication
connections in a timely fashion if postmaster dies.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com