O_DIRECT for relations and SLRUs (Prototype)
От | Michael Paquier |
---|---|
Тема | O_DIRECT for relations and SLRUs (Prototype) |
Дата | |
Msg-id | 20190112044632.GA21945@paquier.xyz обсуждение исходный текст |
Ответы |
Re: O_DIRECT for relations and SLRUs (Prototype)
Re: O_DIRECT for relations and SLRUs (Prototype) |
Список | pgsql-hackers |
Hi all, (Added Kevin in CC) There have been over the ages discussions about getting better O_DIRECT support to close the gap with other players in the database market, but I have not actually seen on those lists a patch which makes use of O_DIRECT for relations and SLRUs (perhaps I missed it, anyway that would most likely conflict now). Attached is a toy patch that I have begun using for tests in this area. That's nothing really serious at this stage, but you can use that if you would like to see the impact of O_DIRECT. Of course, things get significantly slower. The patch is able to compile, pass regression tests, and looks stable. So that's usable for experiments. The patch uses a GUC called direct_io, enabled to true to ease regression testing when applying it. Note that pg_attribute_aligned() cannot be used as that's not an option with clang and a couple of other comilers as far as I know, so the patch uses a simple set of placeholder buffers large enough to be aligned with the OS pages, which should be 4k for Linux by the way, and not set to BLCKSZ, but for WAL's O_DIRECT we don't really care much with such details. If there is interest for such things, perhaps we could get a patch sorted out, with some angles of attack like: - Move to use of page-aligned buffers for relations and SLRUs. - Split use of O_DIRECT for SLRU and relations into separate GUCs. - Perhaps other things. However this is a large and very controversial topic, and of course more complex than the experiment attached, still this prototype is fun to play with. Thanks for reading! -- Michael
Вложения
В списке pgsql-hackers по дате отправления: