这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.
2022 Zabbix中国峰会
2022 Zabbix中国峰会
Table of Contents

11 值缓存

概览

为了更快地计算触发器表达式、计算或聚合类型监控项和一些宏。ZABBIX Server支持值缓存选项。

这个内存缓存,可以用于访问历史数据,而不需要对数据库直接执行SQL调用。如果请求的历史值不在缓存中,则会从数据库请求缺失的数据,并相应地更新缓存。

要启用值缓存功能,Zabbix服务器配置支持可选的ValueCacheSize参数。

有两个内部的监控项来监控值缓存:zabbix[vcache,buffer,<mode>]zabbix[vcache,cache,<parameter>]。查看更多细节,请参阅内部监控项

Item values remain in value cache either until:

  • the item is deleted (cached values are deleted after the next configuration sync);
  • the item value is outside the time or count range specified in the trigger/calculated item expression (cached value is removed when a new value is received);
  • the time or count range specified in the trigger/calculated item expression is changed so that less data is required for calculation (unnecessary cached values are removed after 24 hours).

Value cache status can be observed by using the server runtime control option diaginfo (or diaginfo=valuecache) and inspecting the section for value cache diagnostic information. This can be useful for determining misconfigured triggers or calculated items.

To enable the value cache functionality, an optional ValueCacheSize parameter is supported by the Zabbix server configuration file.

Two internal items are supported for monitoring the value cache: zabbix[vcache,buffer,<mode>] and zabbix[vcache,cache,<parameter>]. See more details with internal items.