[asp.net] Fixing slow initial load for IIS

See this article for tips on how to help performance issues. This includes both performance issues related to starting up, under the "cold start" section. Most of this will matter no matter what type of server you are using, locally or in production.

https://blogs.msdn.microsoft.com/b/mcsuksoldev/2011/01/19/common-performance-issues-on-asp-net-web-sites/

If the application deserializes anything from XML (and that includes web services…) make sure SGEN is run against all binaries involved in deseriaization and place the resulting DLLs in the Global Assembly Cache (GAC). This precompiles all the serialization objects used by the assemblies SGEN was run against and caches them in the resulting DLL. This can give huge time savings on the first deserialization (loading) of config files from disk and initial calls to web services. http://msdn.microsoft.com/en-us/library/bk3w6240(VS.80).aspx

If any IIS servers do not have outgoing access to the internet, turn off Certificate Revocation List (CRL) checking for Authenticode binaries by adding generatePublisherEvidence=”false” into machine.config. Otherwise every worker processes can hang for over 20 seconds during start-up while it times out trying to connect to the internet to obtain a CRL list. http://blogs.msdn.com/amolravande/archive/2008/07/20/startup-performance-disable-the-generatepublisherevidence-property.aspx

http://msdn.microsoft.com/en-us/library/bb629393.aspx

Consider using NGEN on all assemblies. However without careful use this doesn’t give much of a performance gain. This is because the base load addresses of all the binaries that are loaded by each process must be carefully set at build time to not overlap. If the binaries have to be rebased when they are loaded because of address clashes, almost all the performance gains of using NGEN will be lost. http://msdn.microsoft.com/en-us/magazine/cc163610.aspx

Examples related to asp.net

• RegisterStartupScript from code behind not working when Update Panel is used • You must add a reference to assembly 'netstandard, Version=2.0.0.0 • No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization • How to use log4net in Asp.net core 2.0 • Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state • How to create roles in ASP.NET Core and assign them to users? • How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause() • ASP.NET Core Web API Authentication • Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0 • WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery

Examples related to .net-4.0

• TLS 1.2 in .NET Framework 4.0 • Is it possible to run a .NET 4.5 app on XP? • What and When to use Tuple? • Fixing slow initial load for IIS • Exception: "URI formats are not supported" • What is the best way to implement a "timer"? • Twitter Bootstrap and ASP.NET GridView • How can I convert this foreach code to Parallel.ForEach? • "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded" • Differences between .NET 4.0 and .NET 4.5 in High level in .NET

Examples related to iis-7.5

• The client and server cannot communicate, because they do not possess a common algorithm - ASP.NET C# IIS TLS 1.0 / 1.1 / 1.2 - Win32Exception • Register .NET Framework 4.5 in IIS 7.5 • HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers • IIS error, Unable to start debugging on the webserver • How do I get to IIS Manager? • How prevent CPU usage 100% because of worker process in iis • How do I give ASP.NET permission to write to a folder in Windows 7? • ASP.NET 4.5 has not been registered on the Web server • Fixing slow initial load for IIS • "Cannot verify access to path (C:\inetpub\wwwroot)", when adding a virtual directory