谁能告诉我获取当前最大大小以将对象存储在 Memcached 中的命令

Can anybody let me know the command to obtain the current maximum size to store the object in the Memcached

任何人都可以告诉我获取当前最大大小以将对象存储在 Memcached 中的命令。 在文档中,我没有遇到获取 Memcached 容量的实际大小的问题。

它在 stat settings 命令的输出中可用。 如果您想要单个项目的最大大小或总可用内存,我没有得到,但两者都可用。

最大项目大小

(至少在不太旧的版本中,我检查了 1.4.13)。使用远程登录:

telnet <hostname> <port>
> stat settings
(...)
item_size_max 1048576
(...)

最大容量(字节)

statstat settings 均可用:

telnet <hostname> <port>
> stat settings
(...)
maxbytes 10737418240
(...)
> stat
(...)
limit_maxbytes 10737418240
(...)

剩余容量

据我所知,它不是直接可用的,你必须从 stat 命令输出中计算它:

> stat
(...)
bytes 5349380740
(...)
limit_maxbytes 10737418240
(...)

这里我还有 limit_maxbytes - bytes = 5388037500 字节剩余。

文档

doc/protocol.txt 中随源附带的文档证实了这一点:

| maxbytes          | size_t   | Maximum number of bytes allows in this cache |   
| item_size_max     | size_t   | maximum item size                            |

旁注

请注意,这只是从 memcached 的角度来看的内存消耗和内存限制。该限制是在命令行中使用 -m 选项给出的限制。它不会告诉您物理内存是否不足以处理那么多数据。