Re: performance on new linux box

Поиск
Список
Период
Сортировка
От Pierre C
Тема Re: performance on new linux box
Дата
Msg-id op.vfwp121reorkce@apollo13
обсуждение исходный текст
Ответ на Re: performance on new linux box  (Ben Chobot <bench@silentmedia.com>)
Список pgsql-performance
> Most (all?) hard drives have cache built into them. Many raid cards have
> cache built into them. When the power dies, all the data in any cache is
> lost, which is why it's dangerous to use it for write caching. For that
> reason, you can attach a BBU to a raid card which keeps the cache alive
> until the power is restored (hopefully). But no hard drive I am aware of
> lets you attach a battery, so using a hard drive's cache for write
> caching will always be dangerous.
>
> That's why many raid cards will always disable write caching on the hard
> drives themselves, and only enable write caching using their own memory
> when a BBU is installed.
>
> Does that make more sense?
>

Actually write cache is only dangerous if the OS and postgres think some
stuff is written to the disk when in fact it is only in the cache and not
written yet. When power is lost, cache contents are SUPPOSED to be lost.
In a normal situation, postgres and the OS assume nothing is written to
the disk (ie, it may be in cache not on disk) until a proper cache flush
is issued and responded to by the hardware. That's what xlog and journals
are for. If the hardware doesn't lie, and the kernel/FS doesn't have any
bugs, no problem. You can't get decent write performance on rotating media
without a write cache somewhere...


В списке pgsql-performance по дате отправления:

Предыдущее
От: Ben Chobot
Дата:
Сообщение: Re: performance on new linux box
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: performance on new linux box