Pre-caching is used to trigger certain selections and actions in an application in order to have the calculations cached. This can save valuable time as fetching something from the cache is much faster than performing the needed calculations when the first users enter the system.
During a restart of the Qlik Sense Engine Service (QES) all cached result sets are purged and during a reload, when the source data is modified, the result sets from previously cached calculations become invalid. So, to avoid poor performance for the first users after a restart, an application unload, or a reload it may be beneficial to pre-cache common calculations.
In Qlik Sense pre-caching is performed using the SDKExerciser, which is the test module used in the Qlik Sense Scalability Tools.
Proceed as follows to set up pre-caching in Qlik Sense:
Use the Qlik Sense Scalability Tools to create the pre-caching scenario.
The Qlik Sense Scalability Tools are available here: https://community.qlik.com/docs/DOC-8878
When creating the scenario, keep the following differences between pre-caching and load/performance scenarios in mind:
|2.||Save the pre-caching scenario as a script (.json file).|
Create a Windows batch batch file (.bat) that runs the pre-caching script.
Example of batch file contents:
C:\ScalabilityTools-v0.3.0.18\SDKExerciser\v3.0\SDKExerciserConsole.exe config=C:\ScalabilityTools-v0.3.0.18\Scenario\MyPre-cachingScript.json LogDir=C:\ScalabilityTools-v0.3.0.18\PreCache\log\Myapp1\
For information on the SDKExerciser settings, see the documentation for the Qlik Sense Scalability Tools.
Note: When calling the pre-caching script from the batch file, make sure to use the SDKExerciser module version (3.0 in the example above) that corresponds to your Qlik Sense version.
|4.||Select a scheduling mechanism (for example, the Task Scheduler in Microsoft Windows) and configure it to run the batch file when needed.|
Cheers from the Scalability Team