Professional Documents
Culture Documents
Introduction
• Performance tuning – System level or
session/process?
• At the system level we can measure
workload.
• This presentation will explore what you
can do with system level information
and why it’s NOT performance tuning.
1
Informal Survey
• I conducted an informal survey from the
Oracle-L list and comp.database.oracle
archives over the last year.
• I looked for anything that involved a
conflict/question about system level
performance tuning.
• There were some passionate
disagreements.
2/7/2005 Copyright © 2005, AppsDBA Consulting, All Rights Reserved. Slide 3
2
Survey Results (i)
• Oracle-L list
3
Rates and Capacity
• Capacity is the maximum amount of
service that a system or resource can
perform.
• Rates are the measurement of work
being performed.
Response Time
• Reponse time is the measure of the duration
of some action.
• We’ve been told that response time = service
time + wait time.
• At the system level we have many “actions”
taking place.
• At the system level, response time is really
elapsed time.
• Wait time is just excess capacity.
2/7/2005 Copyright © 2005, AppsDBA Consulting, All Rights Reserved. Slide 8
4
What is System Performance?
• System –
My definition: Entire database server -including all
hardware, OS, and peripherals
• Performance – “response time and throughput that
meets desired or acceptable levels [Menasce and
Almeida (2000), 216]
• Since response time is the direct measure of some
action, then we cannot measure a “system’s”
response time.
• However we can measure a system’s throughput.
2/7/2005 Copyright © 2005, AppsDBA Consulting, All Rights Reserved. Slide 9
Measuring Workload
5
Measurement Accuracy &
Usefulness
• CPU measurements seem to be the
most problematic.
• Accuracy is not as critical since this is
not response time optimization.
Workload measurement deals with
aggregates.
• OS statistics can provide an excellent
accuracy check.
2/7/2005 Copyright © 2005, AppsDBA Consulting, All Rights Reserved. Slide 11
Tools
• A good tool will …
– ignore waits at the system level
– be interval based, using deltas between intervals
• What’s wrong with Statspack?
– Nothing
– Ignore all sections that include system level waits
• Top 5 Timed Events
• Wait event sections
6
Tools (ii)
• AWR (10g)
– Measures statistics and timed events
– Time model statistics
• Attempts to measure session level service and
wait time in session time lines.
• Other commercial and open source
tools are available.
CPU Utilization
• v$sysstat – “CPU used by this session”
• Measures user mode CPU usage
• Service time from a session’s
perspective
• CPU usage supports the execution of
work in Oracle (e.g. LIO, PL/SQL and
Java code).
2/7/2005 Copyright © 2005, AppsDBA Consulting, All Rights Reserved. Slide 14
7
CPU Utilization Trend
Database CPU Utilization
80
70
60
Average Utilization
50
DB CPU Avg(%)
40
OS Usr CPU Avg(%)
30
20
10
0
4
4
04
04
04
04
00
00
00
00
00
00
00
00
00
00
00
00
20
20
20
20
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
2/
4/
6/
8/
17
19
21
23
25
27
29
31
10
12
14
16
9/
9/
9/
9/
8/
8/
8/
8/
8/
8/
8/
8/
9/
9/
9/
9/
Dates Observed
8
I/O Rates
• Two basic I/O rates:
– Database file I/O
– Redo log file I/O
File I/O
• Database file I/O
– Foreground reads (client processes)
– Background writes (DBWR)
– Direct reads and writes (sorting, direct I/O)
• Database file I/O comprises the majority
of the I/O in a typical Oracle database.
9
File I/O Data (Trend)
25,000,000
20,000,000
Database File Blocks
15,000,000
10,000,000
5,000,000
0
13 4
15 04
17 04
19 04
21 04
23 04
25 04
27 04
29 04
31 04
2/ 4
12 04
14 04
16 04
18 04
20 04
22 04
4
3/ 4
5/ 4
7/ 4
9/ 4
11 4
4/ 4
6/ 4
8/ 4
10 4
00
00
00
0
8/ 00
9/ 00
0
0
20
20
20
20
20
20
20
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
/2
2
2
1/
8/
8/
8/
8/
8/
9/
9/
9/
9/
8/
8/
8/
8/
8/
8/
8/
8/
8/
8/
9/
9/
9/
9/
9/
9/
Date
4000000
3500000
File System
/u17/oradata/PDSA
3000000 /u16/oradata/PDSA
/u15/oradata/PDSA
Total Database Blocks
/u14/oradata/PDSA
2500000 /u13/oradata/PDSA
/u12/oradata/PDSA
/u11/oradata/PDSA
2000000 /u10/oradata/PDSA
/u09/oradata/PDSA
/u08/oradata/PDSA
1500000 /u07/oradata/PDSA
/u06/oradata/PDSA
/u05/oradata/PDSA
1000000 /u04/oradata/PDSA
/u03/oradata/PDSA
/u02/oradata/PDSA
500000
0
0:51
1:50
2:50
3:50
4:50
5:51
6:50
7:50
8:50
9:50
10:51
11:50
12:50
13:50
14:50
15:50
16:51
17:50
18:51
19:50
20:50
21:50
22:50
23:50
0:51
1:50
2:50
3:50
4:50
5:51
6:50
7:50
8:50
9:50
10:51
11:50
12:50
13:50
14:50
15:50
16:51
17:50
18:51
19:50
20:50
21:50
22:50
23:50
Time (Hourly)
Data Time
10
Redo Log I/O
• Redo log file I/O writes.
• Records changes to the database.
• Foreground processes wait on commits
until redo is flushed to disk.
• Redo log I/O can artificially heat an I/O
subsystem causing hot spots.
• Small sequential writes in port specific
sized redo blocks.
2/7/2005 Copyright © 2005, AppsDBA Consulting, All Rights Reserved. Slide 21
80,000,000,000
70,000,000,000
60,000,000,000
50,000,000,000
40,000,000,000
30,000,000,000
20,000,000,000
10,000,000,000
0
5/14 - 9/22/04
11
Redo Log I/O Data
Redo Generation
1800
1600
1400
1200
600
400
200
0
2
3
52
52
52
52
52
52
52
52
52
52
:5
:5
:5
:5
:5
:5
:5
:5
:5
:5
:5
:5
:5
0:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10
11
12
13
14
15
16
17
18
19
20
21
22
Time
Other Rates
• Commit rates
• Sorts (disk & memory)
• User connection rates
• Memory usage
12
Workload Reduction Example
• Daily CPU utilization averaging roughly
70%.
• Workload a mix of mostly batch loading
and reporting.
• No complaints about run times or
“performance”
13
Workload Reduction Example (iii)
Total CPU OS Usr OS Usr OS Usr
Elapsed Elapsed DB Logical DB CPU DB CPU CPU CPU CPU
Date Time(Sec) Time(Sec) Reads Time(Sec) Avg(%) Avg(%) Min(%) Max(%)
-------- ---------- ---------- ---------------- ------------ -------- ------- ------- -------
08/18/04 86,352 690,816 7,902,803,855 494,594 71.60 68.33 61.00 73.00
08/19/04 86,431 691,448 7,903,129,277 488,810 70.69 67.46 63.00 72.00
08/20/04 86,395 691,160 7,874,800,107 411,003 59.47 57.33 41.00 67.00
08/21/04 86,382 691,056 7,604,332,092 277,520 40.16 40.21 39.00 42.00
08/22/04 86,398 691,184 7,667,811,263 279,899 40.50 40.67 39.00 43.00
08/23/04 86,405 691,240 5,173,811,098 264,530 38.27 37.42 22.00 52.00
08/24/04 86,389 691,112 3,823,823,589 247,723 35.84 34.83 22.00 49.00
08/25/04 86,437 691,496 2,272,546,617 152,783 22.09 22.25 15.00 30.00
08/26/04 86,383 691,064 1,568,055,602 129,397 18.72 18.46 16.00 23.00
08/27/04 86,382 691,056 1,700,447,592 130,179 18.84 18.63 16.00 24.00
08/28/04 86,436 691,488 1,506,743,354 110,404 15.97 16.08 16.00 17.00
08/29/04 86,373 690,984 1,500,723,241 109,477 15.84 16.00 16.00 16.00
08/30/04 86,390 691,120 1,664,563,387 155,658 22.52 22.50 16.00 32.00
08/31/04 86,402 691,216 1,978,556,216 228,044 32.99 33.54 32.00 37.00
09/01/04 86,146 689,168 1,816,337,865 224,887 32.63 33.29 32.00 36.00
09/02/04 86,380 691,040 1,809,854,359 225,660 32.66 33.25 32.00 35.00
09/03/04 86,382 691,056 1,868,711,926 221,125 32.00 32.58 23.00 35.00
09/04/04 86,435 691,480 1,831,948,026 221,945 32.10 32.79 32.00 34.00
09/05/04 86,375 691,000 1,830,712,911 222,928 32.26 33.08 33.00 34.00
09/06/04 86,431 691,448 1,724,152,638 171,116 24.75 25.29 12.00 33.00
09/07/04 86,396 691,168 1,691,018,286 177,717 25.71 25.83 12.00 89.00
09/08/04 86,376 691,008 1,756,856,856 135,388 19.59 19.63 18.00 21.00
09/09/04 86,383 691,064 1,854,180,735 139,994 20.26 20.38 19.00 23.00
09/10/04 86,434 691,472 1,719,237,070 129,735 18.76 18.83 16.00 21.00
09/11/04 86,373 690,984 1,471,529,971 115,685 16.74 16.92 16.00 18.00
09/12/04 86,433 691,464 1,535,727,550 116,771 16.89 17.08 17.00 18.00
09/13/04 86,374 690,992 1,607,176,065 122,982 17.80 17.92 17.00 19.00
09/14/04 86,429 691,432 1,533,241,650 123,720 17.89 18.04 17.00 20.00
09/15/04 86,378 691,024 1,666,641,611 130,282 18.85 19.25 17.00 28.00
25,000,000 7,000,000
6,000,000
20,000,000
5,000,000
15,000,000 4,000,000
10,000,000 3,000,000
2,000,000
5,000,000
1,000,000
0 0
14
Workload Reduction Example (v)
Limitations
• Need to know the types of workload.
• Measurement intervals may need to be
adjusted.
• Utilization targets will be dependent on
the type of workload.
15
Conclusion
• Workload measurement provides input
to capacity planning.
• Provides the ability to identify and
measure change.
• Can help show economic benefits from
performance tuning or workload
reductions.
16