How to get HugePages to be used on Linux?
Wed May 6 18:29:30 CEST 2020
On Wed, May 6, 2020 at 4:51 PM Vans S <vans_163@REDACTED> wrote:
> Has anyone gotten Erlang to use hugepages on linux? I allocated the default 2MB pages via kernel param, but I see they are not used when I run erlang, I also made it allocated in 2047 sized blocks as recommended by WhatsApp team (tho why 2047 and not 2048).
> Also what about disabling THP, anyone tested with and without?
I did some experiments a few years ago with hugepages and 2TB RAM servers.
First THP (transparent hugepages) did not work well, as they caused
major responsiveness issues whenever the kernel decided to "do stuff"
behind our back. We always disable THP, and folks at EUC (now Code
BEAM Sto) mentioned doing the same. Maybe the 4.x/5.x kernels have
improved, but CentOS 7 is definitely affected. YMMV.
Second, without THP you need to tell the kernel explicitly to give you
hugepages via a flag in mmap(). Back then (R15-ish) OTP wouldn't do
that so I had to hack it in, but it didn't help much as we were
dominated by other costs.
Later on they added Super Carriers (pre-allocation), and that's a
must-have for large RAM nodes. Mapping those with explicit hugepages
should be beneficial, but OTP would still need a patch to do so.
More information about the erlang-questions