如何限制进程的磁盘I / O bps(每秒字节数) [英] how to throttle disk I/O bps(bytes per seconds) of a process

查看:817
本文介绍了如何限制进程的磁盘I / O bps(每秒字节数)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Windows Server(2008 R2 Standard)项目中,我必须控制我的进程的磁盘IO bps,我花了半天时间试图找到解决方案。

in my project on Windows Server(2008 R2 Standard), I have to control the disk IO bps of my process,  I've spent half a day trying to find a solution.

1. 系统资源管理器只能限制进程CPU使用率&&内存使用情况,无IO使用

1. System Resource Manager can only limit the process cpu usage && memory usage, no IO usage

2。使用Windows作业对象限制我的进程资源使用,仍然没有IO使用(但可以查询进程的IOCounters)

2. Using Windows Job Object to limit my process resource usage, still no IO usage(but can query the IOCounters of the process)

3。在nt.dll中有一个着名的未记录的Windows API&nt; NtSetInformationProcess,在浏览InformationClass时,我找到了IOCounter信息类。我还没有尝试过,因为使用IOCounter只能限制总IO使用量,而不是bps

3. There's a famous undocumented Windows API NtSetInformationProcess in nt.dll, when browsing the InformationClass, I found the IOCounter informationClass. I haven't tried it yet, because using IOCounter can only limit the total IO usage, not bps

4。一个html页面说"SetFileBandwithReservation"功能可以限制文件每秒的IO带宽,这似乎是我的希望,我谷歌它但没有其他详细信息,即使在MSDN中也没有 

4. one html page says that "SetFileBandwithReservation" function can limit the IO bandwidth per second of a file, which seems a hope to me, I google it but no other detail information, not  even in MSDN

 

现在,我认为唯一的选择就是写一个文件驱动程序过滤器来控制特定进程IO bps。这样可能吗?

now, the only option left for me I think is to write a file driver filter to control the specific process IO bps.Is this way possible?

 

是否有人有任何想法或曾经使用过任何工具来执行此类任务?

does anyone has any idea or ever used any tool to do this kindda task?

 

此外,在Linux中,还有cgroup进行资源限制。

besides, in Linux, there's cgroups to do resource limit.

 

推荐答案

即使文件系统过滤器驱动程序也不会执行您想要的操作。 首先,您将限制带宽到系统缓存而不是磁盘,因为缓存的I / O请求通常是系统进程线程。  第二,你会有
带有内存映射文件的各种麻烦。

Even a file system filter driver is not going to do what you want.  First you would be limiting bandwidth to the system cache not the disk, since the I/O requests for the cache are typically system process threads.   Second, you would have all kinds of headaches with memory mapped files.

你为什么要这样? 您认为这有什么需要解决?

Why do you want this?  What need do you think this is solving?

 


这篇关于如何限制进程的磁盘I / O bps(每秒字节数)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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