mmap for zeroing WAL log

Поиск
Список
Период
Сортировка
От Tom Lane
Тема mmap for zeroing WAL log
Дата
Msg-id 19434.983075333@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: mmap for zeroing WAL log
Список pgsql-hackers
[ redirected to pgsql-hackers instead of -patches ]

Matthew Kirkwood <matthew@hairy.beasts.org> writes:
> On Sat, 24 Feb 2001, Bruce Momjian wrote:
>> I am confused why mmap() is better than writing to a real file.

> It isn't, except that it allows to initialise the logfile in
> one syscall, without first allocating and zeroing (and hence
> dirtying) 16Mb of memory.

Uh, the existing code does not zero 16Mb of memory... it zeroes
8K and then writes that block repeatedly.  It's possible that the
overhead of a syscall for each 8K block is significant, but on the
other hand writing a block at a time is a heavily used and heavily
optimized path in all Unixen.  It's at least as plausible that the
mmap-as-source-of-zeroes path will be slower!

I think this is worth looking into, but I'm very far from being
sold on it...
        regards, tom lane


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

Предыдущее
От: ncm@zembu.com (Nathan Myers)
Дата:
Сообщение: Re: CommitDelay performance improvement
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PL/SQL-to-PL/pgSQL-HOWTO + PL/pgSQL documentation