Performance Tuning Apex Applications
Performance Tuning Apex Applications
Apex Applications
Doug Gault
MY BACKGROUND
Doug Gault
[email protected]
Not extensible
9i & 10g
Access via HTTP Server (Apache)
MOD_PLSQL
11g +
Can replace Oracle HTTP server with Embedded PL/SQL Gateway (EPG)
Provides Oracle database with Web Server capability
Runs in XML-DB HTTP SERVER
Oracle 10g XE also uses a version of EPG
i
P= ( R
E
)* N
P = Performance
R = Real Response Time
E = Expected Response Time
i = Importance of the Task
N = Number of Times the User Must Perform the Task
Application Volume
Number of users accessing the system
Utilization Profile
Even usage throughout the day
If not...
FIND OUT!
System Tablespace
85MB Free
DO
Create specific tablespaces for both APEX_XXXXXX and
FLOWS_FILES
Ability to correctly size and control growth of APEX tablespaces
Processes
Rendering the Page Items
Validations
Processes
Branching
Show All
Shows every possible item/action even if they are not used
Show Used
Shows only those items/actions that are used by the page
Form Items
APEX gives you many places where you can code logic
Conditional Rendering of items, regions, etc.
Conditional Processes
Validation Logic
Timeout
Application Errors
Pages
Schemas
Workspaces
Applications
Access Log
Activity Log
Activity Summary
User Summary
Schema
Files
Activation
Development Mode - Select DEBUG from Developer Toolbar
f?p=App:Page:Session:Request:Debug:ClearCache:ItemNames:ItemValues
Example
Single page with 4 HTML regions
Using AJAX to Screen Scrape report regions from other pages
Full Screen takes over 2 minutes to render all data
DEBUG mode reports about 0.14 seconds
Where did the time go?
NET TAB
Shows HTTP calls the browser makes to retrieve data
Initial HTML call (f?p...)
FireBug does not report calls made back to the server from within a
FLASH component.
declare
run_id number;
begin
run_id :=
dbms_profiler.start_profiler(comment => to_char(sysdate,'DD-MM-YYYY HH24:MI:SS'));
..
call pl/sql to be profiled
..
New to 11g
Reports PL/SQL execution profile, organized by subprogram call
Accounts for PL/SQL and SQL execution time separately
Do NOT need CREATE privileges on the units being profiled
Save statistics in database tables, generates HTML, .trc files
BEGIN
/* Start profiling.
Write raw profiler output to file test.trc in a directorythat is mapped to directory
object PLSHPROF_DIR */
DBMS_HPROF.START_PROFILING('PLSHPROF_DIR', 'test.trc');
END;
/
-- Execute procedure to be profiled
BEGIN
test;
END;
/
BEGIN
-- Stop profiling
DBMS_HPROF.STOP_PROFILING;
END;
/
Available 8.1.7+
Traces the order in which subprograms are called
Can specify subprograms to trace and to what level
Compile subprograms with DEBUG to enable tracing
Saves statistics in database tables
DBMS_TRACE.SET_PLSQL_TRACE(trace_level INTEGER);
PL/SQL TO TRACE
DBMS_TRACE.CLEAR_PLSQL_TRACE;
Oracle Code Instrumentation or How I Learned to Stop Worrying and Love Properly Scoped Trace
Files
Using Oracle's PL/SQL Profiler Tool DBMS_PROFILER
How to tune SQL with Extended Trace Data