memcached 统计数据 total_items 小于 cmd_set
memcached statistics total_items is less than cmd_set
我的 memcached 服务器上的统计数据显示出一种奇怪的关系:total_items 小于 cmd_set。此服务器上唯一的操作 运行 是 "set" 和 "get",没有其他类似 "add"、"replace"、"delete" 或基于 CAS 的操作。
当我查看 memcached 源代码时,我看到任何 "normal" 集 (w/o CAS) 将替换或写入项目,并且两者都会递增 total_items。
do_store_item() {
// ...
if (old_it != NULL)
item_replace(old_it, it, hv);
else
do_item_link(it, hv);
// ...
}
do_item_link()增加了total_items,item_replace()也调用了do_item_link()。那total_items怎么会小于cmd_set呢?
memcached 统计信息摘录(数字为了便于阅读而缩进):
STAT cmd_set 12827359728
STAT total_items 4237422053
STAT curr_items 60745375
STAT expired_unfetched 9898430934
STAT evicted_unfetched 30415090
STAT evictions 30421532
STAT reclaimed 9900995350
统计数据看起来很奇怪,因为它们是错误的。这是一个 memcached 错误(整数溢出 2^32)。 memcached 开发人员已经承认并修复了它。有关详细信息,请参阅 https://github.com/memcached/memcached/issues/161。
我的 memcached 服务器上的统计数据显示出一种奇怪的关系:total_items 小于 cmd_set。此服务器上唯一的操作 运行 是 "set" 和 "get",没有其他类似 "add"、"replace"、"delete" 或基于 CAS 的操作。
当我查看 memcached 源代码时,我看到任何 "normal" 集 (w/o CAS) 将替换或写入项目,并且两者都会递增 total_items。
do_store_item() {
// ...
if (old_it != NULL)
item_replace(old_it, it, hv);
else
do_item_link(it, hv);
// ...
}
do_item_link()增加了total_items,item_replace()也调用了do_item_link()。那total_items怎么会小于cmd_set呢?
memcached 统计信息摘录(数字为了便于阅读而缩进):
STAT cmd_set 12827359728
STAT total_items 4237422053
STAT curr_items 60745375
STAT expired_unfetched 9898430934
STAT evicted_unfetched 30415090
STAT evictions 30421532
STAT reclaimed 9900995350
统计数据看起来很奇怪,因为它们是错误的。这是一个 memcached 错误(整数溢出 2^32)。 memcached 开发人员已经承认并修复了它。有关详细信息,请参阅 https://github.com/memcached/memcached/issues/161。