Hybrid Caching
The Logi Info Data Engine includes our "hybrid caching" feature, which provides improved management of web server resources, especially memory. When the a Logi application is responding to a request for a report, there are three distinct production phases that involve data manipulation:
- When a datalayer retrieves data and caches it as an XML stream,
- When that cache is processed using filtering, grouping, and aggregation,
- When the HTML output (the report page) is being generated.
These activities typically use web server memory but, if the amount of data involved is very large, the potential exists to literally run out of memory. The Data Engine manages this situation as illustrated below:
The hybrid caching feature preventsout-of-memory conditions by allowing the data streams used in these operations to be dynamically switched between the web server's memory and the web server's file system. The engine continuously monitors the amount of data it's manipulating in each production phase and, if it exceeds a specific threshold, switches caching to the file system. If the amount of data drops below the threshold during subsequent phases, caching switches back to memory. Logi report developers can use the default memory consumption threshold (10MB) or set special constants in their application to tailor the threshold as needed.
Configuring Hybrid Caching
The following constant can be added to the Constants element in your _Settings definition to configure the hybrid caching of data and rendered HTML:
Name | Description |
---|---|
rdMemoryStreamLimit
|
This value sets the threshold, in MB, for shifting from memory caching to file system caching. A value of 0 will force all data and HTML caching to the file system; a value of 2048, the maximum, will force it to memory. The default value is 10MB.
|
In general, the default setting is good for most purposes. Changes should be considered only if actual problems with memory or performance are observed. Switching to 100% memory-based caching may sound appealing from a performance perspective but may not actually provide the best overall use of resources in your server.
The rdDataCache and rdDownload system folders are used to store a variety of other temporary files. Changing to 100% memory-based caching of data and HTML will not prevent these other files from being written to these folders.