Find memcached size using php
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?
Maximum limit of the cache :
- it depends on how much memory you indicated memcached can used -- this is done when starting memcached.
- Note, though, that each item you store in cache cannot be more than 1 MB
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 :
- I've never hit any limit on one server ; and I've not found any number in the FAQ
- Anyway, if you hit any possible limit with the servers you are currently using, just add one additional daemon : memcached works as a cluster ;-)
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.
精彩评论