cache.asciidoc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. [[index-modules-cache]]
  2. == Cache
  3. There are different caching inner modules associated with an index. They
  4. include `filter` and others.
  5. [float]
  6. [[filter]]
  7. === Filter Cache
  8. The filter cache is responsible for caching the results of filters (used
  9. in the query). The default implementation of a filter cache (and the one
  10. recommended to use in almost all cases) is the `node` filter cache type.
  11. [float]
  12. [[node-filter]]
  13. ==== Node Filter Cache
  14. The `node` filter cache may be configured to use either a percentage of
  15. the total memory allocated to the process or an specific amount of
  16. memory. All shards present on a node share a single node cache (thats
  17. why its called `node`). The cache implements an LRU eviction policy:
  18. when a cache becomes full, the least recently used data is evicted to
  19. make way for new data.
  20. The setting that allows one to control the memory size for the filter
  21. cache is `indices.cache.filter.size`, which defaults to `10%`. *Note*,
  22. this is *not* an index level setting but a node level setting (can be
  23. configured in the node configuration).
  24. `indices.cache.filter.size` can accept either a percentage value, like
  25. `30%`, or an exact value, like `512mb`.
  26. [float]
  27. [[index-filter]]
  28. ==== Index Filter Cache
  29. A filter cache that exists on the index level (on each node). Generally,
  30. not recommended for use since its memory usage depends on which shards
  31. are allocated on each node and its hard to predict it. The types are:
  32. `resident`, `soft` and `weak`.
  33. All types support the following settings:
  34. [cols="<,<",options="header",]
  35. |=======================================================================
  36. |Setting |Description
  37. |`index.cache.filter.max_size` |The max size (count, not byte size) of
  38. the cache (per search segment in a shard). Defaults to not set (`-1`),
  39. which is usually fine with `soft` cache and proper cacheable filters.
  40. |`index.cache.filter.expire` |A time based setting that expires filters
  41. after a certain time of inactivity. Defaults to `-1`. For example, can
  42. be set to `5m` for a 5 minute expiry.
  43. |=======================================================================