Re: How filesystems matter with PostgreSQL

From: Jon Schewe <jpschewe(at)mtu(dot)net>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: How filesystems matter with PostgreSQL
Date: 2010-06-06 00:07:08
Message-ID: 4C0AE6AC.9080501@mtu.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 06/05/2010 07:02 PM, Scott Marlowe wrote:
> On Sat, Jun 5, 2010 at 5:58 PM, Jon Schewe <jpschewe(at)mtu(dot)net> wrote:
>
>> On 06/05/2010 06:54 PM, Scott Marlowe wrote:
>>
>>> On Sat, Jun 5, 2010 at 5:03 PM, Jon Schewe <jpschewe(at)mtu(dot)net> wrote:
>>>
>>>
>>>> On 06/05/2010 05:52 PM, Greg Smith wrote:
>>>>
>>>>
>>>>> Jon Schewe wrote:
>>>>>
>>>>>
>>>>>>> If that's the case, what you've measured is which filesystems are
>>>>>>> safe because they default to flushing drive cache (the ones that take
>>>>>>> around 15 minutes) and which do not (the ones that take >=around 2
>>>>>>> hours). You can't make ext3 flush the cache correctly no matter what
>>>>>>> you do with barriers, they just don't work on ext3 the way PostgreSQL
>>>>>>> needs them to.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> So the 15 minute runs are doing it correctly and safely, but the slow
>>>>>> ones are doing the wrong thing? That would imply that ext3 is the safe
>>>>>> one. But your last statement suggests that ext3 is doing the wrong
>>>>>> thing.
>>>>>>
>>>>>>
>>>>>>
>>>>> I goofed and reversed the two times when writing that. As is always
>>>>> the case with this sort of thing, the unsafe runs are the fast ones.
>>>>> ext3 does not ever do the right thing no matter how you configure it,
>>>>> you have to compensate for its limitations with correct hardware setup
>>>>> to make database writes reliable.
>>>>>
>>>>>
>>>>>
>>>> OK, so if I want the 15 minute speed, I need to give up safety (OK in
>>>> this case as this is just research testing), or see if I can tune
>>>> postgres better.
>>>>
>>>>
>>> Or use a trustworthy hardware caching battery backed RAID controller,
>>> either in RAID mode or JBOD mode.
>>>
>>>
>> Right, because the real danger here is if the power goes out you can end
>> up with a scrambled database, correct?
>>
> Correct. Assuming you can get power applied again before the battery
> in the RAID controller dies, it will then flush out its cache and your
> data will still be coherent.
>
Or if you really don't care if your database is scrambled after a power
outage you can go without the battery backed RAID controller.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2010-06-06 03:34:08 Re: How filesystems matter with PostgreSQL
Previous Message Scott Marlowe 2010-06-06 00:02:18 Re: How filesystems matter with PostgreSQL