User tests: Successful: Unsuccessful:
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
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Title |
|
Category | ⇒ | Cache |
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...
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
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-27 19:14:45 |
Closed_By | ⇒ | brianteeman |
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 (exceptmemcache.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