The official deployment documentation only mentions the need to disable THP (Transparent Huge Page), which is also a requirement for most database deployments. However, for Oracle and PG, to improve memory allocation efficiency on servers with large memory, it is recommended to enable HugePage.
Does TiDB recommend enabling HugePage? If so, could this part of the operation be added to the official documentation?
HugePage and THP are completely different things. Although both are large page memory management mechanisms, their management mechanisms are different. HugePage (standard large page) management is a pre-allocation method, while THP (transparent huge page) management is a dynamic allocation method. Because databases are memory-intensive services, databases with process models like Oracle and PG recommend disabling THP and enabling HugePages to improve large memory management efficiency.
Oracle and PG recommend enabling HugePages and disabling Transparent HugePages (THP). MySQL doesn’t seem to recommend enabling HugePages, so TiDB should be similar to MySQL in this regard.
TiDB does not recommend enabling huge pages because if there is a lot of fragmentation, you always need to allocate a relatively large amount of memory. When you request more, there won’t be enough memory to allocate, which can result in significant delays.
Compatibility with MySQL is only at the protocol level; the underlying database is entirely different. This evaluation cannot be based on MySQL’s evaluation.