Re: full_page_writes on SSD?

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: full_page_writes on SSD?
Date: 2015-11-25 11:47:51
Message-ID: 56559FE7.2050706@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/24/2015 08:40 PM, John R Pierce wrote:
> On 11/24/2015 10:48 AM, Marcin Mańk wrote:
>> I saw this:
>> http://blog.pgaddict.com/posts/postgresql-on-ssd-4kb-or-8kB-pages
>>
>> It made me wonder: if SSDs have 4kB/8kB sectors, and we'd make the
>> Postgres page size equal to the SSD page size, do we still need
>> full_page_writes?
>
>
> an SSD's actual write block is much much larger than that. they
> emulate 512 or 4k sectors, but they are not actually written in
> sector order, rather new writes are accumulated in a buffer on the
> drive, then written out to a whole block, and a sector mapping table
> is maintained by the drive.

I don't see how that's related to full_page_writes?

It's true that SSDs optimize the writes in various ways, generally along
the lines you described, because they do work with "erase
blocks"(generally 256kB - 1MB chunks) and such.

But the internal structure of SSD has very little to do with FPW because
what matters is whether the on-drive write cache is volatile or not (SSD
can't really work without it).

What matters (when it comes to resiliency to torn pages) is the page
size at the OS level, because that's what's being handed over to the SSD.

Of course, there might be other benefits of further lowering page sizes
at the OS/database level (and AFAIK there are SSD drives that use pages
smaller than 4kB).

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2015-11-25 11:51:50 Re: Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"
Previous Message Tomas Vondra 2015-11-25 11:38:08 Re: full_page_writes on SSD?