## 3.16.1  Transparent Huge Pages on Linux
Transparent Huge Pages (THP) is a feature that is generally activated for the Linux kernel shipped with SUSE Linux Enterprise Server (SLES) 11 and Red Hat Enterprise Linux (RHEL) 6 versions certified for usage with SAP HANA. Due to the special manner of SAP HANA's memory management, using THP may lead to hanging situations and performance degradation.
## Context
You experience that your SAP HANA database does not react anymore, that the CPU load is high and/or severe performance issues occur. Additionally, Transparent Huge Pages are activated on your SAP HANA servers.
SAP strongly recommends that you disable Transparent Huge Pages on all your SAP HANA servers. Alert 116 is raised in the System database with a warning if Transparent Huge Pages are enabled.
See the SAP Notes below for further reference:
- SAP Note 2131662 Transparent Huge Pages (THP) on SAP HANA Servers
- SAP Note 2031375 SAP HANA: Transparent HugePages (THP) setting on Linux .
- SAP Note 1824819 - SAP HANA DB: Recommended OS settings for SLES 11 / SLES for SAP Applications 11 SP2
- SAP Note 1954788 - SAP HANA DB: Recommended OS settings for SLES 11 / SLES for SAP Applications 11 SP3
- SAP Note 2013638 - SAP HANA DB: Recommended OS settings for RHEL 6.5
- SAP Note 2136965 - SAP HANA DB: Recommended OS settings for RHEL 6.6
##  Note
The following checks and steps should be performed on all hosts of the affected SAP HANA system. They have to be executed as the root user in the Linux shell.
## Procedure
1. To check whether Transparent Huge Pages are activated execute the following command:
```
cat /sys/kernel/mm/transparent_hugepage/enabled
```
This returns a string showing which state is currently applied (the bracketed value is current): [always] madvise never , '[always]' indicates that THPs are activated according to the value of the relevant Linux kernel parameter.
Note that you can also do this in SQL by querying the view m_HOST_INFORMATION:
```
select * from M_HOST_INFORMATION where key = 'kernel.transparent_hugepage.enabled'
```
2. You can run the following command to confirm that processes are using THPs:
```
cat /proc/meminfo/ | grep AnonHugePages
```
This returns a kilobyte value showing memory usage by THP.
3. Deactivate THP by executing the following command:
```
echo never > /sys/kernel/mm/transparent_hugepage/enabled
```
This will set the relevant kernel parameter to '[never]'; the command is immediately effective and should resolve the hanging situation. You can rerun the command from the first step to verify this action which should now show: always madvise [never] .
4. Note that the kernel parameter is only set/valid until the host is restarted the next time, the parameter setting transparent_hugepage=never must therefore be persisted to prevent it toggling back to '[always]' by using one of the following strategies:
- a. Add the parameter setting to the kernel boot line in the /etc/grub.conf file of the bootloader.
- b. Integrate the parameter setting within your system boot scripts such as: /etc/rc.local .
## Related Information
SAP Note 2131662
SAP Note 2031375
SAP Note 1824819
SAP Note 1954788
SAP Note 2013638
SAP Note 2136965