报警知识库


磁盘队列

<h1>报警描述</h1> <p>业务[XX业务],虚拟机[X.X.X.X]磁盘队列|X:队列长度提醒,队列长度为143.2</p> <h1>说明</h1> <p>磁盘队列长度是指磁盘读写任务出现排队的情况。一般来说,像无纸化、PACS系统的磁盘队列会比较长。按照常规计算,Windows下每块物理磁盘所应当容忍的磁盘队列长度为2,超过2则说明存在性能瓶颈;Linux下磁盘队列的容忍值则是1。但由于虚拟化技术,很难说明白虚机磁盘队列对应了多少个物理磁盘,因此绝对的认为磁盘队列数大,磁盘性能就存在瓶颈,是不科学的。 但即便如此,仍然应该对较大的磁盘队列情况予以关注。</p> <h1>监控对象</h1> <p>Windows、Linux操作系统</p> <h1>监控方式</h1> <h2>Windows</h2> <p>对于Windows操作系统,通过监控代理读取,监控机制为WMI,类名为 win32_perfformatteddata_perfdisk_physicaldisk 取值为 win32_perfformatteddata_perfdisk_physicaldisk 的 CurrentDiskQueueLength,即当前磁盘队列长度。 在监控消息队里时,每隔1秒读取一次磁盘队列,连续读取5次,然后取平均值。</p> <p>CurrentDiskQueueLength 的意义(原文)</p> <p>Number of requests outstanding on the disk at the time the performance data is collected. It includes requests in service at the time of data collection. The value represents an instantaneous length, not an average over a time interval. Multispindle disk devices can have multiple requests active at one time, but other concurrent requests await service. This property may reflect a transitory high or low queue length. If the disk drive has a sustained load, the value will be consistently high. Requests experience delays proportional to the length of the queue minus the number of spindles on the disks. This difference should average less than two for good performance.</p> <p>CurrentDiskQueueLength 的意义(网上释义)</p> <p>这是一个比较重要的查看磁盘io情况的指标。理论上每个物理磁盘的值不应该超过2。当然这个值是需要计算的,比如用4块物理盘做了个raid10,此时在一个监控周期内磁盘队列的均值是10,那每块磁盘的队列值就是10/4=2.5,那么就可以说这个磁盘阵列存在i/o瓶颈了。这个跟之前的disktime指标一样,偶尔出现不必担心,如果长时间出现,那就得着手考虑解决磁盘的io性能问题了。</p> <h2>Linux</h2> <p>对于Linux操作系统,通过监控代理读取。读取命令为:</p> <pre><code>./sysmonitor.bin -counter diskio</code></pre> <p>实现原理是读取 /proc/diskstats的统计信息。 输出示例:</p> <pre><code> 253 0 vda 12243 93 1076674 11057 170033 43587 4445073 321094 0 97760 242413 0 0 0 0 253 1 vda1 12196 93 1074290 11023 167545 43587 4445073 320819 0 97434 242361 0 0 0 0</code></pre> <p>sysmonitor.bin 读取其中第十一列的数据,其名称为“IopsInProgress”。含义是:正在处理的输入/输出请求数 -- -I/O的当前进度,只有这个域应该是0。当请求被交给适当的request_queue_t时增加和请求完成时减小。 (number of I/Os currently in progress. The only field that should go to zero. Incremented as requests are given to appropriate request_queue_t and decremented as they finish.)</p> <h1>规则</h1> <p>默认规则为:</p> <pre><code>[0&lt;=队列长度&lt;300] 正常 [300&lt;=队列长度] 提醒</code></pre> <p>可通过报警策略进行配置。</p>

页面列表

ITEM_HTML