Re: patch for new feature: Buffer Cache Hibernation

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: patch for new feature: Buffer Cache Hibernation
Дата
Msg-id 1304524354-sup-1810@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: patch for new feature: Buffer Cache Hibernation  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: patch for new feature: Buffer Cache Hibernation
Список pgsql-hackers
Excerpts from Tom Lane's message of mié may 04 12:44:36 -0300 2011:

> This seems like a lot of complication for rather dubious gain.  What
> happens when the DBA changes the shared_buffers setting, for instance?
> How do you protect against the cached buffers getting out-of-sync with
> the actual disk files (especially during recovery scenarios)?  What
> about crash-induced corruption in the cache file itself (consider the
> not-unlikely possibility that init will kill the database before it's
> had time to dump all the buffers during a system shutdown)?  Do you have
> any proof that writing out a few GB of buffers and then reading them
> back in is actually much cheaper than letting the database re-read the
> data from the disk files?

I thought the idea wasn't to copy the entire buffer but only a
descriptor, so that the buffer would be loaded from the original page.

If shared_buffers changes, there's no problem.  If the new setting is
smaller, then the last paages would just not be copied, and would have
to be read from disk the first time they are accessed.  If the new
setting is larger, then the last few buffers would remain unused until
requested.

As for gain, I have heard of test setups requiring hours of runtime in
order to prime the buffer cache.

Crash safety would have to be researched, sure.  Maybe only do it in
clean shutdown.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: patch for new feature: Buffer Cache Hibernation
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: "full_page_writes" makes no difference?