Disk I/O Tuning Fundamentals

advertisement
Chapter 21
Disk IO Tuning Fundamentals
1
Disk IO Concepts

Service time / latency
–
–
Time taken to retrieve single item from disk
Includes time for steps to read from disk




Throughput / bandwidth
–
–
Number of IO’s performed in a particular timeframe
Depends on nature of read request

2
Rotational latency
Seek time
Data transfer time

Random – dependent on rotational latency + seek time
Sequential – Rotational latency most important
Disk IO Concepts (cont.)

Queuing
–
–

Disk Drives
–
–
–
3
Occurs with frequent disk activity
Increases service time of a request
–
Have physical mechanical limitations for speed
Haven’t kept up with CPU, memory, and storage
improvements
Need to purchase disk devices to meet IO, not storage
requirements based on disk drive limitations
Disks that are full means higher seek times
Oracle IO Architecture



Datafile single block read – see “db file sequential read”
Multi block read – see “db file scattered read”
Direct path reads
–
–
–

Temporary direct path IO
–
–
–
4
do not involve the buffer cache
Can be single block or multiblock
Generally used for multiblock reads
–
Used for sorting, joins, or anything requiring workspace
Needed when insufficient PGA memory exists
See “direct path read temp”
See “direct path write temp”
Oracle IO Architecture (cont.)

Datafile write IO
–
–
–

Direct path writes
–
–
–
5
Used with DML operations
“free buffer waits” can occur if too much activity
Consider using asynchronous IO for these operations
Used with Direct IO operations
Used with append hint
See “direct path write”
Oracle IO Architecture (cont.)

Redo log IO
–
–
–
Redo log IO is sequential in nature
Consequently, disk seek time generally low
See the following wait events




Archive log IO
–
6
“log_file_parallel_write”
“log file single write”
log_file sequential_read”
–
Reads are noted as “log file sequential read”
Writes are noted as “Log archive I/O”
Oracle IO Architecture (cont.)

Flashback IO
–
–
For flashback logs (if applicable for your database)
See the following wait events




Controlfile IO
–
–
–
–
7
“flashback log file write”
“flashback log file sync”
“flashback buf free by RVWR”
Control files updated by LGWR and CKPT processes
Control files also read by other background processes
Certain V$ view information stored in control file
See the following waits


“control file parallel write”
“control file sequential read”
Measuring / Monitoring IO




IO is a blocking operation
See V$SYSTEM_EVENT for information
Use OEM’s Performance Page for IO times
Use Oracle dynamic performance views
–
–
–
–
–
8
–
V$IOSTAT_FILE
V$IOSTAT_FUNCTION
V$FILESTAT
V$TEMPSTAT
V$FILEMETRIC
V$FILE_HISTOGRAM
Measuring / Monitoring IO (cont.)

Calibrating IO possible in Oracle 11g
–
–
–
–
–
9
Use DBMS_RESOURCE_MANAGER.CALIBRATE_IO
Can measure IO capabilities of your disk subsystem
Provide maximum disk service level & physical reads
More useful for OLTP than the data warehouse
Must be using asynchronous IO
Optimizing Datafile IO

Minimize IO latency
–
–

Maximize IO throughput
–

Increase the raw number of physical disks
Striping Strategies
–
–
–
–
10
Run disks at less than full capacity (e.g. 50-75%)
Replace with faster devices or even Solid State disk
Hardware striping
Software striping
Oracle’s ASM (Automatic Storage Management)
Oracle manual datafile stripinjg
Optimizing Datafile IO (cont.)

Raid Arrays
–
–
–
RAID 0 – striping
RAID 1 - mirroring (two copies of same data)
RAID 5






Isolating Datafile IO can improve performance
–
11
parity checking
Less expensive than mirroring
Write IO degrades because of parity checks
Generally should be avoided for database servers
Can be reduced by using non-volatile cache
–
Isolate datafiles from redo logs
Isolate specific tablespaces depending on use
Redo and Archive Optimization


Alternate redo log groups across disk devices
Use specific redo log configuration for
performance
–
–
–
–
Fine-grained stripe
Nonvolatile memory cache
Avoid RAID 5
Look for “log file switch” waits; if occurring

12

Increase size of redo logs, and/or
Increase number of redo log groups
Flashback Logs

For best performance for flashback logs
–
–
–
–
13
Place on dedicated disks for best performance
Avoid placing with redo or archive logs
Generally use fine-grained striping strategy
Larger than 1GB SGA may help performance
Download