最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

關(guān)于Linux的透明大頁詳細介紹

 更新時間:2015年07月28日 15:56:57   作者:瀟湘隱者  
這片文章介紹了Linux的Transparent HugePages,一是介紹了查看是否啟用透明大頁,二是如何啟用、警用透明大頁,需要的朋友可以參考下

 透明大頁介紹

Transparent Huge Pages的一些官方介紹資料:

Transparent Huge Pages (THP) are enabled by default in RHEL 6 for all applications. The kernel attempts to allocate hugepages whenever possible and any Linux process will receive 2MB pages if the mmap region is 2MB naturally aligned. The main kernel address space itself is mapped with hugepages, reducing TLB pressure from kernel code. For general information on Hugepages, see: What are Huge Pages and what are the advantages of using them?

The kernel will always attempt to satisfy a memory allocation using hugepages. If no hugepages are available (due to non availability of physically continuous memory for example) the kernel will fall back to the regular 4KB pages. THP are also swappable (unlike hugetlbfs). This is achieved by breaking the huge page to smaller 4KB pages, which are then swapped out normally.

But to use hugepages effectively, the kernel must find physically continuous areas of memory big enough to satisfy the request, and also properly aligned. For this, a khugepaged kernel thread has been added. This thread will occasionally attempt to substitute smaller pages being used currently with a hugepage allocation, thus maximizing THP usage.

In userland, no modifications to the applications are necessary (hence transparent). But there are ways to optimize its use. For applications that want to use hugepages, use of posix_memalign() can also help ensure that large allocations are aligned to huge page (2MB) boundaries.

Also, THP is only enabled for anonymous memory regions. There are plans to add support for tmpfs and page cache. THP tunables are found in the /sys tree under /sys/kernel/mm/redhat_transparent_hugepage.

查看是否啟用透明大頁

1:命令cat /sys/kernel/mm/redhat_transparent_hugepage/enabled 該命令適用于Red Hat Enterprise Linux系統(tǒng)

[root@getlnx06 ~]# more /etc/issue
 
Red Hat Enterprise Linux Server release 6.6 (Santiago)
 
Kernel \r on an \m
 
[root@getlnx06 ~]# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
 
[always] madvise never


 

2:命令cat /sys/kernel/mm/transparent_hugepage/enabled 該命令適用于其它Linux系統(tǒng)

[root@getlnx06 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
 
always madvise [never]
 
[root@getlnx06 ~]# 

使用命令查看時,如果輸出結(jié)果為[always]表示透明大頁啟用了。[never]表示透明大頁禁用、[madvise]表示

 3:如何HugePages_Total返回0,也意味著透明大頁禁用了

[root@getlnx06 ~]# grep -i HugePages_Total /proc/meminfo 
 
HugePages_Total: 0

4:cat /proc/sys/vm/nr_hugepages返回0也意味著透明大頁禁用了。

[root@getlnx06 ~]# cat /proc/sys/vm/nr_hugepages 
 
0
 

禁用、啟用透明大頁功能

 方法1:設(shè)置/etc/grub.conf文件,在系統(tǒng)啟動是禁用。

[root@getlnx06 ~]# vi /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
#   all kernel and initrd paths are relative to /boot/, eg.
#   root (hd0,0)
#   kernel /vmlinuz-version ro root=/dev/mapper/VolGroup--LogVol0-LogVol01
#   initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux 6 (2.6.32-504.el6.x86_64)
  root (hd0,0)
  kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=/dev/mapper/VolGroup--LogVol0-LogVol01 rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup-LogVol0/LogVol01 rd_LVM_LV=VolGroup-LogVol0/LogVol00 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
  initrd /initramfs-2.6.32-504.el6.x86_64.img
transparent_hugepage=never

 

方法2:設(shè)置/etc/rc.local文件

[root@getlnx06 ~]# vi /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
 
touch /var/lock/subsys/local
 
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
 echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi

使用上面的配置后必須重啟操作系統(tǒng)才能生效,你也可以運行下面命令不用重啟操作系統(tǒng)。

You must reboot your system for the setting to take effect, or run the following two echo lines to proceed with the install without rebooting:

[root@getlnx06 ~]# echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
[root@getlnx06 ~]# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
always madvise [never]
[root@getlnx06 ~]# 

小知識點:

1:從RedHat 6, OEL 6, SLES 11 and UEK2 kernels 開始,系統(tǒng)缺省會啟用 Transparent HugePages :用來提高內(nèi)存管理的性能透明大頁(Transparent HugePages )和之前版本中的大頁功能上類似。主要的區(qū)別是:Transparent HugePages 可以實時配置,不需要重啟才能生效配置;

 

2:Transparent Huge Pages在32位的RHEL 6中是不支持的。

Transparent Huge Pages are not available on the 32-bit version of RHEL 6.

 

3: ORACLE官方不建議我們使用RedHat 6, OEL 6, SLES 11 and UEK2 kernels 時的開啟透明大頁(Transparent HugePages ), 因為透明大頁(Transparent HugePages ) 存在一些問題:

        a.在RAC環(huán)境下 透明大頁(Transparent HugePages )會導(dǎo)致異常節(jié)點重啟,和性能問題;

        b.在單機環(huán)境中,透明大頁(Transparent HugePages ) 也會導(dǎo)致一些異常的性能問題;

Transparent HugePages memory is enabled by default with Red Hat Enterprise Linux 6, SUSE Linux Enterprise Server 11, and Oracle Linux 6 with earlier releases of Oracle Linux Unbreakable Enterprise Kernel 2 (UEK2) kernels. Transparent HugePages memory is disabled in later releases of Oracle Linux UEK2 kernels.Transparent HugePages can cause memory allocation delays during runtime. To avoid performance issues, Oracle recommends that you disable Transparent HugePages on all Oracle Database servers. Oracle recommends that you instead use standard HugePages for enhanced performance.Transparent HugePages memory differs from standard HugePages memory because the kernel khugepaged thread allocates memory dynamically during runtime. Standard HugePages memory is pre-allocated at startup, and does not change during runtime.
Starting with RedHat 6, OEL 6, SLES 11 and UEK2 kernels, Transparent HugePages are implemented and enabled (default) in an attempt to improve the memory management. Transparent HugePages are similar to the HugePages that have been available in previous Linux releases. The main difference is that the Transparent HugePages are set up dynamically at run time by the khugepaged thread in kernel while the regular HugePages had to be preallocated at the boot up time. Because Transparent HugePages are known to cause unexpected node reboots and performance problems with RAC, Oracle strongly advises to disable the use of Transparent HugePages. In addition, Transparent Hugepages may cause problems even in a single-instance database environment with unexpected performance problems or delays. As such, Oracle recommends disabling Transparent HugePages on all Database servers running Oracle.

 

4:安裝Vertica Analytic Database時也必須關(guān)閉透明大頁功能。

 

相關(guān)文章

  • Linux CentOS7 vim多文件編輯方式

    Linux CentOS7 vim多文件編輯方式

    這篇文章主要介紹了Linux CentOS7 vim多文件編輯方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2023-11-11
  • Linux使用NetworkManager隨機生成你的MAC地址

    Linux使用NetworkManager隨機生成你的MAC地址

    今天小編就為大家分享一篇關(guān)于使用NetworkManager隨機生成你的MAC地址的文章,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧
    2018-09-09
  • 阿里云服務(wù)器CentOS服務(wù)器初始化設(shè)置步驟

    阿里云服務(wù)器CentOS服務(wù)器初始化設(shè)置步驟

    這篇文章主要介紹了阿里云服務(wù)器CentOS服務(wù)器初始化設(shè)置步驟,需要的朋友可以參考下
    2015-05-05
  • Apache簡介及安全配置方案

    Apache簡介及安全配置方案

    Apache HTTP Server(簡稱Apache)是Apache軟件基金會的一個開放源碼的網(wǎng)頁服務(wù)器,可以在大多數(shù)計算機操作系統(tǒng)中運行,由于其多平臺和安全性被廣泛使用,是最流行的Web服務(wù)器端軟件之一。它快速、可靠并且可通過簡單的API擴展,將Perl/Python等解釋器編譯到服務(wù)器中。
    2014-08-08
  • apache2服務(wù)器的搭建和配置步驟詳解

    apache2服務(wù)器的搭建和配置步驟詳解

    其實搭建apache2并不難,只是網(wǎng)上的資料有很多都過時了,之前被誤導(dǎo)過好幾次,走了很多彎路。趁著這次在本地搭建網(wǎng)站的時機重新捋一下思路,也方便以后有需求的時候查閱,需要的朋友可以參考下。
    2017-04-04
  • Memcached 分布式緩存實現(xiàn)原理簡介

    Memcached 分布式緩存實現(xiàn)原理簡介

    這篇文章主要介紹了Memcached 分布式緩存實現(xiàn)原理簡介,具有參考價值,需要的朋友可以參考下。
    2016-06-06
  • 詳解centos7中配置keepalived日志為別的路徑

    詳解centos7中配置keepalived日志為別的路徑

    這篇文章主要介紹了centos7中配置keepalived日志為別的路徑,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-10-10
  • linux正則表達式,反斜線加普通字符作為正則表達式詳解

    linux正則表達式,反斜線加普通字符作為正則表達式詳解

    這篇文章主要介紹了linux正則表達式,反斜線加普通字符作為正則表達式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2025-04-04
  • Linux?配置時間服務(wù)器的詳細過程

    Linux?配置時間服務(wù)器的詳細過程

    文章介紹了如何在Linux系統(tǒng)上配置時間服務(wù)器,包括同步阿里云服務(wù)器時間和服務(wù)端、客戶端的配置方法,以及在本地服務(wù)器上進行時間同步的步驟,感興趣的朋友一起看看吧
    2025-03-03
  • 關(guān)于crontab定時任務(wù)命令解讀

    關(guān)于crontab定時任務(wù)命令解讀

    這篇文章主要介紹了關(guān)于crontab定時任務(wù)命令的用法,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-07-07

最新評論

望都县| 建瓯市| 招远市| 日喀则市| 乌兰浩特市| 临颍县| 南通市| 古浪县| 通山县| 甘德县| 张北县| 邵武市| 长顺县| 望谟县| 玛曲县| 保亭| 盐边县| 新宾| 民丰县| 富蕴县| 南江县| 开江县| 丘北县| 资溪县| 庆元县| 门源| 威信县| 普安县| 渝中区| 汝州市| 东丰县| 西贡区| 瑞安市| 香港| 德阳市| 通化县| 蓝田县| 龙江县| 怀集县| 阿瓦提县| 象州县|