Re: WAL prefetch

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Sean Chittenden <seanc(at)joyent(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, sean(at)chittenden(dot)org
Subject: Re: WAL prefetch
Date: 2018-07-09 22:02:12
Message-ID: 3842d035-e083-6d90-b04d-6bbdcf0b19f3@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09.07.2018 21:28, Andres Freund wrote:
> Hi,
>
> On 2018-07-09 11:59:06 +0200, Tomas Vondra wrote:
>>> * During the design phase, I looked into using bgworkers but given the number of
>>> in-flight pread(2) calls required to fully utilize the IO subsystem, I opted
>>> for something threaded (I was also confined to using Solaris which doesn't
>>> support posix_fadvise(2), so I couldn't sequentially dispatch async
>>> posix_fadvise(2) calls and hope for the best).
>>>
>> Hmm, yeah. I'm not sure what to do with this. Using many (thousands?) of
>> prefetch processes seems like a bad idea - we surely can't make them regular
>> bgworkers. Perhaps we could use one process with many threads?
>> Presumably if we knew about a better way to do prefetching without
>> posix_fadvise, we'd have implemented it in FilePrefetch(). But we just error
>> out instead :-(
> Solaris is dead. We shouldn't design for it... I think there's decent
> reasons to go for a non fadvise approach, but solaris imo isn't one of
> them.
>
> Greetings,
>
> Andres Freund
I have attached to the first my mail in this thread small utility for
measuring effect of data prefetch for random reads.
At my desktop posix_fadvise performed in one thread demostrated the best
results, comparing with pread in any number of threads.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2018-07-09 22:23:08 Re: Locking B-tree leafs immediately in exclusive mode
Previous Message Tom Lane 2018-07-09 21:59:16 Re: no partition pruning when partitioning using array type