colinmollenhour / Cm_Cache_Backend_Redis

A Zend_Cache backend for Redis with full support for tags (works great with Magento)
Other
387 stars 143 forks source link

`_removeByMatchingTags` out of memory with large number of matching entries #183

Open michielroding opened 2 months ago

michielroding commented 2 months ago

When calling Cm_Cache_Backend_Redis::clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, ['bla']) this runs out of memory when there are a large number of entries.

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 33554440 bytes) in /…/vendor/colinmollenhour/credis/Client.php on line 1353

v1.17.1

We could of course increase the memory limit but it'll fail eventually; would it be possible to do this in batches, or via a Lua script?