Databases can be configured for caching in several ways to improve their performance. Caching can result in the ThorServer to "holding" some or all of a database in memory for fast access, and supplements the operating system file caching capabilities. Caching is using RAM instead of disk to improve speed and efficiency. Caching may be specified by the configuration of a database, or initiated by client request if allowed by configuration. Caching configuration specifications are normally made by thormake, thorchange, or sthorman.
The following is a description of caching options:
-CACHE_WHEN NEVER
-CACHE_WHEN OK
-CACHE_WHEN ALWAYS
-CACHE_LEVEL WRITETHRU
-CACHE_LEVEL READWRITE
-CACHE_LEVEL WRITETHRU_ALL
-CACHE_LEVEL READWRITE_ALL
Note: The option CACHE_LEVEL is ignored unless CACHE_WHEN is ALWAYS.
The corresponding entries in the my_database.THOR are:
cache level:
cache level: NEVER
cache level: ON_REQUEST
cache level: ALWAYS WRITETHRU
cache level: ALWAYS READWRITE
cache level: ALWAYS WRITETHRU_ALL
cache level: ALWAYS READWRITE_ALL
Both primary and cross-referenced data are cached by default. However, we can select either primary and cross-referenced data are caching. The options for specifying one or the other are:
-CACHE_WHAT DATA
-CACHE_WHAT XREFS
The corresponding entries in the my_database.THOR are:
cache level: ALWAYS WRITETHRU DATA_ONLY
cache level: ALWAYS READWRITE DATA_ONLY
cache level: ALWAYS WRITETHRU_ALL DATA_ONLY
cache level: ALWAYS READWRITE_ALL DATA_ONLY
cache level: ALWAYS WRITETHRU XREFS_ONLY
cache level: ALWAYS READWRITE XREFS_ONLY
cache level: ALWAYS WRITETHRU_ALL XREFS_ONLY
cache level: ALWAYS READWRITE_ALL XREFS_ONLY
Note: Caching the indirect database instead of the "regular" database can result in a great performance improvement. This is especially true for databases with a large number of indirect references per TDT.