Re: [HACKERS] lseek/read/write overhead becomes visible at scale .. - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] lseek/read/write overhead becomes visible at scale ..
Date
Msg-id CAEepm=3BGNbWaznawm3LVk69ucKqXdAcb-aboG8cK375GcsMdQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] lseek/read/write overhead becomes visible at scale ..  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] lseek/read/write overhead becomes visible at scale ..
List pgsql-hackers
On Fri, Jun 23, 2017 at 4:50 AM, Andres Freund <andres@anarazel.de> wrote:
> On 2017-06-22 12:43:16 -0400, Robert Haas wrote:
>> On Wed, Jan 25, 2017 at 2:52 PM, Andres Freund <andres@anarazel.de> wrote:
>> > You'll, depending on your workload, still have a lot of lseeks even if
>> > we were to use pread/pwrite because we do lseek(SEEK_END) to get file
>> > sizes.
>>
>> I'm pretty convinced that the lseek overhead that we're incurring
>> right now is excessive.
>
> No argument there.

My 2c:

* every comparable open source system I looked at uses pread() if it's available
* speedups have been claimed
* it's also been claimed that readahead heuristics are not defeated on
Linux or FreeBSD, which isn't too surprising because you'd expect it
to be about blocks being faulted in, not syscalls
* just in case there exists an operating system that has pread() but
doesn't do readahead in that case, we could provide a compile-time
option to select the fallback mode (until such time as you can get
that bug fixed in your OS?)
* syscalls aren't getting cheaper, and this is a 2-for-1 deal, what's
not to like?

+1 for adopting pread()/pwrite() in PG12.

I understand that the use of lseek() to find file sizes is a different
problem and unrelated.

-- 
Thomas Munro
http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Reopen logfile on SIGHUP
Next
From: Andrew Gierth
Date:
Subject: Re: [HACKERS] lseek/read/write overhead becomes visible at scale ..