3 ms·
It's the difference of configuring the kernel to pre-allocate the contiguous memory for huge page allocation vs. _transparent_ huge pages that requires the kern
by gladiatr72 4y ago
It's the difference of configuring the kernel to pre-allocate the contiguous memory for huge page allocation vs. _transparent_ huge pages that requires the kernel compaction process.
Postgresql needs to be reconfigured to use them properly. The shared_buffers setting needs to be adjusted to allocate in [huge page size] units.
- pocketarc 4y agoI appreciate that, thanks for the explanation. I understand the difference between hugepages and transparent huge pages, I just don't understand how not using hugepages was impacting the parent's Postgres, or causing OOM errors. @menaerus actually has a great comment on this that digs deeper into it, looking forward to seeing what comes out of that thread as well.
- gnfargbl 4y agoI gave a more detailed response on the post by 'menaerus, but to answer your question on config directly, you first need to enable the appropriate number of hugepages with a kernel boot parameter, e.g. hugepagesz=1G hugepages=940 and then add these config lines to postgresql.conf: huge_pages = on huge_page_size = 1GB