We are working with PHP and are using memcached v1.4.6 for caching. We are using memcache extension memcache-2.2.6 from PECL. We are using persistent connection to connect to memcached.
Recently we made some changes that has doubled the number of keys stored in memcached. These keys are at max 75 to 80 characters long. The values stored are integers.
Whenever we try working with the new code, the system works fine for the first few seconds (usually less than 10 seconds). After the first few seconds, memcache starts returning "false" for every request (get, set, increment)
If at this stage we revert back to the old code, things start working fine again.
The request rate on our memcached server is about 270 requests per second (with the old code). This is expected to grow to over 1000 requests per second with the new code.
When memcache starts returning "false", around 15% of the allocated memory is free.
What could be causing this behaviour?
/usr/bin/memcached -d -m 2048 -u root
. When it starts returning "false", 15% of the memory allocated to memcached is free. Please correct me if I am wrong, but even in case there was no free memory, shouldn't memcached evict an older item when we issue theset
command. The response toset
should not be "false" in such a case. Thanks. – Nikhilset
command returns false in my case. I will try using the Memcached library from PECL. – Nikhilset
command no longer returns false. – Nikhil