在系统模式下从硬盘读取的速度比在管理员模式下慢 [英] Reading from HDD slower in system mode than in Administrator mode

查看:127
本文介绍了在系统模式下从硬盘读取的速度比在管理员模式下慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我开发了一个应用程序(服务器),该应用程序从硬盘读取文件(每个文件有300kb的数百个文件),然后通过本地网络(1Gb)将它们发送到我也开发的客户端应用程序中.

我注意到,如果服务器应用程序在系统模式(系统会话)下运行(这是我感兴趣的情况),则发送速度比在管理员模式下(管理员会话)慢得多.

我已确定读取硬盘时的延迟(没有缓存,如果文件被缓存,则速度相同).

我在Windows Server 2012 R2和Windows Server 2012下进行了测试.

您对这种差异有任何想法吗?如果系统会话和管理员会话之间在资源访问方面存在差异,那么HDD ...?如果有解决方案可以使应用程序在系统模式下的运行速度与管理员一样快 mode

Hello,

I have developed an application (server) that reads files (there are hundreds of files of 300 kb each) from the hard disk to send them by local network (1Gb) to a client application that I have also developed.

I noticed that if the server application runs in system mode (system session) (this is the case that interests me) the sending is much slower than if it is in administrator mode (administrator session)

I have located the delay when reading the hard disk (without cache, if the files are cached, it is the same speed).

I did the tests under Windows Server 2012 R2, and Windows Server 2012.

Do you have any idea about this difference? If there is a difference between system session and administrator session concerning the access to resources, HDD ...? And if there is a solution to make the application as fast in system mode as in administrator mode

推荐答案

lvloha,

Hi lvloha,

感谢您在此处发布.

>>我注意到,如果服务器应用程序在系统模式(系统会话)下运行(这是我很感兴趣的情况),则发送速度比在管理员模式(管理员会话)下慢得多

我已确定读取硬盘时的延迟(没有缓存,如果文件被缓存,则速度相同).

>>I noticed that if the server application runs in system mode (system session) (this is the case that interests me) the sending is much slower than if it is in administrator mode (administrator session)

I have located the delay when reading the hard disk (without cache, if the files are cached, it is the same speed).

我认为这是因为系统将检查非管理员用户是否有权访问硬盘.这可能会花费一些时间.

In my opinion, it's because the system will check if the non-administrator user has authority to access the hard disk. This may spend some time.

这里是有关磁盘性能内部的博客,您可以参考.

Here is a blog about the Disk Performance Internals, you could refer to.

https://blogs.msdn.microsoft.com/ntdebugging/2014/12/09/disk-performance-internals/

要解决此问题,请更好地使用文件缓存.文件缓存是为了加快对永久存储在磁盘上的数据的访问.与驻留在磁盘或CD-ROM上的文件相比,访问驻留在内存中的任何文件段的速度要快得多. 从头到尾您只需要阅读一次.与文件关联的数据块仍必须从磁盘上进行串行访问,然后复制到RAM中并存储在其中.

To solve this, better use file cache. File cache is to speed up access to data that is otherwise stored permanently on disk. Access to any file segments that are resident in memory is much, much faster than having to retrieve the file from a disk or CD-ROM. You only have to read once from start to finish. The data blocks associated with the file still have to be accessed serially from the disk, copied into RAM, and stored there.

有关文件缓存的更多信息,请参阅下面的这些文件.

For more information about file cache, please refer to these documents below.

https://msdn.microsoft.com/en-us/library/bb742613.aspx

https://msdn.microsoft.com/zh-cn/library/windows/desktop/aa364218(v = vs.85).aspx

希望这对您有所帮助.

最好的问候,

色狼


这篇关于在系统模式下从硬盘读取的速度比在管理员模式下慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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