Search code examples
asp.netiiswindows-server-2008windows-authenticationimpersonation

IIS 7 open file slow/delay with impersonation


I currently have an issue where doing a simple file.exists takes 4.6 seconds to return when run from a IIS hosted site. The second run takes 2.3 seconds.

As soon as I remove impersonation it runs in 0.1 seconds.

I have simply created an ASP.Net site with file.exists in the page load to replicate the issue.

The site is setup on a Windows Server 2008 Enterprise, IIS hosting a site in classic pipeline mode, .Net framework 2, Windows authentication enabled (Kernel mode disabled) and impersonation enabled (impersonate user). The application pool uses a domain account with access to the required file locations.

I have what should be 4 identical servers with 3 having this issue and one not with no differences that I can find.


Solution

  • The following factors were the reason for this

    • User impersonation on the web service

    • The web service using the UNC paths to access SharePoint sites

    a. This forces the use of the ‘Web Client’ service to access the SharePoint site using the UNC path

    • Default server group policy set to automatically detect proxy configuration settings

    This issue then is created by the UNC path using the Web Client service to access the SharePoint site as the impersonated user – it would seem behind the scenes the default Internets settings are used for the impersonated user (no profile on the server) which then requests the proxy (as specified by the default group policy) and times out before continuing without it.

    The issue is resolved by altering the default server group policy settings not to use this option –

    • Automatically detect configuration settings – uncheck

    • Make Proxy settings per-machine (rather than per-user) – Enabled