分析磁盘访问 [英] Profiling disk access

查看:119
本文介绍了分析磁盘访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在使用一个MFC应用程序读取和写入磁盘。有时,这个应用程序运行非常快,有时它是慢的。我猜这是因为涉及磁盘访问,因此我想要配置文件。以下是一些问题:

Currently I am working on a MFC application which reads and writes in to the disk. Sometimes this application runs amazingly fast and sometimes it is damn slow. I am guessing that it is because of the disk access involved, hence I want to profile it. These are some questions in this regard:

(1)。目前我使用 AQTime 剖析器来剖析应用程序。有没有人试过使用这个分析磁盘访问?或者有其他可用的工具吗?

(1).Currently I am using AQTime profiler to profile the application. Has anybody tried profiling disk access using this? or is there any other tool available which I can use?

(2)。我应该查看哪些最重要的磁盘参数?

(2). What are the most important disk parameters I should be looking at?

(3)。如果我有多个线程尝试从磁盘读取和写入数据,它是否会影响性能?

(3). If I have multiple threads trying to read and write the data from disk does it affect the performance? i.e. am I better off having a single threaded access to the disk?

推荐答案

您可以使用 Windows性能工具包。您可以为磁盘I / O事件启用跟踪提供程序,并查看每个磁盘I / O事件的I / O时间和磁盘服务时间。它确实有一点学习曲线。这也将允许您确定哪些文件I / O实际导致实际访问磁盘,并且不由缓存管理器处理。

You can use the Windows Performance Toolkit for this. You can enable trace providers for disk I/O events and see the I/O time and disk service time for each. It does have a bit of a learning curve though. This will also let you determine which file I/O's actually result in real-access to the disk and aren't handled by the cache manager.

最重要的参数是disk服务时间和队列长度。磁盘服务时间是磁盘实际用于服务请求的时间。队列长度表示您的磁盘请求是否备份在其他请求之后。

Most important parameters are disk service time and queue length. Disk service time is how long the disk actually took to service the request. Queue length indicates if your disk request is backed up behind other requests.

对于许多线程w /写 - 许多磁盘在具有后台写入的读取时性能较差。如果你有不同的线程对磁盘上的随机位置进行大量的磁盘I / O操作,可能会使某些请求挨饿。

For many threads w/ reads & writes - Many disks have poor performance in the face of reads with background writes. If you have various threads doing lots of disk I/O to random locations on the disk, you may wind up starving certain requests.

这篇关于分析磁盘访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆