Optimize Oracle On Linux
Optimize Oracle On Linux
Optimize Oracle On Linux
Agenda
Apply low hanging fruit fixes to speed up Oracle performance on Linux
Bert Scalzo
Database Expert & Product Architect for Quest Software
Oracle Background: Worked with Oracle databases for over two decades (starting with version 4) Work history includes time at both Oracle Education and Oracle Consulting Academic Background: Several Oracle Masters certifications BS, MS and PhD in Computer Science MBA (general business) Several insurance industry designations Key Interests: Data Modeling Database Benchmarking Database Tuning & Optimization "Star Schema" Data Warehouses Oracle on Linux and specifically: RAC on Linux Articles for: Oracles Technology Network (OTN) Oracle Magazine, Oracle Informant PC Week (eWeek) Articles for: Dell Power Solutions Magazine The Linux Journal www.linux.com www.orafaq.com
Books by Bert
Coming in 2009
Posted 12th consecutive quarter of double-digit growth Year-over-year revenue growth of 45.1% Unit shipments up 32.1% Revenue exceeded $1.4 billion quarterly (will reach 9.1 billion by 2008) HP was first with 24.3% market share IBM was second with 20.3% market share Customers continue to expand role of Linux servers into an ever increasing array of workloads in both commercial and technical segments of the market
Gartner Linux Servers:
One of hottest applications for Linux is on RDBMS servers Linux was the fastest growing platform for RDBMS past year Enterprises turning to Linux as an alternative for older Unixs
#1 OS !!!
www.netcraft.com/survey/index-200007.html
http://survey.netcraft.com/index-200106.html
http://news.netcraft.com/archives/2003/07/index.html
Popularity != Performance
Operating System
Database Network
Linux Tuning
Application
SQL Tuning
SQL Tuning Advice focus on application first, and then database and possibly network. Linux Tuning Advice focus on hardware, LINUX and Oracle database configurations.
Performance Pyramid
9.2
9.2 9.2 9.2 9.2 9.2
Certified
Certified Certified Certified Certified Certified
Test Method
TPC benchmark (www.tpc.org)
TPC Benchmark C (TPC-C) is an OLTP workload. It is a mixture of read-only and update intensive transactions that simulate the activities found in complex OLTP application environments. It does so by exercising a breadth of system components associated with such environments, which are characterized by: The simultaneous execution of multiple transaction types that span a breadth of complexity On-line and deferred transaction execution modes Multiple on-line terminal sessions Moderate system and application execution time Significant disk input/output Transaction integrity (ACID properties) Non-uniform distribution of data access through primary and secondary keys Databases consisting of many tables with a wide variety of sizes, attributes, and relationships Contention on data access and update Excerpt from TPC BENCHMARK C: Standard Specification, Revision 3.5
Test Platform
If your customer or management are willing to buy more hardware for better performance, then there is obviously budget for tuning tools press the issue! Golden Rule #1: Use OS & DB tuning tools! Golden Rule #2: Dont rely on free tools only!
Tools Used
This is not a sales pitch Im a DBA (a.k.a techno-nerd)!
Benchmark Factory Create, populate and index the test database (200 megs) Simulate 200 concurrent users via a single or many PCs LINUX Freebies Command line utilities: X-Windows utilities:
sar, mpstat, iostat, vmstat, linmon, ipcs, top, free, hdparm, linuxconf, slmon, gtop, ktop, xload, xosview, kperfmeter, gkrellmm, procmeter, gpowertweak,
w 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
swpd 122308 124608 127132 128836 130428 132052 133240 134920 136800 138400 139764 140780 141984 143044 143944 144940 146092 146820 147580 148144 148652
free 1588 1588 1588 1588 1592 1596 1600 1588 1592 1600 1588 1596 1588 1588 1588 1588 1596 1588 1588 1596 1588
us 5 8 11 8 11 7 8 6 7 9 9 9 10 10 12 8 8 7 8 6 7
Here We Go
Work up Performance Pyramid:
Database Block Size = 2K SGA Buffer Cache = 128M SGA Shared Pool = 128M SGA Redo Cache = 4M Redo Log Files = 4M Tablespaces = Dictionary
DB2 DB3 DB4 DB5 DB6 load time 48.57 41.39 17.35 15.07 11.42 % Improved -1.73% -17.35% -138.56% -15.13% -31.96% trans/sec 8.15 9.15 10.09 10.18 10.43 10.68 % Improved 10.88% 9.33% 0.89% 2.36% 2.42%
DB1 49.41
DB7 DB Final 10.48 10.48 -8.97% -371.47% 10.72 10.72 0.32% 23.93%
Linuxconf = monolithic
Shared memory
/usr/src/linux-2.2.16/include/asm/shmparam.h #define SHMMAX 0x13000000
Monolithic Kernel - If you compile everything into the kernel to exactly match your hardware and thus make minimal use of modules.
Semaphors
/usr/src/linux-2.2.16/include/linux/sem.h #define SEMMNI 100 #define SEMMSL 512 #define SEMMNS (SEMMNI*SEMMSL) #define SEMOPM 100 #define SEMVMX 32767
Linuxconf = monolithic
Shared memory
/usr/src/linux-2.2.16/include/asm/shmparam.h #define SHMMAX 0x13000000
Semaphors
/usr/src/linux-2.2.16/include/linux/sem.h #define SEMMNI 100 #define SEMMSL 512 #define SEMMNS (SEMMNI*SEMMSL) #define SEMOPM 100 #define SEMVMX 32767
Linuxconf = monolithic
Shared memory
/usr/src/linux-2.4.00/include/linux/shm.h #define SHMMAX 0x13000000
Semaphors
/usr/src/linux-2.4.00/include/linux/sem.h #define SEMMNI 128 #define SEMMSL 512 #define SEMMNS (SEMMNI*SEMMSL) #define SEMOPM 128 #define SEMVMX 32767
Linuxconf = monolithic
Shared memory
/usr/src/linux-2.4.00/include/linux/shm.h #define SHMMAX 0x13000000
Semaphors
/usr/src/linux-2.4.00/include/linux/sem.h #define SEMMNI 128 #define SEMMSL 512 #define SEMMNS (SEMMNI*SEMMSL) #define SEMOPM 128 #define SEMVMX 32767
Edit /etc/fstab
/dev/sda6 /dev/sda1 /dev/cdrom /dev/md0 /dev/fd0 none none /dev/sda5 / /boot /mnt/cdrom /u01 /mnt/floppy /proc /dev/pts swap ext2 ext2 iso9660 ext2 auto proc devpts swap defaults,noatime defaults,noatime noauto,owner,ro defaults,noatime noauto,owner defaults,noatime gid=5,mode=620 defaults,noatime 1 1 0 1 0 0 0 0 1 2 0 2 0 0 0 0
NtfsDisableLastAccessUpdate=1
1st parm is max # of dirty buffers in cache. Higher = delayed disk writes.
2nd parm is max # of dirty buffers per write. Higher = delayed, bursty I/O.
3rd parm is # of buffers added to list of free buffers by refill_freelist. 4th parm refill_freelist comes across more than nref_dirt dirty buffers, it will wake up bdflush. 5th parm is max time Linux waits before writing dirty buffers to disk for data blocks.
Restart daemon
/etc/rc.d/init.d/network restart
6th parm is max time Linux waits before writing dirty buffers to disk for file system metadata.
Create TPC-C Database EXT2 348 EXT3 228 Reiser 378 IBM JFS 351 RAW 396 RAW X 2 396
DB1 DB Final OS1 OS2 OS3 OS4 OS5 OS6 OS7 OS Final Total load time 49.41 10.48 9.54 9.40 8.32 8.20 5.58 4.43 3.80 3.80 3.80 % Improved -371.47% -9.85% -1.49% -12.98% -1.46% -46.95% -25.96% -16.58% -151.05% -1200.26% trans/sec 8.15 10.72 11.51 11.52 12.82 12.90 13.88 14.99 20.51 20.51 20.51 % Improved 23.93% 6.90% 0.10% 10.09% 0.66% 7.09% 7.37% 26.92% 43.88% 60.25%
Thank You
Presenters: Bert Scalzo: [email protected]
Note: these slides should be available on OOUG web site, but well also make sure to post them on our companys web site:
www.toadworld.com/Experts/BertScalzosToadFanaticism/tabid/318/Default.aspx