Performance issues with a .net application running from a network share

I have a problem with a Windows Forms application (.net 4). One of our customers wants to launch it from a network resource (our application can be used by 20-300 users at the same time). We were able to get it working by adding this line to app.config

<loadFromRemoteSources enabled="true" /> 

It takes some time to start the program, and after some time, users can work. Unfortunately, they noted that when the application is not used for some time, and they want to use it again, the answer is very slow (it takes about 1-3 minutes to "wake up" the application). At least this is what I heard from our consultant.

I will probably see him next Monday, but first of all I want to know:

  • This behavior is normal, and if so, why?
  • What tools should be used to study this problem?
+4
source share
1 answer

For unmanaged exes, if the application has not been used for a while, it is unloaded. Pages containing code are simply discarded because they can be reloaded from exe or dll. When you start using the application again, it will be downloaded and it will take some time. If the application is launched from a network share, this podcasting will occur over the network and can be very slow. This can be avoided by setting the IMAGE_FILE_NET_RUN_FROM_SWAP flag (using editbin /swaprun:net ).

C # applications are a bit more complicated. The exe and dll instances are still displayed in memory, but all the code is generated at runtime from the IL. This JIT code will be uploaded to the local page file, but I assume that any resources or metadata will be dropped and uploaded on request from the network. This may explain the slowness.

Instead of speculating, run procmon and see what your application does.

+3
source

Source: https://habr.com/ru/post/1398916/


All Articles