Oracle Performance Tuning Case
Oracle Performance Tuning Case
- a case study
Introduction
• In this presentation, I will share my example of Oracle
DB based system performance tuning.
• 3. Technical Stack:
mod_plsql forward web request from Apache to Oracle DB. User c
an call procedure to rend web page via mod_sql (Apache plug-in).
• 4. System issues:
Web page response time – extremely high ( hours )
CPU usage – low (around 25%)
Concurrent sessions – high (up to 2,800)
Oracle cloud control manager screen shot
Performance diagnose & tuning methodology
• 1. AWR report
Top 10 Foreground Events by Total Wait Time
1) Function INSTR & SUBSTR applied on CLOB variable LV_PAGEDEF in below loop, they will b
e executed 3000+ times per loop . The only purpose of the loop is to rend one html page!!!
CAN’T find any document on this CLOB issue in Google or MOS, decide to ma
ke change based on evidence gathered from testing. CLOB is a usual suspect
of performance issue!!!
• 3. Solution – replace CLOB with varchar2 variable when CLOB size is below 32,767
LV_PAGEDEF CLOB;
LV_PAGEDEF_VC VARCHAR2(32767); --Added to solve performance issue
• 3. Result
-- 127 seconds execution time spend per call with PLS-00306 thrown at 1729057634
• 3. Error
1) MOD_PLSQL overhead issue:
……This works for most cases but fails if there is an attempt to
pass a single value for an array parameter or pass multiple values for
a scalar. In such cases, the first attempt to execute the PL/SQL proce
dure fails. mod_plsql issues a Describe call ……
2 million historical records. For each event, 300,000 new rows will
be generated.
It’s DBA time now: DBA will manually move table GKRPWRK to A
SM table space after course option event end (next weekend).
Final Result
• 1. Before tuning
Page response time (all 5 pages): hours
(from numerous students’ complain collected by service now tea
m)
Concurrent users in queue: 20-40 (using script to limit user access)
CPU usage: 25%