In the previous topic I review some tips about Oracle Database I/O Performance Tuning as a Part I, in This post you can see Part II.
3. Storage Write Caching and
Data Durability
3.1. Understanding Write-Back
and Write-Through Caching
Storage controllers and devices frequently use write caches
to improve write performance.
Two common modes are:
Write-Back
Data is acknowledged after being written to cache, before
necessarily reaching the final persistent storage media.
Advantages:
- Lower
write latency.
- Higher
write throughput.
- Improved
performance for workloads with frequent small writes.
Risks:
- Data loss if the cache is volatile and power is lost
before data reaches persistent media.
Write-Through
The write is acknowledged after reaching the configured
persistence boundary.
Advantages:
- Stronger
protection against volatile-cache loss.
- Simpler
durability characteristics.
Potential disadvantage:
- Higher write latency.
A critical distinction for Oracle environments:
Write-back caching is not inherently unsafe.
It can be appropriate when the controller has a properly
functioning battery-backed or flash-backed cache, or another vendor-supported
power-loss protection mechanism.
For enterprise SAN and RAID environments, the storage
vendor's configuration and durability guarantees should determine the
appropriate caching policy.
Inspect the Linux-visible setting:
cat
/sys/block/sdb/queue/write_cache
Possible results include:
write back or write through
However, this value does not necessarily expose the complete
cache architecture of a SAN or RAID controller.
Avoid blindly executing: hdparm -W 0 /dev/sdb
This is not a universal method for configuring enterprise
storage and may not control the actual caching policy.
Recommendation: Do not disable write-back caching
simply because Oracle ASM is being used. Verify that all acknowledged writes
are protected by a reliable persistence mechanism, and follow the storage
manufacturer's recommendations.
3.2. Write Barriers and
Filesystem Consistency
Write barriers help maintain the correct ordering of
filesystem writes, particularly when journaling filesystems are used.
They protect against situations where a storage device
reorder writes and reports completion before the required data has reached
persistent media.
The original suggestion to disable barriers using nobarrier
should not be treated as a general performance optimization.
For modern Linux systems, keep the supported filesystem and
storage durability mechanisms enabled unless the storage vendor explicitly
documents a safe alternative.
This is particularly important in virtualized environments.
4. Linux I/O Scheduler
The I/O scheduler determines how block I/O requests are
organized and dispatched to storage devices.
For Oracle Linux and Red Hat Enterprise Linux 8/9, commonly
available schedulers include:
- none
- mq-deadline
- kyber
- bfq
Inspect the available scheduler options:
cat
/sys/block/sda/queue/scheduler
Example: [mq-deadline] kyber bfq none
Change the scheduler temporarily: echo none >
/sys/block/sda/queue/scheduler
Verify: cat /sys/block/sda/queue/scheduler
General considerations:
|
Storage type |
Starting consideration |
|
NVMe |
none is commonly the default and
recommended starting point |
|
Virtual disks |
Retain the existing scheduler
initially |
|
SAN-backed block
devices |
Evaluate the existing scheduler
before changing it |
|
HDD |
Evaluate mq-deadline against
actual workload requirements |
There is no universal scheduler that delivers the best
performance for every Oracle workload.
Important version distinction:
- RHEL
7 and earlier use legacy scheduler names such as noop and deadline.
- RHEL
8 introduced multiqueue schedulers, including none and mq-deadline.
- The
legacy GRUB elevator= parameter should not be used as a universal
scheduler configuration mechanism for modern RHEL releases.
Red Hat recommends configuring scheduler policies through
supported TuneD or udev mechanisms.
5. TRIM, UNMAP and Discard
Operations
TRIM/UNMAP allows the operating system or storage stack to
communicate that previously allocated blocks are no longer needed.
This is useful for:
- SSD
garbage collection.
- Thin-provisioned
SAN storage.
- Virtual
disks.
- Storage
capacity reclamation.
Check discard support: lsblk --discard
Or: cat
/sys/block/sdb/queue/discard_max_bytes
For supported mounted XFS or ext4 filesystems, run: fstrim -av
Red Hat generally recommends periodic or batch discard
rather than continuous online discard, unless the workload requires otherwise.
What about ASM?
Do not assume that deleting an ASM file automatically
requires an operating-system fstrim operation.
ASM uses its own allocation and space-management mechanisms.
Discard behavior depends on the underlying storage stack, ASM configuration,
and vendor support.
Never execute:
blkdiscard /dev/sdb against an ASM disk containing database
data. This command can discard the contents of the device and cause data loss.
For ASM and multipath environments, use only a documented,
supported discard mechanism after verifying the complete storage path.
The discussion continues in the next part….
References and further reading
Ø Oracle 19c –
Managing Operating System Resources.
Ø Oracle 19c –
I/O Configuration and Design.
https://docs.oracle.com/en/database/oracle/oracle-database/19/tgdba/IO-configuration-and-design.html
Ø Oracle 19c –
ASM Storage Requirements and AU Size.
Ø Oracle 19c –
Administering ASM Disk Groups.
Ø Oracle
Database – COMMIT_WAIT.
https://docs.oracle.com/en/database/oracle/oracle-database/26/refrn/COMMIT_WAIT.html
Ø Oracle
Database – COMMIT Statement.
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/COMMIT.html
Ø Red Hat –
Factors Affecting I/O and Filesystem Performance.
Ø Red Hat –
Setting the Disk Scheduler.
Ø Red Hat –
Discarding Unused Blocks.
Ø GitHub Kevin: https://github.com/therealkevinc , https://kevinclosson.net
Ø Oracle Memory
Architecture: https://docs.oracle.com/en/database/oracle/oracle-database/21/cncpt/memory-architecture.html
Ø Oracle 26ai –
Using Parallel Execution: https://docs.oracle.com/en/database/oracle/oracle-database/26/vldbg/using-parallel.html
**********************************************************