-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phalcon\Cache\Backend\Memcache fails on high usage #1550
Comments
Hm... This seems to be a valid concern. |
This backend uses Memcache extension, not Memcached.
This has been fixed in 2.0.9. |
Uh-oh. But, fortunately this works fine as override: While trying to query cached keys this exception is thrown: So just pass to the constructor: 'statsKey' => null |
Like mentioned in https://github.com/phalcon/docs/blob/master/en/api/Phalcon_Cache_Backend_Memcache.rst the Memcached cache backend stores all keys it manages in a key called _PHCM.
Memcached items are limited to 1 MB by default and the Memcached docs state that it is not safe to increase this value.
However, since Phalcon stores all keys in _PHCM, on high traffic applications this item grows quickly. On our application we're using the Memcached adapter to store user sessions and since we have some traffic on our site, within a few hours we have 60k sessions and the _PCHM item grows to about 4mb.
Phalcon should avoid this by not storing the keys in one item, giving up the ability to query all keys but being failsafe.
The text was updated successfully, but these errors were encountered: