? Success

User tests: Successful: Unsuccessful:

avatar creativeprogramming
creativeprogramming
12 Mar 2016

Probably it was just a typo/versioning issue, as the rest of code to get the lifetime from the configuration and to convert it in seconds was already in the method: but the setex call was hardcorded to expire in 1h (3600s).

Regards

avatar creativeprogramming creativeprogramming - open - 12 Mar 2016
avatar creativeprogramming creativeprogramming - change - 12 Mar 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Mar 2016
Labels Added: ?
avatar creativeprogramming
creativeprogramming - comment - 12 Mar 2016

Anyway i think also the logic above to get the lifetime from conf needs a little review: maybe you can get rid of theifblock and of the ->get() as $this->_lifetime it's already set in the parent class constructor, and other cache storages are relying just on that (except memcache.php that is doing like this one). Anyway in the parent class there isn't any ->get() defaulting to 15mins, and maybe it should be.

Best Regards

avatar brianteeman brianteeman - change - 12 Mar 2016
Title
Redis cache storage: set expiration time to match the configured cache lifetime
Redis cache storage: set expiration time to match the configured cache lifetime
avatar brianteeman brianteeman - change - 12 Mar 2016
Category Cache
avatar creativeprogramming
creativeprogramming - comment - 13 Mar 2016

warn: after testing in production with 50k uniques a day and many pages to cache, with a cache expiration time of 48h i'm getting memory exausted error in the clean() method

the clean function is using KEYS * command to get all the redis saved keys and then a foreach to issue single delete commands (filtering them by the joomla cache key pattern at this time)..

The KEYS command fails allocating more of 128MB of data (my php.ini limit)

So now i understand why this limit was hardcoded to 1h.

Maybe we should make possible to use FLUSHDB instad of KEYS+DELETEs, this should be selected with a configuration variable, just for who want to use a single redis db dedicated to the Joomla cache only...

avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Mar 2016

not expert in redis, but IMHO even if problems exist, i think it should still respect the lifetime defined by the user in the control panel, in other words, it shouldn't be hardcoded.

Anyway i think also the logic above to get the lifetime from conf needs a little review: maybe you can get rid of the if block and of the ->get() as $this->_lifetime it's already set in the parent class constructor, and other cache storages are relying just on that (except memcache.php that is doing like this one).

i think so too.

Anyway in the parent class there isn't any ->get() defaulting to 15mins, and maybe it should be.

in parent class is set to 0 i think. Since the installer set it to 15 by default i think it should be 15 too.
See https://github.com/joomla/joomla-cms/blob/staging/installation/model/configuration.php#L119

avatar brianteeman
brianteeman - comment - 27 Mar 2016

Closing as this has been addressed in a larger rewrite of cache see #9622

avatar brianteeman brianteeman - change - 27 Mar 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-03-27 19:14:45
Closed_By brianteeman
avatar brianteeman brianteeman - close - 27 Mar 2016

Add a Comment

Login with GitHub to post a comment