/*============================================================================
File: VirtualFileStats.sql Summary: sys.dm_io_virtual_file_stats Date: March 2011 ------------------------------------------------------------------------------
Written by Paul S. Randal, SQLskills.com (c) 2011, SQLskills.com. All rights reserved. For more scripts and sample code, check out
http://www.SQLskills.com You may alter this code for your own *non-commercial* purposes. You may
republish altered code as long as you include this copyright and give due
credit, but you must obtain prior permission before blogging this code. THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
============================================================================*/ -- Use this script, based on code from Jimmy May
-- This is what I use on client systems
SELECT
--virtual file latency
ReadLatency =
CASE WHEN num_of_reads = 0
THEN 0 ELSE (io_stall_read_ms / num_of_reads) END,
WriteLatency =
CASE WHEN num_of_writes = 0
THEN 0 ELSE (io_stall_write_ms / num_of_writes) END,
Latency =
CASE WHEN (num_of_reads = 0 AND num_of_writes = 0)
THEN 0 ELSE (io_stall / (num_of_reads + num_of_writes)) END,
--avg bytes per IOP
AvgBPerRead =
CASE WHEN num_of_reads = 0
THEN 0 ELSE (num_of_bytes_read / num_of_reads) END,
AvgBPerWrite =
CASE WHEN io_stall_write_ms = 0
THEN 0 ELSE (num_of_bytes_written / num_of_writes) END,
AvgBPerTransfer =
CASE WHEN (num_of_reads = 0 AND num_of_writes = 0)
THEN 0 ELSE
((num_of_bytes_read + num_of_bytes_written) /
(num_of_reads + num_of_writes)) END, LEFT (mf.physical_name, 2) AS Drive,
DB_NAME (vfs.database_id) AS DB,
vfs.*,
mf.physical_name
FROM sys.dm_io_virtual_file_stats (NULL,NULL) AS vfs
JOIN sys.master_files AS mf
ON vfs.database_id = mf.database_id
AND vfs.file_id = mf.file_id
--WHERE vfs.file_id = 2 -- log files
-- ORDER BY Latency DESC
-- ORDER BY ReadLatency DESC
ORDER BY WriteLatency DESC

Wait--使用sys.dm_io_virtual_file_stats来查看IO延迟的更多相关文章

  1. IO 延迟与Queue Depth

     IO 延迟:存储设备的IO延迟 Queue Depth:磁盘控制器所发出的批量指令的最大条数 IOPS:磁盘设备每秒的IO 三者之间的关系:IOPS=(Queue Depth)/(IO latenc ...

  2. ubuntu查看IO

    在命令行直接 cp 一个比较大的文件时,由于没有提示信息,总感觉很不放心,可以通过查看IO的方式确认cp操作的进展程度. 查看IO可以使用iostat命令,但是前提是要安装sysstat sudo a ...

  3. linux 查看io

    有时系统卡,可能是io值使用满了导致 1.安装iostat yum install sysstat 2.查看io使用情况 iostat -dx 3.安装iotop yum install iotop ...

  4. linux服务器查看IO

    为了方便各位和自己今后遇到此类问题能尽快解决,我这里将查看linux服务器硬盘IO访问负荷的方法同大家一起分享: 首先 .用top命令查看 top - 16:15:05 up 6 days,  6:2 ...

  5. linux wa%过高,iostat查看io状况

    命令总结: 1. top/vmstat 发现 wa%过高,vmstat b >1: 参考文章: 1. 关于Linux系统指令 top 之 %wa 占用高,用`iostat`探个究竟 最近测试一项 ...

  6. 查看IO负载

    负载(load)是linux机器的一个重要指标,直观了反应了机器当前的状态.如果机器负载过高,那么对机器的操作将难以进行. Linux的负载高,主要是由于CPU使用.内存使用.IO消耗三部分构成.任意 ...

  7. iostat查看io情况(监控Linux的8种方式)

    查看TPS和吞吐量信息[root@controller ~]#iostat -d -k 1 10Device:         tps    kB_read/s    kB_wrtn/s    kB_ ...

  8. iostat查看io情况

      查看TPS和吞吐量信息[root@controller ~]#iostat -d -k 1 10Device:         tps    kB_read/s    kB_wrtn/s    k ...

  9. 理解 IO_WAIT 并且了解利用包括 top htop iotop iostat 工具来查看 IO 性能

    今天继续拜读「深入浅出计算机组成原理」专栏,觉得讲 IO_WAIT 这篇很有意思,正好可以结合前面的一篇讲物理硬件存速度的一块儿看. 现在我们看硬盘厂商出品的性能报告,通常会看到两个指标,一个是响应时 ...

随机推荐

  1. ajax请求jesery接口无法获取参数的问题解决方案

    jesery是强大的RESTful api框架, 很多人在用它做web项目时会遇到这样一个问题: ajax请求jesery接口无法获取输入参数, 可明明接口已经指明了Consume是applicati ...

  2. c# -- 介绍File.AppendAllText 方法

    下面介绍两个函数: File.AppendAllText (String, String) File.AppendAllText (String, String, String) File.Appen ...

  3. python开发_calendar

    如果你用过linux,你可能知道在linux下面的有一个强大的calendar功能,即日历 在python中,同样也有这样的一个强大的calendar 下面是我做的demo: #python中的cal ...

  4. VK Cup 2016 - Round 1 (Div. 2 Edition) C. Bear and Forgotten Tree 3 构造

    C. Bear and Forgotten Tree 3 题目连接: http://www.codeforces.com/contest/658/problem/C Description A tre ...

  5. HDU 3974 Assign the task 并查集/图论/线段树

    Assign the task Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...

  6. HDU 4699 Editor (2013多校10,1004题)

    Editor Time Limit: 3000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Su ...

  7. 将dll文件注入到其他进程中的一种新方法

    http://www.45it.com/windowszh/201212/33946.htm http://www.hx95.cn/Article/OS/201212/65095.html 我们知道将 ...

  8. 取maven copy部分

    mvn deploy:deploy-file -DgroupId=com.mycompany -DartifactId=my-project -Dversion=1.0.0 -Dpackaging=j ...

  9. Android 工程报错解决 Unable to resolve target 'android-17'

    转自:http://www.cnblogs.com/csulennon/p/3705177.html 换了系统后,重新安装了Android SDK和ADT插件,导入之前的工作空间.居然发现所有的And ...

  10. 安卓源码下载 windows

    git clone https://android.googlesource.com/name Name Descriptionaccessories/manifest device/asus/deb ...