What is the limit on the number of keys I can reuse for memcache

So, in PHP we can do $memcache->get(array('a','b','c'));
I wonder what the key limit is before everything breaks. Can I transfer 1000 keys? 10,000 keys?

I tried to find the answer, but I can not find anywhere.

Does anyone have experience transferring a large number of keys to do multi-get to memcache?

+4
source share
2 answers

The Memcached extension supports at least 100,000 keys in getMulti, given this test:

 php > $data = array_map(function($v){ return 'x' . $v; }, range(1, 100000)); php > foreach($data as $d) { $memcached->add($d, $d); } php > $multi = $memcached->getMulti($data); php > echo is_array($multi); 1 php > echo count($multi); 100000 

I tried to raise it to a million, but I hit my configured PHP memory limit and immediately decided that if you getMulti out of a hundred thousand items is not enough, you are probably misusing memcached.

+3
source

There is no hard limit, but there will be different practical limitations that are likely to be application specific.

+2
source

Source: https://habr.com/ru/post/1344179/


All Articles