Files
ubicloud/rhizome/postgres/spec
shikharbhardwaj 6f6267ce29 Configure hugepages for Postgres
This commit introduces a hugepages configuration for postgres via a
rhizome lib+bin.

At the moment, it uses the default huge page size (2M), and calculates
the number of huge pages as 25% of the total available memory. The setup
adjusts the shared_buffers accordingly to fit the shared memory within
the allocated number of hugepages.

The configuration happens as an `ExecStartPre` script added to the
existing systemd unit managed by pg_ctlcluster. To keep the semantics of
the `start` command unchanged, the hugepages script *does not* stop an
existing cluster to configure hugepages, and only does it when the
cluster is not running.

In a subsequent change, we can consider adding the boot parameters to
setup 1G hugepages for larger instances (possibly standard-30+), where
they are most useful.

[1]: https://www.postgresql.org/docs/current/kernel-resources.html#LINUX-HUGE-PAGES
2025-06-30 17:16:50 +05:30
..