pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shane Ambler <pgsql@Sheeky.Biz>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Peter Kovacs <maxottovonstirlitz@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Carlos Moreno <moreno_pg@mochima.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Two hard drives --- what to do with them?
Date: Tue, 27 Feb 2007 15:35:13 +1030
Message-ID: <45E3BC09.60100@Sheeky.Biz> (raw)
In-Reply-To: <1172535914.10824.327.camel@dogma.v10.wvs>
References: <45DF3B15.1070609@3times25.net>
	<45DF5DA9.90002@commandprompt.com>
	<45DF6154.5090205@3times25.net>
	<1d4e0c10702231425ke37a732y36e241902fe0aa55@mail.gmail.com>
	<45DF94BF.6050904@3times25.net>
	<45E0A500.1010707@commandprompt.com>
	<45E104DD.3080600@mochima.com>
	<2055.1172375931@sss.pgh.pa.us>
	<b6e8f2e80702251411q5a27eb53re9c2a299b8e3880a@mail.gmail.com>
	<1172526666.10824.315.camel@dogma.v10.wvs>
	<b6e8f2e80702261611j598b1771g3dbcfc9bb1f9cdf2@mail.gmail.com>
	<1172535914.10824.327.camel@dogma.v10.wvs>

Jeff Davis wrote:

>> Sorry for for not being familar with storage techonologies... Does
>> "battery" here mean battery in the common sense of the word - some
>> kind of independent power supply? Shouldn't the disk itself be backed
>> by a battery? As should the entire storage subsystem?
>>
> 
> Yes, a battery that can hold power to keep data alive in the write cache
> in case of power failure, etc., for a long enough time to recover and
> commit the data to disk.

Just to expand a bit - the battery backup options are available on some 
raid cards - that is where you would be looking for it. I don't know of 
any hard drives that have it built in.

Of cause another reason to have a UPS for the server - keep it running 
long enough after the clients have gone down so that it can ensure 
everything is on disk and shuts down properly.

> So, a write cache is OK (even for pg_xlog) if it is durable (i.e. on
> permanent storage or backed by enough power to make sure it gets there).
> However, if PostgreSQL has no way to know whether a write is durable or
> not, it can't guarantee the data is safe.
> 
> The reason this becomes an issue is that many consumer-grade disks have
> write cache enabled by default and no way to make sure the cached data
> actually gets written. So, essentially, these disks "lie" and say they
> wrote the data, when in reality, it's in volatile memory. It's
> recommended that you disable write cache on such a device.

 From all that I have heard this is another advantage of SCSI disks - 
they honor these settings as you would expect - many IDE/SATA disks 
often say "sure I'll disable the cache" but continue to use it or don't 
retain the setting after restart.


-- 

Shane Ambler
pgSQL@Sheeky.Biz

Get Sheeky @ http://Sheeky.Biz



view thread (16+ messages)  latest in thread

Message-ID: <45E3BC09.60100@Sheeky.Biz>
Permalink:  ../45E3BC09.60100@Sheeky.Biz/
Also on:    postgresql.org/message-id/45E3BC09.60100@Sheeky.Biz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pgsql@Sheeky.Biz, pgsql@j-davis.com, maxottovonstirlitz@gmail.com, tgl@sss.pgh.pa.us, moreno_pg@mochima.com
  Subject: Re: Two hard drives --- what to do with them?
  In-Reply-To: <45E3BC09.60100@Sheeky.Biz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox