识别低效io引起的free buffer waits

产生事发时间段的awr报告

Top 5 wait events

这里重点关注:

1.free buffer waits

2.enq_HW-contention

3.enq:tx-row lock contention

enq:HW-contention属于水位线的争用,已经透过alter table allocate extent,提前分配空间,这里不做讨论

关于enq: TX - row lock contention ,我们透过如下查询得知,是由于free buffer waits引起,所以如果解决了free buffer wait,lock的竞争也将得到改善

bash 复制代码
select session_id,sql_id,blocking_session,event,session_state,time_waited  from dba_hist_active_sess_history where session_id in (
select blocking_session from dba_hist_active_sess_history
where to_char(SAMPLE_TIME,'YYYY-MM-DD HH24:MI:SS') BETWEEN '2023-07-03 09:00:00' AND '2023-07-03 11:00:00'
and event='enq: TX - row lock contention')

那么,free buffer wait是什么引起的呢?

1.small buffer cache?

2.Inefficient io IO

32.Inefficient io sql statement?

我们先看看几个指标的解释:

1.free buffer requested:
A 'free buffer requested' is incremented every time a "new buffer" needs to be
created in the buffer cache. This is typically because a requested block is not in
memory and so needs to be read from disk or because a read consistent block needs to
be created which currently doesn't exist in memory. A 'high' value may suggest either
the cache is too small and blocks are not being found when required in memory or that
much conflicting activity between writes and reads requiring consistent blocks to be
generated in occurring

2.free buffer inspected
A 'free buffer inspected' occurs when a block is checked via the LRU list to determine whether it can be overwritten in order to create a new block (to satisfy a free buffer requested). This value is incremented if the 'inspected' block may not be overwritten due to the block being 'dirty' (or changed) or the block being 'pinned' (or currently being accessed). A 'high' value may suggest that the db writers are not efficient enough in cleaning out blocks in order to have sufficient free blocks
available.

3.dirty buffers inspected
The dirty buffers inspected Oracle metric is the number of dirty buffers found by the foreground while the foreground is looking for a buffer to reuse.
A dirty buffer is a buffer whose contents have been modified. Dirty buffers are freed for reuse when DBWR has written the blocks to disk.
The database buffer cache is organized in two lists: the write list and the least-recently-used (LRU) list. The write list holds dirty buffers, which contain data that has been modified but has not yet been written to disk. The LRU list holds free buffers, pinned buffers, and dirty buffers that have not yet been moved to the write list. Free buffers do not contain any useful data and are available for use. Pinned buffers are buffers that are currently being accessed.

4.summed dirty queue length
The summed dirty queue length Oracle metric is the sum of the dirty LRU queue length after every write request. Divide by "write requests" to get the average queue length after write completion.

再看看AWR中这几个指标的值

这几个值反映,系统经历了

1.高的free buffer inspected,说明系统为了获得free buffer,频繁检查LRU list

2.高的free buffer requested,说明系统有大量的free buffer需求

3.高的dirty buffers inspected, 说明频繁检查LRU时,检查到大量的dirty buffer

4.高的summed dirty queue,说明write list超级长

系統io情況:

bash 复制代码
[oracle10g@EDI:~$ vmstat 1 20
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1 15  51968 168912   8524 12972824    0    0   894   206    0    1 22  3 70  5  0
 3 12  51968 180556   8524 12967672    0    0 37032   152 4460 5376 23  8 12 57  0
 1 13  51968 174148   8532 12981820    0    0 14248  1304 4135 4571 19  5  7 69  0
 3 14  51968 171000   8528 12966028    0    0 11828   576 3190 2438 33 10  2 56  0
 1 13  51968 173672   8528 12981628    0    0 65324    88 5495 7496 20 11  5 64  0
 0 15  51968 197608   8528 12960552    0    0 18904   480 2735 3008 15  5  9 71  0
 2 14  51968 172060   8524 12968832    0    0 16928   160 2821 2766 15  5  4 76  0
 3 13  51968 180464   8520 12964840    0    0 34532  1416 3672 3248 31 12  9 48  0
bash 复制代码
[oracle10g@EDI:~$ iostat -x 1 20
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          59.68    0.00    3.60   30.27    0.00    6.45

Device            r/s     w/s     rkB/s     wkB/s   rrqm/s   wrqm/s  %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util
sdb            934.00   38.00  17264.00    908.00     7.00    15.00   0.74  28.30   14.01   97.79  12.12    18.48    23.89   1.03 100.00
sda              0.00    0.00      0.00      0.00     0.00     0.00   0.00   0.00    0.00    0.00   0.00     0.00     0.00   0.00   0.00

上面的输出反映sdb仅有17264kb/s的读写能力,硬盘latancy 14.01 millisecond也不是正常值,rareq-size请求队列达达到18.48的高值

结合awr报告中free buffer requested,free buffer inspected、dirty buffers inspected、summed dirty queue说明系统由于io的影响,导致刷脏能力很弱,无法产生足够的free buffer满足free buffer request的需求。

由于此台主机属于vmware esxi虚拟机,迁移到io状况良好的其他虚拟机后,free buffer wait消失

相关推荐
可乐鸡翅yeah_1 天前
多浏览器 HLS 兼容性差异排查,Chrome、Firefox、Safari 表现不一致定位
chrome·ffmpeg·音视频·firefox·safari·m3u8
行者-全栈开发2 天前
Spring Boot + FFmpeg 视频批量处理实战:压缩、HLS切片与异步任务引擎
spring boot·ffmpeg·异步处理·视频压缩·hls切片·批量任务·redis队列
可乐鸡翅yeah_3 天前
M3U8测试流使用指南,流媒体开发自测与环境校验标准化方案
网络·ffmpeg·音视频·m3u8·m3u8在线·音视频在线播放
heqingchun163 天前
Ubuntu 22.04 交叉编译 RK3568 MPP + FFmpeg 完整指南
linux·ubuntu·ffmpeg
刘广睿3 天前
音频降噪实战:ffmpeg 滤镜、RNNoise 与人声分离方案对比
ffmpeg·音视频·效率工具·剪辑
IvorySQL4 天前
代价比较的变革——PostgreSQL执行计划干预增强深度解析
数据库·postgresql·ffmpeg
≮傷£≯√5 天前
Qt 面试(一)
qt·ffmpeg·音视频
刘广睿6 天前
视频字幕从提取到烧录:SRT/ASS 格式与 ffmpeg 字幕滤镜全流程
ffmpeg·音视频·效率工具·剪辑·字幕
可乐鸡翅yeah_6 天前
FFmpeg 与浏览器 HLS 播放表现差异,定位跨客户端兼容问题
ffmpeg·音视频·m3u8·m3u8在线·音视频在线播放
刘广睿8 天前
断点续传与分片下载是怎么实现的?Range 请求在视频下载中的工程实践
okhttp·ffmpeg·音视频·下载·python3.11