Remix.run Logo
ozgrakkurt 4 hours ago

It is a crime that postgres isn't able to allocate with 1GB huge pages by changing a config parameter in 2026

Also a crime that people are still running databases with 4kb pages.

To put it in perspective, this means you will have more than 30 million pages on a server with 128GB RAM. As an example, if there is 16bytes of metadata for memory page. The metadata itself would take more than half a gigabyte.

ldargin 2 hours ago | parent | next [-]

Database systems lock pages when writing to them, to maintain integrity. Using 1GB pages would cause excessive blocking in many if not most transactional databases.

jlokier 2 hours ago | parent [-]

In database engines that use page locks, the locked page size can be different from the file/mapped/allocated page sizes. If you still have excessive locking while using smaller page locks, there are other ways to reduce contention as well, such as CoW to protect concurrent reads, deferred write-merging to assist concurrent writes, and the storage equivalent of RCU.

dezgeg 4 hours ago | parent | prev | next [-]

Even worse, the actual struct page on Linux is 64 bytes, so 4x your example

bonzini 4 hours ago | parent | prev | next [-]

There is 64 bytes of metadata per memory page indeed.

andrewstuart 3 hours ago | parent | prev [-]

Sensible defaults would be nice.