AIX Performance: Configuration & Tuning For Oracle & Oracle RAC
AIX Performance: Configuration & Tuning For Oracle & Oracle RAC
AIX Performance:
Configuration & Tuning for Oracle & Oracle RAC
Vijay Adik
[email protected]
ATS - Oracle Solutions Team
December 5, 2013
Legal information
The information in this presentation is provided by IBM on an "AS IS"
basis without any warranty, guarantee or assurance of any kind. IBM also
does not provide any warranty, guarantee or assurance that the
information in this paper is free from errors or omissions. Information is
believed to be accurate as of the date of publication. You should check
with the appropriate vendor to obtain current product information.
Any proposed use of claims in this presentation outside of the United
States must be reviewed by local IBM country counsel prior to such use.
IBM, RS6000, System p, AIX, AIX 5L, GPFS, and Enterprise Storage Server
(ESS) are trademarks or registered trademarks of the International
Business Machines Corporation.
Oracle, Oracle9i, Oracle10g and Oracle 11g are trademarks or registered
trademarks of Oracle Corporation.
All other products or company names are used for identification
purposes only, and may be trademarks of their respective owners.
December 5, 2013
Agenda
AIX Configuration Best Practices for Oracle
Memory
CPU
I/O
Network
Miscellaneous
December 5, 2013
December 5, 2013
Agenda
AIX Configuration Best Practices for Oracle
Memory
CPU
I/O
Network
Miscellaneous
December 5, 2013
On AIX 5.3, number of the default vmo settings are not optimized for
database workloads and should be modified for Oracle environments
8
December 5, 2013
December 5, 2013
Requests for new memory pages are satisfied from the free page list
Small reserve of free pages maintained by stealing Computational or File pages
AIX uses demand paging algorithm generally not written to swap file until stolen
Memory Use
FScache%
100
90
80
70
60
50
40
30
20
10
11
10:14
10:10
10:06
10:02
09:58
09:54
09:50
09:46
09:42
09:38
09:34
09:30
09:26
09:22
09:18
09:14
09:10
09:06
09:02
08:58
08:54
08:50
08:46
08:42
08:38
08:34
08:30
08:26
08:22
08:18
08:14
08:10
08:06
08:02
December 5, 2013
September 2012
December 5, 2013
Once written to paging space, pages are not removed from paging space
until the process associated with those pages terminates
For long running processes (e.g. Oracle DB), even low levels of system paging can result in
significant growth in paging space usage over time
Paging space should be considered a fail-safe mechanism for providing sufficient time to identify and
correct paging issues, not a license to allow ongoing system paging activity
Physical
Memory
lower or
equal to
Paging
Space
Max
128GB
60GB
256GB
100GB
512GB
150GB
1TB
200GB
13
December 5, 2013
Unused
File cache
Process
*1
*1
100%
System memory
physical
memory
AIX pinned
4% *1
metadata cache
10% *1
Inode cache
Can not
be paged
!
*1 Note: Default values in AIX 7.1 are 200 (5%) , 200 (2%)
14
14
2013 IBM Corporation
December 5, 2013
Physical Memory
17
Time
comp%
minfree
Free%
minperm%
maxperm%
December 5, 2013
December 5, 2013
December 5, 2013
Recommend
Value
AIX 7.1
Restricted
AIX 6.1
Default
AIX 6.1
Restricted
AIX 5.3
Default
minperm%
No
No
20
maxperm%
90
90
Yes
90
Yes
80
maxclient%
90
90
Yes
90
Yes
80
strict_maxclient
Yes
Yes
strict_maxperm
Yes
Yes
lru_file_repage
N/A
N/A
Yes
1 or 0(*1)
lru_poll_interval
10
10
Yes
10
Yes
10
minfree
960
960
No
960
No
960
maxfree
1088(*2)
1088
No
1088
No
1088
page_steal_method
Yes
Yes
memory_affinity
Yes
Yes
v_pinshm
No
No
lgpg_regions
No
No
lgpg_size
No
No
maxpin%
Leave at Default
90(*3)
No
80(*3)
No
80
AIX 7.1
Default
*2 Do not reduce below default *3 Depends on LSA use LSA active 90, otherwise 80
December 5, 2013
December 5, 2013
24
2013 IBM Corporation
September 2012
December 5, 2013
64K, available with POWER5+ and later & AIX 5.3 TL4+
16M available with POWER4 hardware (or later) (also referred to as Large Pages)
Requires pinned memory and explicit configuration
Can not be paged to paging space
26
December 5, 2013
14 :02
14 :02
14 :02
14 :03
14 :03
14 :03
14 :03
14 :04
14 :04
14 :04
14 :05
14 :05
14 :05
14 :06
14 :06
14 :06
14 :06
14 :07
14 :07
14 :07
14 :08
14 :08
14 :08
14 :09
14 :09
14 :09
14 :09
14 :10
14 :10
14 :10
14 :11
14 :11
14 :11
14 :12
14 :12
14 :12
14 :12
14 :13
14 :13
14 :13
14 :14
14 :14
14 :14
14 :15
14 :15
14 :15
14 :15
14 :16
14 :16
14 :16
14 :17
14 :17
14 :17
14 :18
M B used
5000
4500
4000
2500
27
16MB pages
3500
3000
64kb free
2000
64KB pages
4kb free
64kb used
1500
4KB pages
1000
500
4kb used
Time
December 5, 2013
export
LDR_CNTRL=DATAPSIZE=64K@TEXTPSIZE=64K@STACKP
SIZE=64K@SHMPSIZE=64K to use the 64K pagesize for
stack, data & text
28
Refer: http://www03.ibm.com/systems/resources/systems_p_os_aix_whitepa
pers_multiple_page.pdf
2013 IBM Corporation
December 5, 2013
vmo p o v_pinshm = 1
Leave maxpin% at the default of 80% unless the SGA exceeds 77% of real memory
Oracle Parameters
LOCK_SGA = TRUE
Note: It is recommended not to pin SGA, as long as you had configured the VMM, SGA & PGA
properly.
29
December 5, 2013
SGA regions
Size in Bytes
------------------------------
----------------
Database Buffers
16,928,210,944
Fixed Size
768,448
Redo Buffers
2,371,584
Variable Size
1,241,513,984
----------------
sum
18,172,864,960
30
December 5, 2013
December 5, 2013
Oracle dynamically allocates memory for the SGA only as needed up to the size
specified by SGA_TARGET
SGA_TARGET may be dynamically increased, up to SGA_MAX_SIZE
64K pages automatically used for SGA if supported in the environment. If needed,
4K (or 16M) pages are converted to 64K pages.
LOCK_SGA=true
Discouraged
December 5, 2013
33
December 5, 2013
December 5, 2013
December 5, 2013
36
-v
1048576
1002006
812111
1
141103
80.0
3.0
90.0
3.2
32779
0.0
0
0.0
90.0
0
0
0
0
2484
0
0
memory pages
lruable pages
free pages
memory pools
pinned pages
maxpin percentage
minperm percentage
maxperm percentage
numperm percentage
file pages
compressed percentage
compressed pages
numclient percentage
maxclient percentage
client pages
remote pageouts scheduled
pending disk I/Os blocked with no pbuf
paging space I/Os blocked with no psbuf
filesystem I/Os blocked with no fsbuf
client filesystem I/Os blocked with no fsbuf
external pager filesystem I/Os blocked with no fsbuf
December 5, 2013
inuse
free
pin
virtual
memory
1179648
926225
290287
493246
262007
pg space
1572864
5215
work
pers
clnt
other
91390
74176
258573
4316
335656
PoolSize
inuse
pgsp
pin
virtual
pin
in use
PageSize
37
4 KB
477713
5215
94606
141175
64 KB
7552
4435
7552
16 MB
80
80
December 5, 2013
December 5, 2013
vmo -r -o vmm_klock_mode=2
It is enabled by default in 7.1 and can be enabled on 6.1 TL6.
There were cases of Oracle RAC node eviction due to higher memory allocation and/or bug/feature
Make sure you are in this release : AIX 6.1 TL6 SP5+, plus APAR IZ95744
USLA heap issue:
With the release of 11gR2, Oracle introduced a new feature called on line patching and is
supported on AIX 6.1 TL02 and 7.1 TL0 onwards
Upgrade to AIX 6.1 TL07 or AIX 7.1 TL01, and then apply the Oracle bug patch 13443029 for
database 11.2.0.2 and 11.2.0.3
If you cannot upgrade to AIX 6.1 TL07 or 7.1 TL01, then apply Oracle patch 10190759, which will
have a reduced online-patch functionality
It is recommended to use AIX 6.1 TL07 SP02 or AIX 7.1 TL01 SP02
P7 special patch:
Patch 6784747 - Wasted memory in koh-kghu allocations. Free extents of memory might not get
used.
This bug impacts 10.2.0.4/5 and 11.1.0.x releases. This fix is not included in any of the PSU. This
issue is fixed in Oracle 11.2.0.1 onwards
39
December 5, 2013
Agenda
AIX Configuration Best Practices for Oracle
Memory
CPU
I/O
Network
Miscellaneous
40
December 5, 2013
CPU Considerations
Oracle Parameters based on the # of CPUs
DB_WRITER_PROCESSES
Degree of Parallelism
user level
table level
query level
MAX_PARALLEL_SERVERS or
AUTOMATIC_PARALLEL_TUNING (CPU_COUNT *
PARALLEL_THREADS_PER_CPU)
CPU_COUNT
FAST_START_PARALLEL_ROLLBACK should be using UNDO
instead
CBO execution plan may be affected; check explain plan
41
December 5, 2013
AIX 5.3
AIX 5.3
AIX 6.1
LPAR
LPAR
Micro
Micro
SMT=off
SMT=on
Partition
Partition
SMT=on
SMT=off
LL LL LL LL
2 CPUs
1 CPU
(dedicated)
(dedicated)
L L L L LL
L L L L L L Logical
V V V V
2.1 Proc. Units
AIX 7.1
Micro
Partition
SMT-4
Shared Pool 0
Virtual
Physical
Pool 1
* All activated, non-dedicated CPUs are automatically placed into the shared processor pool.
Only 2.1+0.8+1.2 = 4.1 processor units of desired capacity has been allocated from the pool of 13 CPUs
44
December 5, 2013
LPAR1
LPAR2
LPAR3
i5/OS
AIX
Linux
LPAR4
LPAR5
LPAR6
LPAR7
LPAR8
Uncapped
Uncapped
Uncapped
Uncapped
Uncapped
AIX
AIX
AIX
AIX
AIX
OAS
OAS
OAS
Oracle DB
Oracle DB
App 1
App2
App 3
VP = 5
VP = 4
VP = 4
VP = 6
VP = 3
Ent. = 2.5
Ent. = 1.70
Ent. = 2.00
Ent. = 2.00
Ent. = 1.00
Oracle
DB
1
December 5, 2013
# schedo o vpm_xvcpus=[-1 | N]
Where N specifies the number of VPs to enable in addition to the number of VPs needed to
consume physical CPU utilization
A value of -1 disables CPU folding
46
December 5, 2013
SMT
DLPAR
MicroPartition
WPAR
LPM
AME
AIX 5.2
AIX 5.3
AIX 6.1
AIX 7.1
Oracle 9i
*1
*3
*2
*4
Oracle 10g
Oracle 11g
*5
*1 - 10.2.0.4 with minimum of AIX 5.3 TL8 SP4 or AIX 6.1 TL2 SP3
*2 - 11gR1 with AIX 6.1 TL3 SP1, 11gR2 with AIX 5.3 TL9 SP6, 11gR2 with AIX 6.1 TL4 SP1
Note: Live partition mobility is certified for 10.2.0.4 and AIX 5.3
*3 10.2.0.4 with minimum AIX 6.1 TL2 SP2 (No AIX 7.1 support at this time)
TL8 SP4 & 6.1 TL2 SP3.
*4 11.2.0.2 with minimum AIX 6.1 TL2 SP2 (No AIX 7.1 support at this time)
*5 11.2.0.2 and above with minimum AIX 6.1 TL6 SP5 and AIX 7.1
Oracle RAC 10.2.0.3 on VIOS 1.3.1.1 & AIX 5.3 TL07 and
higher are certified.
50
December 5, 2013
Agenda
AIX Configuration Best Practices for Oracle
Memory
CPU
I/O
Network
Miscellaneous
51
December 5, 2013
Application
Logical file system
Raw LVs
Raw disks
JFS JFS2
NFS
Other
VMM
December 5, 2013
GPFS
Clustered filesystem the IBM filesystem for RAC
Non-cached, non-blocking I/Os (similar to JFS2 CIO) for all Oracle files
GPFS and JFS2 with CIO offer similar performance as Raw Devices
53
December 5, 2013
December 5, 2013
JFS
JFS2
Note:
55
Oracle 9i
Oracle 10g/11g
Set filesystemio_options=SETALL
-orUse dio mount option
Set filesystemio_options=SETALL
-orUse dio mount option
Set filesystemio_options=SETALL
-orUse cio mount option
December 5, 2013
Oracle Datafiles
Oracle Redolog
Oracle Archivelog
mount -o rw
mount -o rw
Cached by AIX
Cached by AIX
mount -o rw
Cached by Oracle
Cached by AIX
mount -o rw
Cached by Oracle
Cached by AIX
mount -o rw
mount -o cio *
(1)
Cached by Oracle
mount -o cio (jfs2 + agblksize=512)
Cached by Oracle
mount -o rw
mount -o rbrw
Use JFS2 write-behind X
but are not kept in AIX Cache.
mount -o rw
Cached by AIX
Cached by AIX
Cached by AIX
56
December 5, 2013
December 5, 2013
September 2012
December 5, 2013
66
66
2013 IBM Corporation
December 5, 2013
num_cmd_elems
num_cmd_elems
num_cmd_elems
num_cmd_elems
67
67
2013 IBM Corporation
Num HBA
num_cmd_elems
December 5, 2013
December 5, 2013
IO : Asynchronous IO (AIO)
Allows multiple requests to be sent without to have to wait until the disk subsystem has
completed the physical IO.
Utilization of asynchronous IO is strongly advised whatever the type of file-system and mount
option implemented (JFS, JFS2, CIO, DIO).
Application
2
aio
Q
aioservers
Disk
Posix vs Legacy
Since AIX5L V5.3, two types of AIO are now available : Legacy and Posix. For the moment, the
Oracle code is using the Legacy AIO servers.
70
December 5, 2013
AIX Kernel
Application
Disk
2
Raw Devices / ASM :
check AIO configuration with : lsattr El aio0
enable asynchronous IO fast_path. :
AIX 5L : chdev -a fastpath=enable -l aio0 (default since AIX 5.3)
AIX 6.1/7.1 : ioo p o aio_fastpath=1
(default setting)
71
December 5, 2013
72
December 5, 2013
Async I/O:
Oracle parameter filesystemio_options is ignored
Set Oracle parameter disk_asynch_io=TRUE
Prefetchthreads= exactly what the name says
Usually set prefetchthreads=64 (the default)
Other settings:
GPFS block size is configurable; most will use 512KB-1MB
Pagepool GPFS fs buffer cache, not used for RAC but may be for
binaries. Default=64M
mmchconfig pagepool=100M
73
December 5, 2013
September 2012
December 5, 2013
device needs to be first unlocked and then locked again with the new text
label specified.
75
September 2012
December 5, 2013
ASM configurations
AIX parameters
Async I/O needs to be enabled, but default values may be used
DB instance parameters
76
disk_asynch_io=TRUE
filesystemio_options=ASYNCH
Increase Processes by 16
Increase Large_Pool by 600k
Increase Shared_Pool by [(1M per 100GB of usable space) + 2M]
December 5, 2013
I/O Pacing
I/O Pacing parameters can be used to prevent large I/O
streams from monopolizing CPUs
77
December 5, 2013
Agenda
AIX Configuration Best Practices for Oracle
Memory
CPU
I/O
Network
Miscellaneous
78
December 5, 2013
79
December 5, 2013
Examples:
# no -p -o tcp_sendspace=262144
# no -p -o tcp_recvspace=262144
# no -p -o rfc1323=1
80
December 5, 2013
81
December 5, 2013
December 5, 2013
Agenda
AIX Configuration Best Practices for Oracle
Memory
I/O
Network
Miscellaneous
83
December 5, 2013
Miscellaneous parameters
User Limits (smit chuser) /etc/security/limits
Environment variables:
AIXTHREAD_SCOPE=S
LDR_CNTRL=DATAPSIZE=64K@TEXTPSIZE=64K@STACKPSIZE=
64K@SHMPSIZE=64K
84
December 5, 2013
Show me the
I/O Speed
101
December 5, 2013
Sample Configuration
RamSan 70
P770 32core
3.55ghz 256gb
memory
AIX 7.1 / Oracle
11.2.0.3
PCIe
2-4gb Fiber
Channel
Data, index
Fiber Channel/
InfiniBand
RamSan 820 / 10-20 TB
Read IOPS 450 K IOPS
Data
Indexes
Existing SAN
storage
December 5, 2013
104
December 5, 2013
Regularly Updated!
http://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP101559
December 5, 2013
Oracle Documentation
Regularly Updated!
My Oracle Support: http://support.oracle.com
282036.1 - Minimum Software Versions and Patches
Required to Support Oracle Products on IBM Power
Systems
106
December 5, 2013
AIX
AIX 5.3 Product Documentation.
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.pseries.doc/hardware.htm
AIX 6.1 Product Documentation
http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp
AIX 7.1 Product Documentation
http://publib.boulder.ibm.com/infocenter/aix/v7r1/index.jsp
http://www.redbooks.ibm.com/cgi-bin/searchsite.cgi?query=sg247910 (IBM AIX Version 7.1 Differences
Guide)
IBM Wikis
https://www.ibm.com/developerworks/wikis/dashboard.action
AIX Wiki
http://www.ibm.com/developerworks/wikis/display/WikiPtype/Home
AIX Performance Tools (nmon, nmon analyser/consolidator, etc)
http://www.ibm.com/developerworks/wikis/display/WikiPtype/nmon
AIX DeveloperWorks
http://www.ibm.com/developerworks/aix
AIX multiple page supprt
http://www-03.ibm.com/systems/resources/systems_p_os_aix_whitepapers_multiple_page.pdf
Tuning IBM AIX 5L V5.3 and AIX 6.1 for Oracle Database on POWER systems
http://www304.ibm.com/partnerworld/wps/servlet/ContentHandler/whitepaper/aix/oracle/performance_analysis
PowerVM Wiki
https://www.ibm.com/developerworks/wikis/display/virtualization/Home
107
December 5, 2013
AIX / POWER
AIXpert Blog on Local, Near and Far Memory
https://www.ibm.com/developerworks/mydeveloperworks/blogs/aixpert/entry/local_near_far_memo
ry_part_1_large_power7_boxes_more_local_memory26?lang=en
Oracle Database and 1 TB Segment Aliasing (TD105761)
http://www.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/TD105761
IBM EnergyScale for POWER7 Processor-Based Systems
ftp://public.dhe.ibm.com/common/ssi/ecm/en/pow03039usen/POW03039USEN.PDF
Active Memory Expansion: Overview and Usage Guide
ftp://ftp.software.ibm.com/common/ssi/sa/wh/n/pow03037usen/POW03037USEN.PDF
IBM PowerVM Virtualization Active Memory Sharing
http://www.redbooks.ibm.com/abstracts/redp4470.html?Open
IBM System p Advanced POWER Virtualization (PowerVM) Best Practices
http://www.redbooks.ibm.com/abstracts/redp4194.html?Open
Power Systems Enterprise Servers with PowerVM Virtualization and RAS
http://www.redbooks.ibm.com/abstracts/sg247965.html?Open
108
December 5, 2013
Thank
You
109
December 5, 2013
Trademarks
The following are trademarks of the International Business Machines Corporation in the United States and/or other countries. For a complete list of IBM Trademarks, see www.ibm.com/legal/copytrade.shtml: AS/400,
DBE, e-business logo, ESCO, eServer, FICON, IBM, IBM Logo, iSeries, MVS, OS/390, pSeries, RS/6000, S/30, VM/ESA, VSE/ESA, Websphere, xSeries, z/OS, zSeries, z/VM
The following are trademarks or registered trademarks of other companies
Lotus, Notes, and Domino are trademarks or registered trademarks of Lotus Development Corporation
Java and all Java-related trademarks and logos are trademarks of Sun Microsystems, Inc., in the United States and other countries
LINUX is a registered trademark of Linux Torvalds
UNIX is a registered trademark of The Open Group in the United States and other countries.
Microsoft, Windows and Windows NT are registered trademarks of Microsoft Corporation.
SET and Secure Electronic Transaction are trademarks owned by SET Secure Electronic Transaction LLC.
Intel is a registered trademark of Intel Corporation
* All other products may be trademarks or registered trademarks of their respective companies.
NOTES:
Performance is in Internal Throughput Rate (ITR) ratio based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput that any user will experience will
vary depending upon considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be
given that an individual user will achieve throughput improvements equivalent to the performance ratios stated here.
IBM hardware products are manufactured from new parts, or new and serviceable used parts. Regardless, our warranty terms apply.
All customer examples cited or described in this presentation are presented as illustrations of the manner in which some customers have used IBM products and the results they may have achieved. Actual
environmental costs and performance characteristics will vary depending on individual customer configurations and conditions.
This publication was produced in the United States. IBM may not offer the products, services or features discussed in this document in other countries, and the information may be subject to change without notice.
Consult your local IBM business contact for information on the product or services available in your area.
All statements regarding IBM's future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only.
Information about non-IBM products is obtained from the manufacturers of those products or their published announcements. IBM has not tested those products and cannot confirm the performance, compatibility, or
any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.
Prices subject to change without notice. Contact your IBM representative or Business Partner for the most current pricing in your geography.
References in this document to IBM products or services do not imply that IBM intends to make them available in every country.
Any proposed use of claims in this presentation outside of the United States must be reviewed by local IBM country counsel prior to such use.
The information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may
make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the
materials for this IBM product and use of those Web sites is at your own risk.
110
December 5, 2013