Re: fsync and hardware write cache

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: fsync and hardware write cache
Дата
Msg-id 20040824001200.GA22069@gp.word-to-the-wise.com
обсуждение исходный текст
Ответ на Re: fsync and hardware write cache  (Manfred Spraul <manfred@colorfullife.com>)
Список pgsql-hackers
On Mon, Aug 23, 2004 at 10:19:20PM +0200, Manfred Spraul wrote:

> >Does it make sense to add a platform specific call that will flush a write
> >cache when fsync is enable?
> >
> Pete Zaitsev from mysql wrote that there is a special call on Mac OS:
> Quoting him:
> 
> >Mac OS X also has this "optimization", but at least it provides an
> >alternative flush method for Database Servers:
> >
> >fcntl(fd, F_FULLFSYNC, NULL)
> >
> >can be used instead of fsync() to get true fsync() behavior. 
> >
> 
> I couldn't confirm this with a quick google search - perhaps someone 
> with MacOS docs (or mysql sources) should check it.

I can confirm it exists.

#define F_FULLFSYNC  51 /* fsync + ask the drive to flush to the media */

> What might be useful is a test tool that benchmarks fsync: if it's 
> faster than the rotational speed of a 15k rpm disk then probably someone 
> caches the write calls.

I played with doing that - and can't find any system where a naive
looped write, fsync, write, fsync took more that about 600us, so I
guess I'm missing something somewhere.

Cheers, Steve



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: PITR: XLog File compression on Archive
Следующее
От: Chris
Дата:
Сообщение: 8.0 beta 1 on linux-mipsel R5900