You are on page 1of 22

26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat

rmance - Red Hat Customer Portal

Subscriptions Downloads Containers Support Cases

Products & Services Knowledgebase Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC
performance

 THIS SOLVED MY ISSUE

Tuning Red Hat Enterprise Linux for Oracle and


Oracle RAC performance
$
SOLUTION VERIFIED - Updated August 22 2021 at 12:14 AM - English

Red Hat Insights can detect this issue

Proactively detect and remediate issues impacting your systems.

View matching systems and remediation


 

Environment
Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 4
Oracle 9g
Oracle 10g
Oracle 11g
Oracle 12c, 18c, 19c

Issue
How can I tune my Red Hat Enterprise Linux system for Oracle 10g/11g?
High memory consumption on Oracle database system

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 1/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

High CPU consumption on Oracle hosts


How should I configure swap memory for an Oracle database?
Slower than expected IO performance running Oracle on RHEL
What is the maximum number of huge pages I should be using per system?
Should I disable numa_balancing ?

Resolution

The information contained herein is just an example of how the configuration may
look like and is provided just for the convenience only. See Reference section for
additional examples and discussion reguarding tuning.

In the absence of any future documentation from Red Hat specifically for RHEL8, the
recommendations for RHEL7 are also applicable for RHEL8 environments.

IMPORTANT: This article is not an authoritative source of information on how to


configure Red Hat Enterprise Linux for use with Oracle products, as these products are
not shipped by Red Hat. The authoritative source of such information is the Oracle
Installation Guide or Oracle OS Tuning Guide for your version of Oracle product,
such a documentation could be found on Oracle Metalink[1] site, see the following
Notes available on the Oracle Metalink site.

RHEL4 32 bit (x86):

Note 303859.1 - Requirements for Installing Oracle 9iR2 on RHEL 4


Note 392940.1 - Requirements for Installing Oracle 10.1.0.x RDBMS on RHEL 4
x86 platform
Note 343431.1 - Requirements for Installing Oracle 10gR2 RDBMS on RHEL 4
x86 platform
Note 430653.1 - Requirements for Installing Oracle 11gR1 32-bit on RHEL 4
Note 880211.1 - Requirements for Installing Oracle 11gR2 RDBMS on RHEL (and
OEL) 4 x86

RHEL4 64 bit (x86-64):

Note 353529.1 - Requirements for Installing Oracle 9iR2 64-bit on RHEL 4 x86-
64 (AMD64/EM64T)
Note 390900.1 - Requirements for Installing Oracle 10g (10.1.0.x) RDBMS on
RHEL 4 on AMD64/EM64T (Linux x86-64)
Note 339510.1 - Requirements for Installing Oracle 10gR2 RDBMS on RHEL 4 on
AMD64/EM64T
Note 437123.1 - Requirements for Installing Oracle 11gR1 RDBMS on RHEL 4 on
AMD64/EM64T
https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 2/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

Note 880942.1 - Requirements for Installing Oracle 11gR2 RDBMS on RHEL (and
OEL) 4 on AMD64/EM64T

RHEL5 32 bit (x86):

Note 419646.1 - Requirements For Installing Oracle 10gR2 On RHEL 5 (x86)


Note 438765.1 - Requirements for Installing Oracle 11gR1 32bit RDBMS on RHEL
5
Note 880936.1 - Requirements for Installing Oracle 11gR2 RDBMS on RHEL (and
OEL) 5 on 32-bit x86

RHEL5 64 bit (x86-64):

Note 421308.1 - Requirements For Installing Oracle10gR2 On RHEL 5 (x86_64)


Note 438766.1 - Requirements for Installing Oracle 11gR1 RDBMS on RHEL 5 on
AMD64/EM64T
Note 880989.1 - Requirements for Installing Oracle 11gR2 RDBMS on RHEL (and
OEL) 5 on AMD64/EM64T
Note 1529433.1 - Requirements for Installing Oracle Database 12.1 on RHEL5 or
OL5 64-bit (x86-64)

RHEL6 64 bit (x86-64):

Note 1441282.1 - Requirements for Installing Oracle 11gR2 RDBMS on RHEL6 or


OL6 64-bit (x86-64)
Note 1529864.1 - Requirements for Installing Oracle Database 12.1 on RHEL6 or
OL6 64-bit (x86-64)
Note 2426831.1 - Requirements for Installing Oracle Database 18c on OL6 or
RHEL6 64-bit (x86-64)

RHEL7 64 bit (x86-64):

Note 1962100.1 - Requirements for Installing Oracle 11.2.0.4 RDBMS on OL7 or


RHEL7 64-bit (x86-64)
Note 1961997.1 - Requirements for Installing Oracle Database 12.1on RHEL7 or
OL7 64-bit (x86-64)
Note 2426806.1 - Requirements for Installing Oracle Database 18c on OL7 or
RHEL7 64-bit (x86-64)
Note 2551169.1 - Requirements for Installing Oracle Database 19c on OL7 or
RHEL7 64-bit (x86-64)

"Master Note of Linux OS Requirements for Database Server"

There are 3 ways to tune Oracle database server:

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 3/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

1. Installing tuned-profiles-oracle package


(Recommended)
Refer Red Hat kcs: Installing tuned profile available for Oracle RDBMS

2. Automatic configuration
Red Hat provides a RHEL Tuner for Oracle tool to help tune your Red Hat Enterprise Linux
for Oracle. The tool incorporates the information included in this document but makes it
easier to generate valid and support-recommended configurations. You can leave feedback
on the tool at RHEL Tuner for Oracle.

3. Manual configuration
Note: All the numbers mentioned in this article are not generic and have been shown to
have a positive effect on database workloads resident on Red Hat Enterprise Linux.
That being said, the specific values depend on user environments and may require
further adjustment.

Memory settings in /etc/sysctl.conf:

Swapping for Oracle is not ideal and should be avoided as much as possible. The
following tunable will tune the kernel to swap less aggressively.

vm.swappiness=10

Maximum percentage of active memory that can have dirty pages. For example if a
system has 1000 pages of memory and dirty_background_ratio is set to 3% ,
writeback will begin when 30 pages have been dirtied.

vm.dirty_background_ratio=3

Maximum percentage of total memory that can have dirty pages. If it is set to 40% on a
1000 page system, a process dirtying pages will be made to wait once the 400th page
is dirtied.This mechanism will, thus, slow the dirtying of pages while the system catches
up.

vm.dirty_ratio=40

How long data can be in page cache before being expired:

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 4/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

vm.dirty_expire_centisecs=500

How often pdflush is activated to clean dirty pages (in hundreds of a second):

vm.dirty_writeback_centisecs=100

HugePages

1. Obtain the Hugepagesize from /proc/meminfo

$ grep Huge /proc/meminfo


HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 2048 kB

2. Calculate the recommended number of HugePages using the formula below, using
Hugepagesize and the System Global Area (SGA) values from Oracle. See Oracle
documentation for more about SGA and where to find those values. Note that the
Program Global Area (PGA) does not use huge pages.

SGA / huge page size

The following is an example showing that 10240 is amount of huge pages required
to fit the 20GB SGA. Please note, that values were are all converted to kilobytes for
calculation:

Hugepagesize = 2048 KB
20 GB SGA = 20971520 KB
(20971520 / 2048) = 10240

3. Add that number to the /etc/sysctl.conf setting:

vm.nr_hugepages=10240
vm.hugetlb_shm_group=<insert oracle group ID here>

4. Once the above setting has been tested and shown to provide the performance
required, it is recommended to move HugePage allocation to the kernel line in grub
configuration as a boot option. This allows for earlier and cleaner allocation of
HugePages:

kernel /vmlinuz-<kernel-version> ro root=/dev/vg01/lv01 hugepages=10240 <other


boot options>

How to permanently modify the kernel command line in RHEL5 and RHEL6?

How to permanently modify kernel command line in RHEL 7?

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 5/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

If Hugepages are not set in kernel command line, they can be dynamically allocated
by setting the value in nr_hugepages .
When the system is under memory pressure, the huge pages cannot be swapped.

5. Change the Oracle database configuration to use the Huge Pages. Contact Oracle
support if assistance is needed

Limits setting in /etc/security/limits.conf:

Note: In order for Oracle database to use Huge Pages in Red Hat Enterprise Linux, you
may also need to increase the ulimit parameter "memlock" for the oracle user in
/etc/security/limits.conf. The memlock setting is specified in KB and must match the
memory size of the number of Huge Pages that Oracle should be able to allocate. So, if
the Oracle database should be able to use 512 Huge Pages, then memlock must be set
to at least (512 * Hugepagesize), which on a default system would be 1048576 KB
(512*2048).

oracle soft memlock 1048576 oracle hard memlock 1048576

Shared Memory

According to the documentation:

SHMALL is the maximum total amount of shared memory pages that can be used
system-wide. Hence, SHMALL should always be at least ceil(SHMMAX/PAGE_SIZE) .
SHMMAX is the maximum size in bytes of a single shared memory segment that can
be created.

Obtain the total memory in the system in bytes:

mem=$(free -b | awk '/Mem/ {print $2}')

Get page size in bytes:

page=$(getconf PAGE_SIZE)

Calculate 75% of the total memory in the system in pages for SHMALL :

all=$(expr $mem \* 75 / 100 / $page + 1)

Multiply the SHMALL value by the page size to get SHMMAX :

max=$(expr $all \* $page)

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 6/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

Set the SHMMAX and the SHMALL values in the /etc/sysctl.conf file:

echo "kernel.shmmax = $max" >> /etc/sysctl.conf


echo "kernel.shmall = $all" >>
/etc/sysctl.conf

Set the maximum number of shared memory segments with SHMMNI in the
/etc/sysctl.conf file:

echo "kernel.shmmni = 4096" >> /etc/sysctl.conf

Semaphores

Recommended minimums for semaphore operations:

kernel.sem="250 32000 100 128"

The first value, SEMMSL, is the maximum number of semaphores per semaphore set

The second value, SEMMNS, defines the total number of semaphores for the system
The third value, SEMOPM, defines the maximum number of semaphore operations per
semaphore call
The last value, SEMMNI, defines the number of entire semaphore sets for the system

# sysctl -w "kernel.sem = 250 32000 100 128"


# echo "kernel.sem = 250 32000 100
128" >> /etc/sysctl.conf

Open file descriptors for oracle user

# vi /etc/security/limits.conf
#<domain> <type> <item> <value>
oracle hard nofile 10000

Disabling transparent hugepages (THP) recommended just for Red Hat Enterprise Linux
6 and 7

Disable tuned and ktune services if installed

Example #1:

# service tuned stop


# chkconfig tuned off
# service ktune stop
# chkconfig
ktune off

Example #2:

# tuned-adm off

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 7/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

Note: The tuned-adm command will revert all your settings to what they were before tuned
started and disable the tuning services from running at boot. As an alternative, a customized
tuned profile can be created, taking over the old settings and only disabling THP. Refer to
kbase Disabling transparent hugepages (THP) on Red Hat Enterprise Linux 6 is not taking
effect. for details.

Append transparent_hugepage=never to kernel command line in /boot/grub/grub.conf


file. For example:

kernel /boot/vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=a216d1e5-884f-4e5c-859a-


6e2e2530d486 rhgb quiet transparent_hugepage=never

Reboot the server for changes to take effect.

# reboot

I/O scheduler

The default CFQ I/O scheduler is appropriate for most workloads, but does not offer
optimal performance for database environments. Instead, one of the following IO
schedulers should be used:
The deadline scheduler is recommended for physical storage
The noop scheduler is recommended for virtual storage

NUMA balancing

- Auto NUMA balancing

* By default on RHEL7 numa_balancing is enabled. This can see an impact for Oracle
workload so the best practice is to prevent the NUMA balancing.

configure kernel.numa_balancing = 0 in /etc/sysctl.conf and run sysctl -p

Reference

2016 - Deploying Oracle RAC Database 12c on Red Hat Enterprise Linux 7 - Best
Practices
2016 - Deploying Oracle Database 12c on Red Hat Enterprise Linux 7- Recommended
Practices
2014 - Red Hat Enterprise Linux 7 - Using Tuned for Tuning an Oracle Workload
2014 - Deploying Oracle Database 12c on Red Hat Enterprise Linux 6
2013 - Deploying Oracle RAC 11g R2 Database on Red Hat Enterprise Linux 6 - Best
Practices
2013 - Deploying Oracle Database 11g R2 on Red Hat Enterprise Linux 6 - Best
Practices
2008 - Deploying Oracle 10g RHEL 5

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 8/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

[1] Metalink is now referenced as "My Oracle Support". This is Oracle's official electronic
online support serves portal. Users will need a valid Oracle support contract in order to login
and read the referenced Notes herein.

the

Product(s)
Red Hat Enterprise Linux Component
kernel Category
Performance tune

Tags
labs_rheltfo
oracle
performance
performance_tuning
rhel_4
rhel_5
rhel_6
rhel_7

This solution is part of Red Hat’s fast-track publication program, providing a huge library of
solutions that Red Hat engineers have created while supporting our customers. To give you
the knowledge you need the instant it becomes available, these articles may be presented in
a raw and unedited form.

People who viewed this solution also viewed

Why Oracle 12c is reporting missing __tls_get_addrglibc_2-3/ in compilation ?

Solution - 3 Feb 2017

Is there a tuned profile available for Oracle RDBMS?

Solution - 28 Apr 2020

Why does Oracle installation is failing with "You are attempting to install 64-bit Oracle
on a 32-bit operating system." ?

Solution - 13 Feb 2016

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation Asi… 9/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

41 Comments
17 October 2011 2:55 PM
WJ wjmurcia

COMMUNITY Next line is incomplete:


MEMBER

30 Points

How often pdflush is activated to clean dirty pages (hundreths of a....        


vm.dirty_writeback_centisecs=100

≤ Reply

18 October 2011 5:32 AM

David Powles

RED HAT
Thanks for the feedback! I've corrected the article.
GURU

25394 ≤ Reply
Points

23 January 2012 5:08 PM


PQ Paul Qu

NEWBIE If use Huge Page, no need for other vm.* parameters tuning as Huge Page memory
5 Points does not swap.

≤ Reply

30 October 2012 7:27 PM


HL HP Linux Engineering team

COMMUNITY Oracle on MOS 811306.1 actually recommends setting swappiness to 100, what's the
MEMBER
deal ?
46 Points

≤ Reply

20 November 2012 12:45 AM


GU guzenkov

GURU The article mentions /etc/sysconfig/sysctl.conf

PRO Is this a typo and /etc/sysctl.conf was meant? Or if it is a valid file, then can you
2378 please advise the difference with /etc/sysctl.conf
Points

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 10/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

≤ Reply
20 November 2012 3:57 AM
YB Yogesh Babar

RED HAT
Hello,
EXPERT

809 Thanks for catching this, indeed it should be /etc/sysctl.conf. I have corrected the
Points article.

≤ Reply

20 November 2012 5:22 AM


GU guzenkov

GURU no worries. Thank you for quick response! and for the article
PRO

2378 ≤ Reply
Points

16 July 2013 6:41 PM


JE jejohnso@redhat.com

RED HAT
.
COMMUNITY
MEMBER

57 Points
≤ Reply

23 October 2013 3:32 AM


UB Ugo Bellavance

COMMUNITY I got a notification saying that this article changed... Is there a way to know what
MEMBER
changed?
96 Points

≤ Reply

24 October 2013 2:31 PM

Marc Milgram

RED HAT
Ugo,
GURU

1519 That is a great question. I don't know of any way that non-Red Hat associates can
Points see what changed.

I took a look at the changes. The only substantive changes were the
recommendations relating to kernel.sem.

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation As… 11/22


26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

≤ Reply
17 January 2014 11:27 PM
AN annerobbins

NEWBIE Question about the huge pages value calculation: my understanding is that PGA
10 Points does not use huge pages, so why is that included in the calculation? Elsewhere, for
instance on some Oracle sites, I've seen a hugepages_setting.sh script that does its
calculations from ipcs.

≤ Reply

18 January 2014 4:13 AM

Roger Lopez

RED HAT
Hi Anne,
ACTIVE
CONTRIBUTOR
You are right on the PGA does not use huge pages.The goal of setting up huge
207
Points
pages is to provide the correct number of pages to handle the running shared
memory segments used by the SGA. An easy way to calculate the number of huge
pages without using the hugepages_settings.sh script created by Oracle is to take
the size of your SGA in kilobytes and divide that by the huge page size from the OS.
In RHEL, the page size is 2048 kb. So the calculation would be: SGA in kilobytes /
2048 (huge page size). Once you have this size, you should add a few additional
huge pages just to ensure all of the SGA can fit in large pages. After you have set
this piece up, you also need to set the memlock parameter within your limits.d conf
file located in /etc/security/limits.d/ directory). Setting memlock allows the oracle
user to lock a certain amount of memory from physical RAM that isn't swapped out.
The value is expressed in kilobytes and is important from the Oracle perspective
because it provides the oracle user permission to use huge pages. So the next
question might be how do I know if Oracle is using the huge pages? Well you can
check cat /proc/meminfo and look at the hugepages total and hugepages free and
see how the value goes down when you start your Oracle db instance. The other
place to look is in the Oracle alert log. Within the alert log search for the word
'Large' and you should see something like:

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

Thu Jan 16 16:55:07 2014

Per process system memlock (soft) limit = UNLIMITED

Thu Jan 16 16:55:07 2014

Total System Global Area in large pages = 19 GB (100%)

Thu Jan 16 16:55:07 2014

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 12/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

Large pages used by this instance: 9665 (19 GB)

Thu Jan 16 16:55:07 2014

Large pages unused system wide = 3 (6144 KB)

Thu Jan 16 16:55:07 2014

Large pages configured system wide = 9668 (19 GB)

Thu Jan 16 16:55:07 2014

Large page size = 2048 KB

Thu Jan 16 16:55:07 2014

In this example the key line was: Total System Global Area in large pages = 19 GB
(100%) as it shows that the Total SGA is in large pages.

As a shameless plug check out my Deploying Oracle 11gR2 on RHEL6 reference


architectures at: https://access.redhat.com/site/articles/395013 and my Deploying
Oracle 11gR2 RAC on RHEL6 at: https://access.redhat.com/site/articles/479093

If you have any other questions, feel free to reply to this. :)

Hope that helped and have a great weekend,

Roger

≤ Reply

18 January 2014 4:15 AM

Roger Lopez

RED HAT
Forgot to mention, to value of memlock should be slightly bigger than the size of the
ACTIVE
CONTRIBUTOR Oracle SGA in kilobytes.
207
Points ≤ Reply

10 September 2014 10:23 AM


VS vsmirnov_smart

COMMUNITY Roger, but you didn't explain why RedHat recommmends in this article reserve huge
MEMBER
pages for

22 Points
"+ PGA + (20 KB * # of Oracle processes running)".

You agree that PGA doesn't use shared memory.

You add some pages to SGA size for safety.

But PGA can be huge. And it's advisable parameter - Oracle tries to limit PGA by
pga_aggregate_target, but it cann't guarantee it and it/s normal behaviour.

If you cann't explain it "+ PGA + (20 KB * # of Oracle processes running)" - remove it

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 13/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

from article.

It looks that RedHat doesn't know from where it comes but it leaves it in article.

It's not good.

≤ Reply

16 September 2014 2:38 PM

Fabio Tavano

COMMUNITY I'm interested too to know why the author of the article (good for the other aspects)
MEMBER
take in account also PGA and number of oracle processes.
47 Points

I didn't found that calculation in any Oracle knowledge base.

Hope to read from Roger soon.

Regards

≤ Reply

21 January 2014 5:55 PM


AN annerobbins

NEWBIE Thank you very much for your responses. A couple of questions: Any strong reason
10 Points not to set memlock for Oracle to unlimited (as shown in your log example)? Is there
a really great risk of Oracle getting out of hand and fixing more memory than its
SGA? This would certainly reduce the need to change this setting every time SGA is
increased.

And, yes, I have seen at least one of your articles mentioned above, which brings me
to my next question. A couple of the settings you recommend differ significantly
from those in this article, the most dramatic difference being dirty_pages_ratio,
which you recommend raising significantly from the default, while this article
recommends lowering it. Did you specifically have RH 6 in mind when you made that
recommendation - would you make the same recommendation for RH 5? I have
seen the KB article 348683 that seems to imply that the setting should be done in
bytes, not ratio, if using huge pages at RH 5 - another thing on the to-do list for
huge pages?

≤ Reply

22 January 2014 4:15 AM

Roger Lopez

RED HAT
Hi Anne,
ACTIVE
CONTRIBUTOR
https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 14/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

207 I'm not sure why the log shows the memlock value as unlimited, because I definitely
Points have a value set. I don't think there is a great risk of Oracle getting out of hand and
fixing more memory than its SGA. Oracle is just looking to see if large pages are
available and if it can accommodate all the memory of the SGA into large pages. As
for the value set for memlock, I'd set it to slightly larger than what you believe will be
your largest SGA at any point in time. This way all your use cases with a smaller SGA
are taken care of.

With regards to the dirty_ratio, the reason I increased the value from what you
normally see as 15 to 80 is based on my understanding of dirty ratio. Dirty ratio
defines the maximum percentage of total memory that can be filled with dirty pages
before user processes are forced to write dirty buffers themselves during their time
slice instead of being allowed to do more writes. Note that all processes are blocked
for writes when this happens, not just the one that filled the write buffers. This can
cause what is perceived as an unfair behavior where a single proces can hog all the
I/O on a system. However, an application that can handle their writes being blocked
altogether might benefit from decreasing the value.

The biggest thing I want to point out about kernel parameters in general is that
there is no perfect answer. Every workload is different and requires performance
testing. These values should just be seen as a starting point for your workload. The
behavior of this parameter to my knowledge is the same for RHEL5 and RHEL6 so it
would apply to both distributions.

The vm.dirty_background_bytes and vm.dirty_bytes is something I'm looking into


further but have not tested personally. Due to that, I'm sticking to the use of ratios
until I'm able to do some performance testing around the difference between using
ratios vs bytes parameters.

Hope that helps and if you have any other questions feel free to ask :)

Take care,

Roger

≤ Reply

28 January 2014 2:55 PM

Miguel Perez Colino

RED HAT
The grub modification can be done by issuing the following command:

ACTIVE
CONTRIBUTOR grubby --update-kernel=ALL --args="transparent_hugepage=never"
268
Points
(via eminguez)

≤ Reply
https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 15/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

21 March 2014 10:00 AM


RN Ramkumar Natarajan

COMMUNITY HugePages:

MEMBER
Missed the line in sysctl.conf,

30 Points
without mentioned oracle/dba group id, oracle user not able to access the huge
pages.

vm.huge_tlb_shm_group = gid

≤ Reply

28 July 2014 11:40 PM


GK gkim_AMP

NEWBIE 75% of System Memory in bytes

17 Points mem=$(free|grep Mem|awk '{print $2}') # KiB

totmem=$(echo "$mem1024"|bc) # B

max=$(echo "$totmem75/100"|bc) # B
HugePages in KiB

huge=$(grep Hugepagesize /proc/meminfo|awk '{print $2}') # KiB

all=$(echo "$max/$huge"|bc)

So in the above calculation you have B / KiB .. i think $huge should also be put into
the same metrics (Bytes).. (times $huge by 1024)

≤ Reply

29 July 2014 1:56 AM


GK gkim_AMP

NEWBIE kernel.shmall is measured in "pages". In the summit notes and this guide it is
17 Points assumed the pages is 2MiB (that is why you divide by 'hugepagesize'). When i set
the value in /etc/sysctl.conf and use ipcs -l to confirm the new size i find that the
O/S is multiplying the value in a page size of 4KiB rather than 2MiB.

Any guidance on how to set and check shared memory values when hugepages is in
use?

≤ Reply

10 September 2014 8:18 AM


VS vsmirnov_smart

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 16/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal
COMMUNITY
MEMBER
1. Calculate the recommended number of HugePages using the formula
22 Points below, using Hugepagesize and >the System Global Area (SGA) and
Program Global Area (PGA) values from Oracle. See Oracle
>documentation for more about SGA and PGA, and where to find those
values:

(SGA + PGA + (20 KB * # of Oracle processes running)) / (Hugepagesize)

Why we reserve hugepages for PGA and for (20 KB * # of Oracle processes
running) ?

Oracle stated that hugepages are used only for SGA(shared memory).

≤ Reply

13 November 2014 4:40 PM


BS Bret Sanders

COMMUNITY Some of the recommended values differ from at least one of the referenced articles,
MEMBER
like https://access.redhat.com/articles/395013, which we have been following. Which
29 Points
article do we follow and why? Is the intent of this one to correct the previous?

≤ Reply

24 February 2015 10:43 AM


AS Ameya Sathe

RED HAT
The solution does not mention the environment of Red Hat Enterprise Linux 7. Is it
ACTIVE
CONTRIBUTOR not verified?
103 Points
≤ Reply

6 May 2015 3:49 PM


UB Ugo Bellavance

COMMUNITY Is it me or this KB solution article looks totally not professionnal? Tons of comments,
MEMBER
but we don't know it's valid or not, or included in the article or not. Also, there is no
96 Points
way to know what has been edited since the last version of the article. I recive
notifications when it changes, but have no idea what changes every time.

≤ Reply

6 May 2015 3:51 PM

Ugo Bellavance

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 17/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

Isn't there a way to keep tuned enabled, but have it disable transparent huge pages?
UB See here: https://access.redhat.com/sites/default/files/attachments/deploying-
oracle-11gr2-rac-on-rhel6_1.1.pdf
COMMUNITY
MEMBER
By the same token, why not integrate this article in this document, once all the
96 Points
parameters are validated?

≤ Reply

29 September 2015 10:30 PM


JG Jose Gonzalez Goni

COMMUNITY
MEMBER Gi Kim
93 Points
75% of System Memory in bytes

mem=$(free|grep Mem|awk '{print $2}') # KiB

totmem=$(echo "$mem1024"|bc) # B

max=$(echo "$totmem75/100"|bc) # B

HugePages in KiB

huge=$(grep Hugepagesize /proc/meminfo|awk '{print $2}') # KiB

all=$(echo "$max/$huge"|bc)

So in the above calculation you have B / KiB .. i think $huge should also be put
into the same metrics (Bytes).. (times $huge by 1024)"

I completely agree with Gi Kim on this.

I do not believe you can divide Bytes by KB. It is a simple maths rule.

Also this calculation will produce the wrong results.

Furthermore if you were to convert the huge page size to Bytes, the value of shmall
would be way too small.

Also, every other article in RH KB and on the internet use the system page size
(4096 Bytes) for this calculation.

Could you please clarify.

Thanks

≤ Reply

5 October 2015 9:06 PM


KW Kyle Walker

RED HAT
Well spotted! I have corrected this calculation so that like-units carry through the
EXPERT
calculation. This should be a much more correct resulting value for the shmmax
tunable (measured in bytes)
https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 18/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

1005
≤ Reply
Points

3 December 2015 2:02 AM


JG Jose Gonzalez Goni

COMMUNITY The calculation for shmall and shmmax is buggy.


It seems that the free command
MEMBER
does not always show the full number of bytes.
i.e:
93 Points

#free -h
total used free shared buffers cached
Mem: 19G 18G 826M 4.9G 397M 16G
-/+ buffers/cache: 1.9G 17G
Swap: 49G 0B 49G
#free -b
total used free shared
buffers cached
Mem: 2095443148 2008875008 865681408 5300641792 416825344
1759333171
-/+ buffers/cache: 2078593024 1887583846
Swap: 5368289280 0
5368289280

In this case, 19GB = 20954431488 bytes but free -b shows 2095443148 bytes (note
the missing 8 at the end).

I suggest using this:

memkb=$(grep MemTotal /proc/meminfo | awk '{print $2}')


mem=$(echo "$memkb
* 1024" | bc)

Thanks

≤ Reply

19 July 2016 5:54 PM


TC Toronto Transit Comission

COMMUNITY not complete


MEMBER

55 Points
≤ Reply

20 October 2016 1:15 PM


JA jaesys

NEWBIE System Z
9 Points
≤ Reply

19 April 2017 5:28 PM


UB Ugo Bellavance

COMMUNITY There is now a tuned-profiles-oracle package for RHEL6 and 7. I think the article
MEMBER
should be updated to reflect tuned's usage.
96 Points
https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 19/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

≤ Reply

15 May 2017 9:39 PM


JN Jason Nance

NEWBIE It seems that this guide isn't quite in sync with the tuned profile provided by tuned-
12 Points profiles-oracle in EL 6.8 and higher. Which is the more up-to-date resource?

≤ Reply

5 March 2018 6:23 PM


DW Daniel White

ACTIVE Here is a question for the community: Would it break Oracle to make all the
CONTRIBUTOR
associated user accounts as system accounts that one cannot log in as (directly) ?
253
Points
≤ Reply

3 August 2018 4:31 PM


PC Purav Chovatia

COMMUNITY Can somebody pls confirm if I can straightaway change the IO scheduler from CFQ
MEMBER
to Deadline? We are running 12c RAC on RHEL 6 and I strongly suspect there is IO
65 Points
slowness. Reason being, in the lab systems we get much better performance but
that is on RHEL 7 (default IO scheduler is Deadline) whereas production is on RHEL
6 and IO is slow. Thanks

≤ Reply

3 August 2018 4:50 PM


BT Benjamin Turner

RED HAT
Yes you can change the scheduler on the running system, just run:
ACTIVE
CONTRIBUTOR
echo 'deadline' > /sys/block//queue/scheduler
172 Points
And verify with:
cat /sys/block//queue/scheduler

≤ Reply

4 August 2018 7:54 AM


PC Purav Chovatia

COMMUNITY
MEMBER
https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 20/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

65 Points Thanks Ben. I do understand that IO scheduler can be changed on a running system.
I should have worded my question more appropriately. Let me re-phrase: This KB
states "The default CFQ I/O scheduler is appropriate for most workloads, but does
not offer optimal performance for database environments. Instead, one of the
following IO schedulers should be used:
The deadline scheduler is recommended for
physical systems"
Given that ours is a physical system, can I, rather, should I change
it in production considering it as a 'given' i.e. without really verifying or should I take
some stats and verify first before making that change? Reason being, I strongly
suspect that the IO on my production is slow. This is because when I run the same
workload in labs I dont see await times as high as in production. I have gone through
KB https://access.redhat.com/solutions/54164 and the symptons mentioned in it do
not match. So iostat o/p does not help me conclude very clearly if CFQ is the issue
and deadline will solve the IO slowness. Even if does not solve, as far as it wont harm,
I am ok.
for e.g. I analyzed the iostat o/p using various different commands (iostat -
dkNx 2 600, iostat -tkx 2 600, iostat -dmzx 2 600) but I always see rrqm/s &
wrqm/s as 0. However, RHEL 7 has made Deadline as the default scheduler which
kind of, further confirms that it is better as compared to CFQ. Even Oracle EL has
Deadline as the default. So given that iostat is not helping to conclude but since this
KB and various other articles on the internet suggest deadline for Oracle databases,
I wanted to know if I can go ahead making that change in prod.

Many Thanks

≤ Reply

12 November 2018 8:10 PM

ir. Jan Gerrit Kootstra


 Community Leader

GURU Is there an update of this article for Oracle 18 and RAC 18?
11998
Points ≤ Reply

18 February 2019 1:33 PM


PV Parveen Verma

COMMUNITY Why still using SGA/PGA and NOT Memory_TARGET?


Let Oracle take control of all
MEMBER
internals [https://docs.oracle.com/database/121/ADMQS/GUID-E6784230-0A0C-
30 Points
443D-8537-36FFA08A7E75.htm#ADMQS12039].
We can then run our load for
different tests for some days and check what value is suggested by
V$MEMORY_TARGET_ADVICE.

≤ Reply

21 October 2020 12:28 PM


https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 21/22
26/10/2021, 16:13 Tuning Red Hat Enterprise Linux for Oracle and Oracle RAC performance - Red Hat Customer Portal

Alexay Ivanov

AI What about Red Hat Enterprise Linux 8 ?


COMMUNITY
MEMBER ≤ Reply
87 Points

21 October 2020 1:03 PM

ir. Jan Gerrit Kootstra


 Community Leader

GURU Hi Alexay,
11998
Points The automatic config generator supports RHEL 8.

Regards,

Jan Gerrit

≤ Reply

Copyright © 2021 Red Hat, Inc.

https://access.redhat.com/solutions/39188?band=se&seSessionId=ee577279-9c14-41a6-8392-0214edbd80fe&seSource=Recommendation A… 22/22

You might also like