从共享网络文件夹运行的.NET应用程序的性能损失 [英] Performance penalties for .NET app running from shared network folder

查看:48
本文介绍了从共享网络文件夹运行的.NET应用程序的性能损失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从共享的网络文件夹中运行.NET 4.0应用程序是否会有性能损失?我发现什么应用程序启动速度较慢,但​​在使用时没有注意到任何速度下降,但不确定.

Are there any performance penalties running .NET 4.0 app from shared network folder? I found what app starts slower but didn't noticed any slow down while using it, but not sure about it.

推荐答案

通过网络运行可执行文件时,Windows不会在应用程序启动时通过网络带来整个应用程序.这样做是为了缩短启动时间(如果您从未真正使用过,那么下载700MB嵌入式AVI资源是没有意义的.)

When running an executable over the network, Windows does not bring the entire application over the network at application startup. This is done to speed startup times (and there's no point is downloading that 700MB embedded AVI resource if you never actually use it).

这意味着随着需要来自可执行映像的新页面,Windows将定期返回网络以检索它们.

This means that periodically, as new pages from the executable image are required, Windows will go back to the network to retrieve them.

完成此操作的方法是,如果您的应用程序碰巧碰到了不存在的内存页面,则会触发标准页面错误,告诉Windows它需要填充该页面.如果此时网络恰好发生故障,Windows将无法满足页面错误的要求.无法从中恢复,因此Windows抛出 EXCEPTION_IN_PAGE_ERROR (0xC0000005).

The method in which this is accomplished is that if your application happens to hit a page of memory that is not present, a standard page fault will trigger, telling Windows it needs to fill that page. If the network happens to be down at that moment, Windows will be unable to satisfy the page-fault. There's no way to recover from this, so Windows throws an EXCEPTION_IN_PAGE_ERROR (0xC0000005).

有三种处理方法:

  • 什么都不做,让应用程序死掉.告诉客户修复他们的网络
  • 捕获错误,解释必须立即终止该应用程序,并告知用户其网络应受罪
  • 设置 IMAGE_FILE_NET_RUN_FROM_SWAP PE映像选项.这将指示Windows在应用程序加载时通过网络复制 entire 可执行文件.这样会增加网络流量和用户等待时间(在应用程序启动时),但避免出现错误
  • do nothing and let the application die. Tell the customer to fix their network
  • trap the error, explaining that the application must be terminated now, and telling the user that their network is to blame
  • set the IMAGE_FILE_NET_RUN_FROM_SWAP PE image option. This will instruct Windows to copy the entire executable over the network at application load time. This will increase network traffic and user wait times (at application launch time), but avoid the error

这篇关于从共享网络文件夹运行的.NET应用程序的性能损失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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