Re: WAL Re-Writes

From: Jan Wieck <jan(at)wi3ck(dot)info>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WAL Re-Writes
Date: 2016-01-31 21:26:50
Message-ID: 56AE7C1A.1050306@wi3ck.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/27/2016 08:30 AM, Amit Kapila wrote:
> operation. Now why OS couldn't find the corresponding block in
> memory is that, while closing the WAL file, we use
> POSIX_FADV_DONTNEED if wal_level is less than 'archive' which
> lead to this problem. So with this experiment, the conclusion is that
> though we can avoid re-write of WAL data by doing exact writes, but
> it could lead to significant reduction in TPS.

POSIX_FADV_DONTNEED isn't the only way how those blocks would vanish
from OS buffers. If I am not mistaken we recycle WAL segments in a round
robin fashion. In a properly configured system, where the reason for a
checkpoint is usually "time" rather than "xlog", a recycled WAL file
written to had been closed and not touched for about a complete
checkpoint_timeout or longer. You must have a really big amount of spare
RAM in the machine to still find those blocks in memory. Basically we
are talking about the active portion of your database, shared buffers,
the sum of all process local memory and the complete pg_xlog directory
content fitting into RAM.

Regards, Jan

--
Jan Wieck
Senior Software Engineer
http://slony.info

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-01-31 22:11:38 Re: PATCH: index-only scans with partial indexes
Previous Message Joshua D. Drake 2016-01-31 17:44:39 Re: Template for commit messages