EPiWiki.se  - EPiServer notes shared with others
 

Long time to start an EPiServer CMS site

[Edit]
Tips and trix how to minimize the time to start an EPiServer site

Detecting load times


In Episerver 7 a hidden feature was added to show all load times for initialization modules, to access this you have to add the appsetting EPi.DebugView.Enabled to true
Then access the page
http://[site]/[UI]/Shell/Debug/ShowTimeMeters
and a list of Assembly, Type, Action, Time (ms) will show up.
Example configuration

<configuration>
...
  <appSettings>
    <add key="EPi.DebugView.Enabled" value="true" />
http://localhost:7077/EPiServer/Shell/Debug/ShowTimeMeters




Language files


Language files is parsed at start up remove unnesesary language files from the lang/ folder.

Assembly scaning


Long time to start a CMS 6 site can be solved by preventing initializing of known assemblies. This is done in EPiServerFramework.config

Example



<episerver.framework>
    <scanAssembly forceBinFolderScan="false">
      <add assembly="*" />
      <remove assembly="MyThirdPartAssembyNotUsingCMS6Initialization" />


A tool to get a list of remove tags for your EPiServerFramework.config

Usage


Paste the file in the sites bin folder.
Execute createepiserverframeworkconfig.exe

Output



<remove assembly="MyThirdPartAssembyNotUsingCMS6Initialization" />

Copy the generated lines to your EPiServerFrameWork.config file
Test that everything working...

Download


createepiserverframeworkconfig.exe (version 0.2 NOT TESTED so be careful)

Tool suggests commenting adding EPiServer.UI to the remove list which seems to loose some of the cms tabs.

Alternative Solution


EPiServer CMS will log which assemblies contain plugins, and who do not during initialization. Add a log4net logger like this to your episerverlog.config:

<appender name="initAppender"
type="log4net.Appender.FileAppender" >
<file value="init.txt" />
<encoding value="utf-8" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level [%thread] %type.%method - %message%n" />
</layout>
</appender>

<logger name="EPiServer.Framework.Initialization"
additivity="false">
<level value="Info" />
<appender-ref ref="initAppender" />
</logger>

Start your web site and inspect the log. You'll see lines like this:

Unnecessary scanning of assembly PageTypeBuilder.Activation.StructureMap

Find all assemblies that EPiServer reports as not necessary, and remove them as explained above.

Optimize ASP.NET compilation



<configuration
   <compilation defaultLanguage="c#" debug="true" optimizeCompilations="true">

Development machine


Configure Windows defender


Windows defender can make the startup time for your site to be long, to fix this add a exclusion for the iisexperexx.exe and w3wp.exe in the settings of Windows Defender
Version author:
Mattias Lövström

EPiServer version

'EPiServer CMS 6''CMS 7.5'