Memcached cachedump then get key error

2019-01-03 03:08发布

.NET-Core 项目中使用了Memcached 用来缓存,在windows 也安装了相应的客户端。

CMD 使用 telnet localhost 11211 进入Memcached 进行操作。

问题是这样的,
我使用 stats items列出了所有了所有的key

然后使用 stats cachedump key 1000 来列出这个缓存的Key
如下图所示

这些都没问题,问题出在我用 get key 来获取值的时候,这个值就消失了,请问这是什么原因?

1条回答
ら.Afraid
2楼-- · 2019-01-03 04:08

Memcached 中缓存清除的机制:

Expiration in memcached is lazy. In general, an item cannot be known to be expired until something looks at it.

If you fetch an expired item, memcached will find the item, notice that it's expired, and free its memory. This gives you the common case of normal cache churn reusing its own memory.

查看更多
登录 后发表回答