Should .NET MVC 3 actions trigger w3wp.exe to generate Process Monitor "PATH NOT FOUND" and "NAME NOT FOUND" errors?
If I create an out-of-the-box ASP.NET MVC 3 Web Application (non-empty, Razor, no unit tests) and deploy it to an IIS 7.5 site (.NET 4, Integrated Pipeline), every controller action I trigger causes a ton of "name not found" and "path not found" errors in procmon.
The w3wp.exe process is trying to visit file system locations that the MVC Routing engine should pick up and h开发者_开发知识库andle. This is a small portion of the procmon log after clicking the "LogOn" link one time only:
Is this expected behavior? It doesn't feel right to me.
I came across this because my server CPU utilization was pegged at 100%. One of my calls was happening frequently enough (causing the "path not found" error) that it was eating up CPU. As soon as I created a file system folder at the path it was trying to access, the CPU utilization dropped to 0% (~85 concurrent users on the site in both cases).
You're probably in the Debug configuration. When DEBUG is defined, MVC does a ton of file probing which it doesn't do in Release configuration (Release uses a file cache, so you only pay this cost the first time). As a general rule, you should always use Release configuration for performance testing.
10 years late... Have you tried setting allowSubDirConfig to false?
It's not necessarily right or wrong. Microsofts default is for the w3wp.exe worker to check those directories so you can have a different web.config than the root application (e.g. a child application). It seems like an ancient default, because if you're deploying Microsoft apis you almost always want the IIS worked to hand off routing to dotnet/dotnetcore immediately. I'm not an IIS admin though, so I probably have an incomplete understanding. We found we gained a slight performance increase with the configuration set to false.
精彩评论