Home Database Mysql Tutorial Linux配置HugePage

Linux配置HugePage

Jun 07, 2016 pm 04:45 PM
o database

对于内存较大的Oracle数据库服务器,配置HugePage是很有必要的,下面是配置Huge的步骤:

对于内存较大的Oracle数据库服务器,配置HugePage是很有必要的,下面是配置Huge的步骤:

我的环境:

OS:CentOS release 6.4 (Final)

Oracle:11.2.0.4 RAC

Oracle 大内存需要配置HugePage

在Oracle 11.2.0.3.0上开启大页(HugePages)的详细解析

Linux HugePages及MySQL 大页配置

Linux HugePage 特性

1.        设置memlock

编辑/etc/security/limits.conf

增加:

* Soft memlock 稍小于RAM值

* hard memlock 稍小于RAM值

Memlock值大于sga没关系的,所以我们可以设置这个值在我们想要的SGA size和物理内存size之间,这个值得单位是kb。

[root@node1 ~]# grep -i memtot /proc/meminfo

MemTotal:      132250576 kB

我们物理内存大小126G,因此我可以设置memlock为100G。

在2个节点设置:

[root@node1 ~]# tail -2 /etc/security/limits.conf

* soft memlock 104857600

* hard memlock 104857600

设置完毕后,以Oracle用户登录验证:

node2-> ulimit -l

104857600

2.        禁用AMM特性:

禁用AMM特性需要将memory_max_target, memory_max_target2个参数重置,而不仅仅是设置为0,最好的办法是创建一个pfile,在pfile中将这2个参数删除,再根据这个pfile创建spfile.

主要内存参数设置为:

node1->

node1-> grep target /tmp/init.ora

*.pga_aggregate_target=1572864000

*.sga_target=64424509440

SQL> create spfile from pfile='/tmp/init.ora';

 

File created.

 

SQL> startup force

ORA-27102: out of memory

Linux-x86_64 Error: 28: No space left on device

Additional information: -134217728

Additional information: 1

SQL>

出现这个报错是因为shmall设置的太小。

Shmall表示共享内存的总大小,单位为pagesize的大小。

根据我的配置,最大能支持8G的SGA:

node1-> getconf PAGE_SIZE

4096

node1->  cat /proc/sys/kernel/shmall

2097152

修改shmall并重新启动数据库,修改的方法很简单,编辑/etc/sysctl.conf:

kernel.shmall= 16252928

即可。

修改完毕kernel.shmall,此时可以重启数据库。

SQL> startup nomount pfile='/tmp/init.ora';           

ORACLE instance started.

 

Total System Global Area 6.4137E+10 bytes

Fixed Size                  2269072 bytes

Variable Size            6979321968 bytes

Database Buffers        5.7043E+10 bytes

Redo Buffers              112762880 bytes

SQL>

SQL>

DB启动后重新创建spfile:

SQL>  create spfile='+OCR/sszgdb/spfilesszgdb.ora' from pfile='/tmp/init.ora';

 

File created.

 

SQL>

3.        根据Oracle的脚本计算hugepage大小(计算时要确保Oracle已经启动),也可自己计算:

 

 

Press Enter to proceed...

 

Recommended setting: vm.nr_hugepages = 30739

node1->

4.        根据脚本的计算值在2个节点编辑/etc/sysctl.conf

加入vm.nr_hugepages = 30739

[root@node2 ~]# grep -i huge /proc/meminfo

AnonHugePages:    602112 kB

HugePages_Total:  30739

HugePages_Free:    30739

HugePages_Rsvd:        0

HugePages_Surp:        0

Hugepagesize:      2048 kB停止数据库实例

5.        重启服务器,一般重启服务器之后DB也自动启动了。服务器和DB重启后可以通过以下命令验证大页的使用情况:

grep -i Hugepages /proc/meminfo

此时查看Oracle的alert日志,也可以发现:

Starting ORACLE instance (normal)

************************ Large Pages Information *******************

Per process system memlock (soft) limit = UNLIMITED

 

Total Shared Global Region in Large Pages = 58 GB (96%)

 

Large Pages used by this instance: 29761 (58 GB)

Large Pages unused system wide = 24 (48 MB)

Large Pages configured system wide = 30739 (60 GB)

Large Page size = 2048 KB

 

RECOMMENDATION:

  Total System Global Area size is 60 GB. For optimal performance,

  prior to the next instance restart:

  1. Increase the number of unused large pages by

 at least 936 (page size 2048 KB, total size 1872 MB) system wide to

  get 100% of the System Global Area allocated with large pages

可以发现sga并没有全部放在大页里,这样可能对性能带来负面影响,,Oracle建议我们再加入936个大页,可见Oracle的大页脚本计算并不准确,我们需要增加大页数量,并设置参数Use_large_pages=only,该参数确保Oracle的共享内存全部使用大页。

更多详情见请继续阅读下一页的精彩内容:

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1243
24
iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

Top 10 global digital currency trading apps recommended (2025 currency trading software ranking) Top 10 global digital currency trading apps recommended (2025 currency trading software ranking) Mar 12, 2025 pm 05:48 PM

This article recommends the top ten digital currency trading apps in the world, including Binance, OKX, Huobi Global, Coinbase, Kraken, Gate.io, KuCoin, Bitfinex, Gemini and Bitstamp. These platforms have their own characteristics in terms of transaction pair quantity, transaction speed, security, compliance, user experience, etc. For example, Binance is known for its high transaction speed and extensive services, while Coinbase is more suitable for novices. Choosing a platform that suits you requires comprehensive consideration of your own needs and risk tolerance. Learn about the world's mainstream digital currency trading platforms to help you conduct digital asset trading safely and efficiently.

How to install and register the btc trading app? How to install and register the btc trading app? Feb 21, 2025 pm 07:09 PM

This article will provide a detailed introduction to how to install and register a Bitcoin trading application. The Bitcoin trading app allows users to manage and trade cryptocurrencies such as Bitcoin. The article guides users through the installation and registration process step by step, including downloading applications, creating accounts, performing identity verification, and first deposit. The goal of the article is to provide beginners with clear and easy-to-understand guidelines to help them easily enter the world of Bitcoin trading.

MySQL: An Introduction to the World's Most Popular Database MySQL: An Introduction to the World's Most Popular Database Apr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

Ouyi Exchange Download Official Portal Ouyi Exchange Download Official Portal Feb 21, 2025 pm 07:51 PM

Ouyi, also known as OKX, is a world-leading cryptocurrency trading platform. The article provides a download portal for Ouyi's official installation package, which facilitates users to install Ouyi client on different devices. This installation package supports Windows, Mac, Android and iOS systems. Users can choose the corresponding version to download according to their device type. After the installation is completed, users can register or log in to the Ouyi account, start trading cryptocurrencies and enjoy other services provided by the platform.

MySQL vs. Other Databases: Comparing the Options MySQL vs. Other Databases: Comparing the Options Apr 15, 2025 am 12:08 AM

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

See all articles