使用 php 查找 memcached 大小
我正在使用 PHP memcached 来存储记录。但它在缓存中存储的记录不超过 2000 条。
我很感兴趣地发现:
- Memcached 中可以存储多少条记录?
- 如何计算Memcached的大小以及缓存中存储的最大限制是多少?
I am using PHP memcached for storing records. But it is not storing more than 2000 records in the cache.
I am interesting in finding:
- How many records can be stored in Memcached?
- How to calculate the size of Memcached and what is the max limit to store in the cache?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
缓存的最大限制:
缓存中数据的大小、缓存中项目的数量:有 PHP 函数可以帮助实现这一点;根据您用于连接到 memcached 的扩展,请参阅:
Memcached: :getStats
Memcache::getStats
Memcache::getExtendedStats
memcached 中可以存储的最大项目数:
Maximum limit of the cache :
Size of the data in cache, number of items in cache : there are PHP functions which can help with that ; depending on the extension you are using to connect to memcached, see :
Memcached::getStats
Memcache::getStats
Memcache::getExtendedStats
Maximum number of items you can store in memcached :
Memcached 大小由您的主机设置。通常您可以增加它,但这样做通常也需要付费。
如果您在本地计算机上进行开发,根据 memcached 文档,您可以使用
memcached -m [size]
设置限制。我在此处找到了一个 perl 实用程序,它似乎可以转储出您正在查找的确切信息寻找。
Memcached size is set by your host. You can generally have it increased, but it also usually costs to do so.
If you're developing on a local machine, according to memcached docs, you can set the limit with
memcached -m [size]
.I found a perl utility here that seems to dump out the exact information that you're looking for.