#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
# on Oracle Linux
#
# 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 on Oracle Linux. 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 the overall size.
* In case you changes the DB SGA size,
as the new SGA will not fit in the previous HugePages configuration,
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 Automatic Memory Management (AMM) is not setup
(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 where the script is being executed."
exit 1
fi
# Initialize the counter
NUM_PG=0
# Cumulative number of pages required to handle the running shared memory segments
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 shared memory segments allocated for
HugePages configuration. HugePages can only be used for shared memory segments
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 Automatic Memory Management (AMM) is not configured"
exit 1
fi
# Finish with results
echo "Recommended setting: vm.nr_hugepages = $NUM_PG";
# End

Oracle官方自动推荐大内存页脚本hugepages.sh的更多相关文章

  1. 转://Linux大内存页Oracle数据库优化

    PC Server发展到今天,在性能方面有着长足的进步.64位的CPU在数年前都已经进入到寻常的家用PC之中,更别说是更高端的PC Server:在Intel和AMD两大处理器巨头的努力下,x86 C ...

  2. 【云和恩墨】性能优化:Linux环境下合理配置大内存页(HugePage)

    原创 2016-09-12 熊军 [云和恩墨]性能优化:Linux环境下合理配置大内存页(HugePage)   熊军(老熊) 云和恩墨西区总经理 Oracle ACED,ACOUG核心会员 PC S ...

  3. Oracle DB 自动管理共享内存

    • 启用Oracle Enterprise Manager (EM) 内存参数 • 设置自动优化的内存参数 • 使用手动优化的SGA 参数覆盖最小大小 • 使用SGA Advisor 设置SGA_TA ...

  4. InnoDB启用大内存页

    在 Linux 操作系统上运行内存需求量较大的应用程序时,由于其采用的默认页面大小为 4KB,因而将会产生较多 TLB Miss 和缺页中断,从而大大影响应用程序的性能.当操作系统以 2MB 甚至更大 ...

  5. ORACLE数据库自动备份压缩的批处理脚本 rar 7z

    使用7z的版本: @echo offset filename="d:\backup\dbname_%date:~0,10%"set zipfile="d:\backup\ ...

  6. JVM优化之调整大内存分页(LargePage)

    转自:http://cjjwzs.iteye.com/blog/1059381 本文将从内存分页的原理,如何调整分页大小两节内容,向你阐述LargePage对JVM的性能有何提升作用,并在文末点明了大 ...

  7. (转)mongoDB 禁用大内存页面 transparent_hugepage=never

    最近在学mongoDB,安装倒没什么困难,有yum仓库.不过接入ctl后的一条warning倒挺让人烦心的. 1 2 2015-03-22T09:27:00.222+0800 I CONTROL  [ ...

  8. Java的大内存分页支持

    原文:http://kilik.iteye.com/blog/677253 最近在研究java的性能调优,顺手写了一个小程序来测试性能问题.这个程序用来进行矩阵乘法运算,如下: for (int i ...

  9. oracle之 关闭透明大页

    方法一: 1.设置/etc/grub.conf文件,添加 transparent_hugepage=never ,在系统启动是禁用 [root@hbdw1 ~]# cat /etc/grub.conf ...

  10. Windows下Oracle数据库自动备份批处理脚本

    expdb命令版本 @echo off REM ########################################################### REM # Windows Se ...

随机推荐

  1. 【Vue】Re04 指令:第二部分

    一.v-on指令 作用是用来将元素绑定事件监听器,触发特定的函数执行一定功能 关键字:事件监听 <!DOCTYPE html> <html lang="en"&g ...

  2. Jax计算框架的MPI通讯的扩展库 —— mpi4jax

    地址: https://github.com/mpi4jax/mpi4jax PS. 关于这个library的性能表现并不是很清楚,没有亲自手动安装并测试过.这里只作为链接收藏之用,毕竟这个属于比较小 ...

  3. 国产首款IDE环境:数字广东公司联合麒麟软件打造的国内首款适配国产操作系统、蜘蛛创新的集成开发环境CEC-IDE正式亮相

    参考: https://www.youtube.com/watch?v=fOpBEWZVKU0 在中国it历史上继"木兰编程语言(实际上套壳Python),红旗操作系统(实际上套壳Chrom ...

  4. Ubuntu18.04server 双网卡,开机自动设置路由并启动校园网网络认证程序(Ubuntu开机自动设置路由,开机自启动应用程序)

    本博主为高龄在校生,实验室服务器需要假期时候无人守候也能实现自动登录校园网从而实现网络连接,以使实验室同学在家也可以使用校园vpn连接服务器. 由于假期时候实验室没有人,而假期实验室可能会出现断电断网 ...

  5. 系数矩阵为Hessian矩阵时使用“Pearlmutter trick”或“有限差分法”近似的共轭梯度解法 —— Hession-free的共轭梯度法

    共轭梯度法已经在前文中给出介绍: python版本的"共轭梯度法"算法代码 共轭梯度法用来求解方程A*x=b,且A为正定矩阵. 在机器学习领域很多优化模型的求解最终可以写为A*x= ...

  6. 多线程之park()与interrupt()的理解

    1.背景 其他不多说,很多时候面试会问 2.代码 package com.ldp.demo01; import com.common.MyThreadUtil; import lombok.exter ...

  7. springboot项目启动时禁止Redis、数据对象加载

    1.背景 2.实现方式 启动类上添加需要排除的自动装配对象 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, H ...

  8. 【模板】树的直径(dfs & dp)

    树的直径 给定n个点 n-1条边 和每条边的val 输出直径的大小和 直径上的点的序号 input: 8 1 2 2 1 3 1 1 5 10 2 4 3 4 6 4 3 7 5 7 8 2 outp ...

  9. BossPlayersCTF靶机笔记

    BossPlayersCTF靶机 靶机概述 这是vulnhub上的一个简单的linux靶机,适合初级渗透测试人员,同时也告诉我们在渗透测试过程中要有耐心,要允许有兔子洞. 靶机整体思路: 主机端口探测 ...

  10. kafka消费者处理能力低引起rebalance分析

    一.背景介绍 项目上进行算法调度的需求,打算采用kafka作为消息中间件,通过将多个算法消费者加入到同一个group中并行的处理算法请求,从而达到高效处理的目的.但是算法处理的时间较长,多则几十分钟, ...