Does TiDB recommend enabling HugePages?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB 是否建议启用 HugePages?

| username: OnTheRoad

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?

| username: Kongdom | Original post link

There are related suggestions

| username: OnTheRoad | Original post link

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.

| username: Kongdom | Original post link

Oh… I see, I misunderstood.

| username: alfred | Original post link

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.

| username: cs58_dba | Original post link

If it is compatible with MySQL, it should not be enabled.

| username: OnTheRoad | Original post link

Enabling HugePage in MySQL allows only the InnoDB buffer to utilize HugePage.

| username: 特雷西-迈克-格雷迪 | Original post link

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.

| username: kooooooooo | Original post link

HugePage is enabled by default, right?

| username: forever | Original post link

Compatibility with MySQL is only at the protocol level; the underlying database is entirely different. This evaluation cannot be based on MySQL’s evaluation.

| username: wuxiangdong | Original post link

Previously, Oracle had hugepages enabled, which makes memory lookup faster and reduces the traversal of memory blocks.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.