Slow Initial Portal Load Time

 

Configuring Application Pool Recycling

A slow page load time can indicate that the application pool has been recycled since the last time the portal was accessed.  When a user accesses a page on the Cireson Portal for the first time after an application pool recycle, an application start event occurs which will pull the ServiceManagement database cache into the browser memory cache.  Especially for large customer environments this process can take up to a few minutes.  This is a one-time event that occurs after each application pool recycle.  Further, for each page that is accessed for the first time after an application pool recycle, IIS will take a little longer to generate the page and store the resulting page in the IIS output caching.  This needs to be done only once for each page.  Once the web site memory cache is populated and a page has been cached in the output cache, subsequent requests for that page should be fast.   The application pool recycles every 29 hours by default, so users can experience this as a slow initial load on a near-daily frequency.  Because the default is 29 hours it will occur at a different time each day, sometimes occurring during business hours.  Also, administrators may be recycling more often, especially if they are working on configuring the portal for an initial deployment.

One thing that can be done to help address this is to adjust application pool recycling frequency/conditions. While Cireson does not recommend shutting off app pool recycling completely, it can be delayed to occur once every few days or during specific time windows. To do this, open IIS:

  • Navigate to Application Pools.
  • Right click on CiresonPortal.
  • Select Recycling…
  • Edit the Recycling conditions. The default setting is 1740 minutes (29 hours).  Cireson recommends only having the app pool recycle automatically 1/day during non-business hours.
Configuring Application Initialization

One thing you can do to minimize the performance impact of the application start event and the process of loading cache data from ServiceManagement into the web site memory cache is to immediately execute the app start event code after an application pool recycle instead of waiting for the first user to request a page from the web site.  This can be done by configuring a feature of IIS called ‘Application Initialization’.

To use Application Initialization you must first install the feature using the Add Roles/Features wizard in the Server Manager (not Service Manager) console.

To configure Application Initialization do the following:

  • Open IIS
  • Navigate to Application Pools in the navigation tree on the left
  • Right click on the CiresonPortal application pool and choose Advanced Options
  • Change Start Mode to AlwaysRunning
  • Navigate to the Cireson Portal web site on the left navigation tree.
  • Double click ‘Configuration Editor’ in the center panel bottom row.
  • In the drop down at the top, select system.webServer/applicationInitialization
  • Change the doAppInitAfterRestart to true
  • Click Apply on the right

Now, when you restart the web site a background process will try to access a page on the site immediately after the application pool is restarted (instead of waiting for the first user to access the page and trigger the cache load application start event).  If you wait for a few minutes after a web site restart and then access the site you should see that the first page access time is minimal because the cache has already been populated in the background.

  • Configuring the Idle Timeout

By default, when an IIS web site is installed it is configured to shut down the application pool if it is idle for 20 minutes.  You can change the Idel Time-Out value in settings like this:

  • Open IIS
  • Navigate to Application Pools in the navigation tree on the left
  • Right click on the CiresonPortal application pool and choose Advanced Options
  • Change Idle Time-Out (minutes) to whatever value you want.  Cireson recommends 0 (don’t ever stop the application pool due to inactivity) for a production environment and 60 minutes for a non-production environment.
Configuring ASP.Net Session Timeout

You can also set the session timeout at a longer interval for users. Instructions can be found here: https://support.cireson.com/KnowledgeBase/View/1094.  Changing the session timeout is especially useful when you are using Forms Authentication so user’s are not logged out due to a lack of activity and forced to enter their credentials again.

 

For additional assistance, please visit the Cireson Community or contact team@cireson.com.