Re: Multiple buffer cache?

Поиск
Список
Период
Сортировка
От Cédric Villemain
Тема Re: Multiple buffer cache?
Дата
Msg-id e94e14cd1002060825y60172149x6323b1aefd6cc1bb@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Multiple buffer cache?  ("Bret S. Lambert" <bret.lambert@gmail.com>)
Список pgsql-general
2010/2/6 Bret S. Lambert <bret.lambert@gmail.com>:
> On Sat, Feb 06, 2010 at 02:44:32PM +0100, C?dric Villemain wrote:
>> 2010/2/6 Bret S. Lambert <bret.lambert@gmail.com>:
>> > On Fri, Feb 05, 2010 at 11:41:13PM +0200, Alexei Vladishev wrote:
>> >> Greetings,
>> >>
>> >> Is there a way of configuring PostgreSQL so that one specific table would
>> >> use, say, 4GB of buffer cache while other tables would use the rest?
>> >>
>> >> I would like to keep the table and its indexes always in "hot"
>> >> state, so that
>> >> other queries won't pollute this part of the buffer cache. It would ensure
>> >> reliable performance and much less disk IOPS working with the table.
>> >
>> > Fiddling with the buffer cache like that would require some sort of
>> > OS support, if I'm not mistaken in what you're asking for.
>> >
>> > And then, even if the support is there, you'd need to outline exactly
>> > how you're planning on pushing this button.
>> >
>> > Specifically, what's your usage pattern that would make this a
>> > win for you?
>> >
>> > If the table and its indexes can already fit into the buffer cache,
>> > and it's as commonly accessed as you think it is, the OS should
>> > probably have it cached anyway.
>>
>> that's all true.
>>
>> I am working on pgfincore which allow in some way to prepare buffer cache.
>> You need pg > 8.4 and linux (probably working with bsd too)
>
> Why do something with a non-portable interface? Most OSes support
> coherently mmap(2)'ing disk blocks into memory; in fact, I'm somewhat
> taken aback that the postgres buffer cache isn't implemented in that
> manner, but I'm willing to give the devs credit for having not done
> so for good reasons.

currrently, pgfincore is implement via mmap'ing and mincore. This is
the mincore implementation which might differ.

In next release there will probably a system call 'fincore()' which is
probably going to be integrated in linux kernel.

Doing all of those in a portable way is not fully possible (thinks
windows), but it may be possible using #ifdef things to catch the good
system call for each OS (if possible/implemented).


>
>>
>> I don't consider it ready fo rproduction, but fine for debugging
>> things, if you reall care the buffer cache preload, tell me, I'll
>> stabilize the code in a shorter time ;)
>> http://villemain.org/projects/pgfincore
>>
>> >
>> >>
>> >> Is it possible?
>> >>
>> >> Thanks for any hints!
>> >>
>> >> Alexei
>> >>
>> >> --
>> >> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> >> To make changes to your subscription:
>> >> http://www.postgresql.org/mailpref/pgsql-general
>> >
>> > --
>> > Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> > To make changes to your subscription:
>> > http://www.postgresql.org/mailpref/pgsql-general
>> >
>>
>>
>>
>> --
>> C?dric Villemain
>



--
Cédric Villemain

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

Предыдущее
От: "BillR"
Дата:
Сообщение: Re: Multiple buffer cache?
Следующее
От: Cédric Villemain
Дата:
Сообщение: Re: Multiple buffer cache?