MicroStrategy ONE
Understanding Caching Properties
MicroStrategy Web products cache various properties related to the user, project, or MicroStrategy Intelligence Server. This helps in reducing the response time for every request by delivering the properties from a closer location than the original Intelligence Server. In majority of the cases, the default caching properties should be applicable to your business intelligence infrastructure.
However, there can be scenarios where you want to modify the caching properties.
-
If you are constantly making schema-level changes to a project that affect objects such as attributes, hierarchies, and tables, you may want to propagate the changes to users more frequently than the default time of 24 hours. Click here for details on how to handle this scenario.
-
Sometimes MicroStrategy Web products are deployed using a cluster of Web servers or Application servers. Users can connect to any of the Web servers depending on the clustering configuration. If you make any change to the default project settings or the MicroStrategy Web Administrator settings using MicroStrategy Web product on one Web Server, you may want to make sure that these changes are propagated to all users even when they connect to other Web servers. Click here for details on how to handle this scenario.
MicroStrategy does not recommend modifying the default caching properties unless you are absolutely sure about the settings you want to change. Using the wrong settings can severely affect performance. Refer to the things to remember section before modifying any caching properties.
Caching properties in MicroStrategy Web products are defined in a configuration file called CacheConfig.properties.
-
Default location in a .NET environment: WEB-INF/classes subfolder of your MicroStrategy Web installation folder.
-
Default location in a J2EE environment: WebUtils.jar in the WEB-INF/lib subfolder of your MicroStrategy Web installation folder.
The caching properties in this file can be modified to reflect the settings that are relevant to your business intelligence application. In a .NET environment, this modified file should be placed in the WEB-INF/classes subfolder. In a J2EE environment, extract CacheConfig.properties from WebUtils.jar and place it in the WEB-INF/classes subfolder of your MicroStrategy Web installation folder. Make modifications to the file in the WEB-INF/classes subfolder.
Since the CacheConfig.properties file has detailed comments for each cache property, all the cache settings are not listed here individually. This section discusses the important caching properties which are used for modifying the cache settings. After reading this section, open the CacheConfig.properties file to get familiar with the different cache settings.
Timeout and Refresh Time
The two most important caching properties in MicroStrategy Web products are timeout and refresh time.
-
Timeout—Value of a timeout indicates the expiration time for a cache. This value is expressed in seconds.
-
RefreshTime—Value of refresh time determines the frequency of calls made to Intelligence Server to retrieve new updated cache properties and synchronize the cache. This value is expressed in seconds.
A timeout value of 1200 indicates that the cache should expire if there is no activity for 1200 seconds or 20 minutes. A refresh time of 86400 indicates that Intelligence Server will be polled every 86400 seconds or 24 hours to synchronize the cache.
Types of Caches
There are three types of caches used in MicroStrategy Web products. These are described below.
-
Session Cache—Specific to a user and exists only while the user is logged in. This cache is deleted when the user logs out or if there’s no activity for a specified timeout interval. The default value for a timeout is 1200 seconds or 20 minutes.
-
Project Cache—Specific to a project that is registered with Intelligence Server. The default value for a timeout is 86400 seconds or 24 hours. The default value for a refresh time is 86400 seconds or 24 hours.
-
Server Cache—Specific to a MicroStrategy Intelligence Server. The default value for a timeout is 86400 seconds or 24 hours. The default value for a refresh time is 86400 seconds or 24 hours.
The default values for timeout and refresh time are defined as global default values in CacheConfig.properties. Refer to the following snippet from the CacheConfig.properties file.
1. # cache.timeout=DEFAULT
2. defaultUserTimeout=1200
3. # cache.timeout=DEFAULTSYS
4. defaultSysTimeout=86400
5. # cache.refreshTime=DEFAULT
6. defaultRefreshTime=86400
Lines 1 and 2 define the default timeout value for a session cache. Lines 3 and 4 define the default timeout value for project caches and server caches. Lines 5 and 6 define the default refresh time value for all types of caches. Changing the default values in this global location helps in propagating the changes throughout the configuration file.
Properties for all types of caches are defined in the following syntax:
# CACHE_NAME.timeout=<VALUE>
# CACHE_NAME.refreshTime=<VALUE>
The <VALUE> can be a number (expressed in seconds) or DEFAULT or DEFAULTSYS or OFF. If you use DEFAULT or DEFAULTSYS, the default value specified globally will be applied. To turn off the cache property, use OFF.
Example 1:
up.timeout=DEFAULT
up.refreshTime=OFF
“up” is a property for a session cache that is related to user preferences. up.timeout=DEFAULT indicates that the cache should expire using the default value of 1200 seconds (or 20 minutes) if there is no activity. up.refreshTime=OFF indicates that the cache should not be synchronized.
Example 2:
sp.timeout=DEFAULTSYS
sp.refreshTime=DEFAULT
“sp” is a property for a server cache that is related to preferences applied for all users to all projects registered with a specific MicroStrategy Intelligence Server. sp.timeout=DEFAULTSYS indicates that the cache should expire using the default value of 86400 seconds (or 24 hours) if there is no activity. sp.refreshTime=OFF indicates that the cache should be synchronized every 86400 seconds (or 24 hours).
Additional Properties
In addition to timeout and refresh time, the following global properties are used in the CacheConfig.properties file.
-
cleanupTime—Value of a cleanup time determines when to trigger the timeout property. This value is expressed in seconds.
-
disableSoftRef—Default value of NO indicates that all references should be made normal or hard references. Session caches are soft references while project and server caches are normal or hard references. A default value of NO ensures that the session caches are not deleted by the JVM if the system falls short of memory.
-
defaultStatisticTime—Value indicates the frequency in which the cache statistics are collected. These statistics include size of the cache, number of times information was loaded in the cache, number of times information was retrieved from the cache, and percentage of requests when information was obtained from the cache.
Things to remember
-
Timeout keeps the system clean while refresh time keeps the cache synchronized.
-
Never set the timeout value for a session cache to OFF. This prevents a user’s cache from expiring and can have severe security and performance implications. Thus, the cache is permanent.
-
Never set the refresh time value for a project cache or a server cache to OFF. This prevents a user’s cache from getting synchronized with the new settings on Intelligence Server. Thus, the cache is permanent.
-
To continuously poll Intelligence Server for the latest settings, set the refresh time value for a server cache to a small value (in seconds) or 0 seconds. Thus, the cache is constantly getting synchronized. However, this can lead to deterioration in performance.
Using caching to handle different scenarios
-
If you are constantly making schema-level changes to a project that affect objects such as attributes, hierarchies, and tables, you may want to propagate the changes to users more frequently than the default time of 24 hours.
Recommended Approach(es): The default refresh time for a server cache is 86400 seconds or 24 hours. You can temporarily change this setting to a shorter duration so Intelligence Server is frequently polled to synchronize the cache.
-
Sometimes MicroStrategy Web products are deployed using a cluster of Web servers or Application servers. Users can connect to any of the Web servers depending on the clustering configuration. If you make any change to a MicroStrategy Web product on one Web Server, you may want to make sure that these changes are propagated to all users even when they connect to other Web servers.
Recommended Approach(es): The default refresh time for a server cache is 86400 seconds or 24 hours. You can wait for 86400 seconds or 24 hours for all the caches to be automatically updated on other instances of the Web server or Application server.
You can also log into each of the MicroStrategy Web products and update the settings.
Alternatively, restart the Web or Application servers to delete the caches.