Smartforms Performance: Warmup Options

  • 24 February 2022
  • 0 replies
  • 178 views

Userlevel 5
Badge +20
 

K2 SmartForms Performance - Warmup Options

KBS100015

PRODUCT
K2 Five            K2 blackpearl 4.7
K2 smartforms 4.7
BASED ON
K2 blackpearl 4.7
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

 

Issue

When there is a requirement to improve the initial load time of K2 SmartForms Forms and Views (Please note: These settings are included by default with K2 Five - they do not need to be configured, as they are set correctly by default)

 

Symptoms

 
You will find in this article, information and instructions on the warmup options available.  This may include:
  • Settings and Web.config keys that are required to enable the Smartforms Pre-Caching
  • How to setup logging to verify that this Pre-Caching is working as expected.

 

Troubleshooting Steps

 

IIS Application Pool recycling and startup process impact: Warmup scripts and pre-caching

IIS Application Pool Recycling means the worker process that handles requests for that application pool is terminated and a new one is started. This is generally done to avoid unstable states that can lead to application crashes, hangs, or memory leaks.

 

 

The default K2 SmartForms Runtime Application Pool settings should be as follows:

  1. Start Mode - AlwaysRunning
  2. Idle Time-out (minutes) - 1440
  3. Idle Time-out Action – Suspend

The above settings should prevent a slow startup each day since the application should not have been restarted.

 

If a K2 SmartForms Runtime Application Pool startup process does occur when the site runs for the first time every day, this will slow down the page load. It might also be that other applications are starting at the same time, which could also slow down the first load of the K2 SmartForms page even further. Warm-up scripts are available to reduce the impact of such an Application Pool startup process if required. SmartForms Pre-Caching was introduced in the K2 Blackpearl 4.7 Release. This allows warmup functionality for all forms or for specific forms.

 

The following Web.config settings are required to enable this warmup functionality and to produce logs that will verify that the warmup occurred effectively for the relevant forms.

 

To enable the SmartForms warmup

 

Ensure that the relevant forms and views are checked-in, else the pre-caching won’t work.

 

IIS Settings

  • In IIS Manager on the K2 site and the Runtime site, please ensure that Preload is enabled in the Advanced Settings.
  • Right-click on Site > Manage Website > Advanced Settings

 

Image

 

  • In the SmartForms Runtiime Web.config (C:Program Files (x86)K2 blackpearlK2 SmartForms RuntimeWeb.config)
  • Add the following in your web.config file in the appSettings Section to pre-cache all SmartForms Forms and Views:

 

<add key="Forms.Warmup.PreCache.AllForms" value="true" />

 

Or, to enable pre-caching for certain forms, add the following in your web.config file in the appSettings Section:

 

<add key="Forms.Warmup.PreCache.AllForms" value="false" />

 

Ensure the following keys exist and are enabled in the system.webServer section:

<applicationInitialization doAppInitAfterRestart="true" remapManagedRequestsTo="Startup_Runtime.html" skipManagedModules="false">

      <add initializationPage="/Warmup.aspx" />

</applicationInitialization>

 

To verify if pre-caching is working as expected, you can enable K2 SmartForms Logging:

 

Add the C:Debug folder and set full permissions for authenticated users

<add key="TraceFilter" value="FormRuntime,Performance,PerformanceSummary"/>

<system.diagnostics>

    <switches>

      <add name="ExtendedExceptionDetail" value="True" />

      <add name="EnableTracing" value="true" />

      <add name="MessageTypeToTrace" value="4" />

      <add name="TracingToFile" value="true" />

    </switches>

  </system.diagnostics>

 

Perform an IISRESET on the K2 SmartForms Servers and refresh your browser by using Ctrl+F5. The following should be visible on the Form:

 

21842iA21D5C42E42A1C80.png

 

 

  • If the above spinner does not display, the logs should be available in CSV format in the 'c:Debug' folder.
  • Search for 'Pre-Cache ALL Forms' and/or 'Pre-Cache Forms' to see if any errors occurred during the pre-cache. The specified form/view should be listed in the logs.

 

Alternative PowerShell warmup scripts

 

Alternative warmup scripts may include simple PowerShell scripts that can preload a specific URL to ensure that related CSS and JavaScript is cached (also depending on browser settings). We have such a script available, this can be found here:

https://community.nintex.com/t5/How-To/How-to-Improve-Performance-by-Enabling-IIS-Caching-on-Initial/ta-p/123207http://help.k2.com/kb001759

 

There are also custom PowerShell scripts available that can schedule an IIS warmup based on when App Pool Recycling occurs. This article explains such a setup:

https://www.henriksommerfeld.se/setting-up-an-iis-warm-up-script-in-an-automated-fashion/

 

The above PowerShell scripts will not be effective when attempting to cache forms that are loading using iFrames.

 

Additionally, have a look at the IIS Application Initialization Extension here:

https://forums.iis.net/t/1176740.aspx

 

Slow performance due to network communication delays and/or authentication related issues will not necessarily be resolved by the SmartForms pre-caching or the Powershell warmup scripts. In this case the network and/or user authentication and permission settings will have to be inspected to understand the cause of the delays. 

 

 


0 replies

Be the first to reply!

Reply