Re: Remove or weaken hints about "effective resolution of sleep delays is 10 ms"?

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove or weaken hints about "effective resolution of sleep delays is 10 ms"?
Date: 2016-02-16 20:38:54
Message-ID: CAMkU=1zW=VwbM720D=BarW8LVnirffuPNynCBUxPMQ32Aykr3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 16, 2016 at 12:06 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Feb 10, 2016 at 5:15 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>> Hi,
>>
>> Several places in our docs have blurbs like
>>> Note that on many systems, the effective resolution of sleep delays is
>>> 10 milliseconds; setting <varname>wal_writer_delay</> to a value that
>>> is not a multiple of 10 might have the same results as setting it to
>>> the next higher multiple of 10.
>> Afaik that's not the case on any recent operating system/hardware. So
>> perhaps we should just remove all of those blurbs, or just replace them
>> with something like "on some older systems the effective resolution of
>> sleep delays is limited to multiples of 10 milliseconds"?
>
> Hmm, is that true? What we do we think the resolution is on modern
> systems? I would not have guessed that to be inaccurate.

time perl -le 'my $wait=0.00001; select undef,undef,undef,$wait
foreach (1..1/$wait*1); warn "should be 1 second"'

On CentOS 6.7 (not exactly modern) and Ubuntu Trusty, if I ask for 10
microsecond delays, I get between 70 and 100 microseconds delays
(depending on the VM software, mostly, it seems). So at least 100
fold better than the 10ms.

Of course if processes are fighting over CPU, you might do worse.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-02-16 20:54:50 Re: Re: [COMMITTERS] pgsql: Introduce group locking to prevent parallel processes from deadl
Previous Message Pavel Stehule 2016-02-16 20:19:27 Re: proposal: PL/Pythonu - function ereport