Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Dave Chinner <david(at)fromorbit(dot)com>
Cc: Jim Nasby <jim(at)nasby(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Mel Gorman <mgorman(at)suse(dot)de>, Josh Berkus <josh(at)agliodbs(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joshua Drake <jd(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "lsf-pc(at)lists(dot)linux-foundation(dot)org" <lsf-pc(at)lists(dot)linux-foundation(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance
Date: 2014-01-15 15:02:01
Message-ID: 52D6A2E9.3040502@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/15/2014 07:50 AM, Dave Chinner wrote:
> However, the first problem is dealing with the IO storm problem on
> fsync. Then we can measure the effect of spreading those writes out
> in time and determine what triggers read starvations (if they are
> apparent). The we can look at whether IO scheduling tweaks or
> whether blk-io throttling solves those problems. Or whether
> something else needs to be done to make it work in environments
> where problems are manifesting.
>
> FWIW [and I know you're probably sick of hearing this by now], but
> the blk-io throttling works almost perfectly with applications that
> use direct IO.....

For checkpoint writes, direct I/O actually would be reasonable.
Bypassing the OS cache is a good thing in that case - we don't want the
written pages to evict other pages from the OS cache, as we already have
them in the PostgreSQL buffer cache.

Writing one page at a time with O_DIRECT from a single process might be
quite slow, so we'd probably need to use writev() or asynchronous I/O to
work around that.

We'd still need to issue an fsync() to flush any already-written pages
from the OS cache to disk, though.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Kara 2014-01-15 15:03:20 Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance
Previous Message Simon Riggs 2014-01-15 14:57:53 Re: ALTER TABLE lock strength reduction patch is unsafe