I am using OWIN to implement Microsoft's Identity 2.0 in an MVC5 application.
Everything works fine in my development environment (VS 2013 - V12+ Update 4, IIS Express).
However when I upload the application to my IIS Test Server that only runs this application, IIS will hang on any page request in the application for a period of time (22-34 seconds). Sometimes it accesses the page instantaneously without hanging then after a period of time the hang comes back. Examining the IIS worker process always shows the hang happening on:
_DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule, Micorosoft.Owin.Host.SystemWeb, Version=etc
Resolution Process after reading SO.com:
I thought it may be due to Application Pools recycling (set the Idle TimeOut from 20 to 0). Problem remained.
Deleted entire web application, started fresh install. Problem remained.
Deleted ASP.NET Temporary files, recycled the Application Pool. Problem remained.
Checked the connection strings to the database. Connectivity / initial catalog exists and functional. * This had been an issue in other posts.
DNS was the problem : A secondary DNS server in the web server's ethernet configuration was pointing to an additional DNS server that was outside the server farm's domain. The application module would occasionally utilize this DNS server which obviously could not resolve / locate the database server necessary for functionality of the Microsoft Identity feature via the integrated OWIN pipe. This was leading to the "hang" until the module would time out (24-34 seconds later).