Memory cache
factry historian can cache time series data in memory this will speed up queries but will consume more memory the memory cache is only used for internal queries and not for queries from the api so calculations and event queries will benefit from the cache, but queries made from the frontend, the grafana datasource or the api directly will not only measurements which have consumers are kept in the cache if a measurement is not used in any calculations or events it will not be cached only queries with supported features are able to use the cache the following aggregations are supported count first last sum min max mean median spread mode which means the following are not supported integral , stddev , twa aggregations are not the only requirement a query is only served from the cache when it uses none of the following features grouping by named tags only no grouping, or grouping by all tags ( ), is supported fill modes other than none and null previous, linear and 0 are not supported value filters descending timestamp order query offsets a query that uses an unsupported feature is not answered by the cache but by the time series database directly, so it never returns wrong or partial data the same applies when the cache does not fully cover the requested time range the cache never serves a partially covered range settings the size of the cache and whether it is enabled can be configured in the settings page docid\ jwpo8qzsond29mhglerea of the historian guidelines having the cache enabled will speed up queries, but will consume more memory be careful when increasing the cache size, keep an eye on the memory usage of the historian and adjust accordingly changing the cache size will not have an immediate effect, the cache will slowly adjust to the new size so if you increase the cache size it will take some time before the cache is fully populated numeric and boolean data are quite consistent in their size but string data can vary based on the number of unique strings the more unique strings the more memory is used below is some data on how much memory is used by different data types when 16 million data points are cached booleans ±768 mib numbers ±896 mib strings (16k unique) ±772 mib strings (1m unique) ±946 mib strings (16m unique) ±3616 mib statistics the following statistics are available in the internal factry database cache size the current capacity of the cache in data points cache max size the maximum size of the cache in data points cache measurement max size the maximum size of the cache per measurement in data points cache used the current amount of data points in the cache cache consumer count the number of consumers of the cache so the number of calculations or event workers that are using the cache cache measurement count the number of measurements that are in the cache cache hits the number of measurements that were served from the cache a query over several cached measurements increments this once per measurement, not once per query cache missed by error the number of queries that were not served from the cache due to an error cache missed by feature the number of queries that were not served from the cache due to a feature not being supported for example an aggregation cache missed by range the number of queries that were not served from the cache due to the data not being in the cache the following are available from version 8 2 and later cache missed by missing the number of misses because the measurement was not in the cache at all cache queries hit and cache queries miss the query level counters a query counts as a hit only when every measurement in it was served from the cache