CreateFile API 的性能下降
我有一个应用程序可以从库中恢复大量数据。 我们正在使用 Windows Server 2003。随着过程的进展,我们看到性能下降。 我为 4 个主要任务添加了一些性能计数器:创建文件、从库中读取、写入数据、关闭文件。 我们正在恢复数百万个文件。 我观察到,随着进程的进展,createfile API 的性能正在下降。 其他操作一致。
有什么想法可能导致这种情况吗?
预先感谢您的所有答案/建议。
问候, 布山
I have an application that is restoring lots of data from a library. We are using Windows server 2003. As the process progresses we are seeing performance degradation. I added some performance counters for 4 of my major tasks, Create file, Read from library, WriteData, Close file. We are restoring millions of files.
What I observed is that the performance of createfile API is degrading as the process progresses. The other operations are consistent.
Any ideas what could be causing this?
Thanks in advance for all the answers/suggestions.
Regards,
Bhushan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
文件系统是NTFS吗? 数百万个文件是否位于同一目录中,它们是否具有相似的名称? 来自 有关 NTFS 内部结构的 technet 文章:
您可以使用命令行实用程序“fsutil”查询此行为:
Is the file system NTFS? Are the millions of files going to the same directory, and do they have similar names? From the technet article on NTFS internals:
You can query this behavior using the command line utility 'fsutil':
您能否提供一些有关库数据存储位置以及文件创建位置的信息?
例如,如果您将所有输出文件创建到同一目录中,您可能会发现 CreateFile 速度变慢,因为它需要检查越来越多的文件名是否存在冲突。
Can you provide some information about where the library data is stored, and where the files are being created?
For example, if you are creating all the output files into the same directory you may be finding that
CreateFile
is slowing down because it needs to check against more and more file names for collisions.可能与系统缓存冲突? 您可以查看 CreateFile 文档中的“缓存行为”部分。
Possibly fighting the system cache? You might look at the Caching Behavior section in the documentation to CreateFile.
我的心灵调试器说你正在泄漏句柄。 您是否正在 CloseHandle 处理您正在 CreateFile 处理的所有调用?
My psychic debugger says you're leaking handles. Are you CloseHandle'ing all of those calls you're CreateFile'ing?