Failed to save data to server from memcached

hi, I want to know why I can not store multidimensional (array size more than 1000)

$memcache = new Memcache; $memcache->connect('localhost', 11211) or die ("Could not connect"); 

the above instructions work correctly ...

below have an error ...

  $memcache->set('key', $sear, false, 60) or die ("Failed to save data at the server"); if the $sear is string or object array then no problem for store data at the server.. but i store multi dimensional array in memcached,,i will get the error is Failed to save data at the server 

thanks and go

+4
source share
1 answer

The array you are trying to keep is probably too large. Memcache has a single element size limit. The maximum size for each item is 1,048,576 bytes or 1 MB .

Here is another question regarding this issue ...

Can you store a PHP array in Memcache?

+2
source

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


All Articles