使用以下shell 脚本来计算大页配置参数,确保使用脚本实例之前的数据已经开始,

如果数据库的版本号11g,确认是否使用自己主动的内存管理(AMM)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#!/bin/bash

#

# hugepages_settings.sh

#

# Linux bash script to compute values for the

# recommended HugePages/HugeTLB configuration

#

# Note: This script does calculation for all shared memory

# segments available when the script is run, no matter it

# is an Oracle RDBMS shared memory segment or not.

#

# This script is provided by Doc ID 401749.1 from My Oracle Support 

# http://support.oracle.com



# Welcome text

echo "

This script is provided by Doc ID 401749.1 from My Oracle Support 

(http://support.oracle.com) where it is intended to compute values for 

the recommended HugePages/HugeTLB configuration for the current shared 

memory segments. Before proceeding with the execution please note following:

 * For ASM instance, it needs to configure ASMM instead of AMM.

 * The 'pga_aggregate_target' is outside the SGA and 

   you should accommodate this while calculating SGA size.

 * In case you changes the DB SGA size, 

   as the new SGA will not fit in the previous HugePagesconfiguration, 

   it had better disable the whole HugePages, 

   start the DB with new SGA size and run the script again.

And make sure that:

 * Oracle Database instance(s) are up and running

 * Oracle Database 11g Automatic Memory Management (AMM) is notsetup 

   (See Doc ID 749851.1)

 * The shared memory segments can be listed by command:

     # ipcs -m





Press Enter to proceed..."



read



# Check for the kernel version

KERN=`uname -r | awk -F. '{ printf("%d.%d\n",$1,$2); }'`



# Find out the HugePage size

HPG_SZ=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`

if [ -z "$HPG_SZ" ];then

    echo "The hugepages may not be supported in the system wherethe script is being executed."

    exit 1

fi



# Initialize the counter

NUM_PG=0



# Cumulative number of pages required to handle the running shared memorysegments

for SEG_BYTES in `ipcs -m | cut -c44-300 | awk '{print $1}' | grep"[0-9][0-9]*"`

do

    MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`

    if [ $MIN_PG -gt 0 ]; then

        NUM_PG=`echo"$NUM_PG+$MIN_PG+1" | bc -q`

    fi

done



RES_BYTES=`echo "$NUM_PG * $HPG_SZ * 1024" | bc -q`



# An SGA less than 100MB does not make sense

# Bail out if that is the case

if [ $RES_BYTES -lt 100000000 ]; then

    echo "***********"

    echo "** ERROR **"

    echo "***********"

    echo "Sorry! There are not enough total of sharedmemory segments allocated for 

HugePages configuration. HugePages can only be used for shared memorysegments 

that you can list by command:



    # ipcs -m



of a size that can match an Oracle Database SGA. Please make sure that:

 * Oracle Database instance is up and running 

 * Oracle Database 11g Automatic Memory Management (AMM) is notconfigured"

    exit 1

fi



# Finish with results

case $KERN in

'2.2') echo "Kernel version $KERN is not supported. Exiting." ;;

    '2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" |bc -q`;

           echo"Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;

    '2.6') echo "Recommended setting: vm.nr_hugepages =$NUM_PG" ;;

    '3.8') echo "Recommended setting: vm.nr_hugepages =$NUM_PG" ;;

esac



# End

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

版权声明:本文博客原创文章,博客,未经同意,不得转载。

大页(huge pages) 三大系列 ---计算大页配置参数的更多相关文章

  1. Linux传统Huge Pages与Transparent Huge Pages再次学习总结

      Linux下的大页分为两种类型:标准大页(Huge Pages)和透明大页(Transparent Huge Pages).Huge Pages有时候也翻译成大页/标准大页/传统大页,它们都是Hu ...

  2. 大页(Huge Page)简单介绍

    x86(包括x86-32和x86-64)架构的CPU默认使用4KB大小的内存页面(getconf PAGESIZE),但是它们也支持较大的内存页,如x86-64系统就支持2MB大小的大页(huge p ...

  3. Linux就这个范儿 第15章 七种武器 linux 同步IO: sync、fsync与fdatasync Linux中的内存大页面huge page/large page David Cutler Linux读写内存数据的三种方式

    Linux就这个范儿 第15章 七种武器  linux 同步IO: sync.fsync与fdatasync   Linux中的内存大页面huge page/large page  David Cut ...

  4. Expo大作战(十五)--expo中splash启动页的详细机制

    简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,讲全部来与官网 我猜去全部机翻+个人 ...

  5. 0809MySQL实战系列:大字段如何优化|数据存储结构

    转自https://yq.aliyun.com/articles/59256?spm=5176.100239.blogcont59257.9.5MLR2d 摘要: 背景 线上发现一张表,1亿的数据量, ...

  6. Java JUC之Atomic系列12大类实例讲解和原理分解

    Java JUC之Atomic系列12大类实例讲解和原理分解 2013-02-21      0个评论       作者:xieyuooo 收藏    我要投稿 在java6以后我们不但接触到了Loc ...

  7. acdream 小晴天老师系列——苹果大丰收(DP)

    小晴天老师系列——苹果大丰收 Problem Description 小晴天的后花园有好多好多的苹果树,某天,苹果大丰收~小晴天总共摘了M个苹果,我们假设苹果之间是不可分辨的. 为了保存苹果,小晴天买 ...

  8. HDU4530:小Q系列故事——大笨钟

    Problem Description 饱尝情感苦恼的小Q本打算隐居一段时间,但仅仅在3月25号一天没有出现,就有很多朋友想念他,所以,他今天决定再出来一次,正式和大家做个告别. 小Q近来睡眠情况很差 ...

  9. F - 小晴天老师系列——苹果大丰收

    F - 小晴天老师系列——苹果大丰收 Time Limit: 2000/1000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Other ...

随机推荐

  1. java entry

    我希望要一个ArrayList<Entry>,类似C++中的pair, 可是Map.Entry是个接口,不能实例化,能够像以下这样写 HashMap<Integer, Integer ...

  2. JSP/Servlet-----charset 、pageEncoding差别

    一.JSP/Servlet中的几个编码的作用         在JSP/Servlet中有4个地方可设置编码(例如以下).当中前两个仅仅能用于JSP中,后两个可用于JSP和Servlet 中.    ...

  3. 单例模式(Singleton)Holder

    public class Singleton { /** * 类级的内部类,也就是静态的成员式内部类,该内部类的实例与外部类的实例 * 没有绑定关系,而且只有被调用到才会装载,从而实现了延迟加载 */ ...

  4. 多图真相:Adobe Dreamweaver CC 2014.1来了-体验卓越PSD提取和诸多精彩云功能!

     作为经典的web开发工具,DW此次版本号更新提供了更加丰富的云功能,是网页开发人员的利器! 直接发多图(来源:zoomla!逐浪CMS UED): watermark/2/text/aHR0cD ...

  5. 解决ScrollView中的ListView无法显示全

    问题描述: ListView加入到ScrollView中之后,发现只能显示其中一条,具体原因得看一下源代码.现在先贴一下方案 (转自:http://blog.csdn.net/hitlion2008/ ...

  6. [Android代码阅读]分类简介

    分类简介: 阅读他人的代码,可以学到很多东西,从思路,到方案,一系列都可以在项目代码中体现,所以,此分类专门用于记录阅读过的项目代码,并在上面给出自己的理解和注释 在此,感谢原作者开源分享项目代码

  7. HUST 1569(Burnside定理+容斥+数位dp+矩阵快速幂)

    传送门:Gift 题意:由n(n<=1e9)个珍珠构成的项链,珍珠包含幸运数字(有且仅由4或7组成),取区间[L,R]内的数字,相邻的数字不能相同,且旋转得到的相同的数列为一种,为最终能构成多少 ...

  8. Android 程序静态分析

    简介 静态分析是探索Android程序内幕的一种最常见的方法,它与动态调剂双剑合璧,帮助分析人员解决分析时遇到的各种“疑难”问题. 静态分析是指在不运行的情况下,采用词法分析.语法分析等各种技术手段对 ...

  9. SE 2014年5月23日

    两站点 A 和 B,由于业务往来需要,所以工程师提出vpn技术,同时需要保证业务流在internet上的安全性,同时在这里站点均为固定ip地址. 通过分析以上信息,确定这里使用 IPSec VPN的主 ...

  10. nutch搏斗之一

    nutch搏斗之一 问题描述: 在用nutch1.0做generate 包括5亿url的crawldb时,它默认按照64M分块,分成777个map task,在运行的后期出现 Could not fi ...