So all my background tasks Craft 3.2.6 seem to process ok except deleting stale template caches. Although craft is supposed to fail after 5 minutes, it fails instantly and the error log shows

Allowed memory size of 1610612736 bytes exhausted (tried to allocate 380928 bytes) 

Server settings for memory are 512M and 300 second timeout. The error is instant - in that the error log is immediately populated on saving an entry - which makes me think that this is not the real problem. The server is running Nginx as a reverse proxy for apache and uses microcaching and I wonder if this might interfere with that one task? Its a multisite with 8 languages and I guess quite heavy on the fields and image processing. How can I debug this further - short of giving the whole dedicated box memory to this one site?


Anything in queue.log that gives us hints? Anyway if it is just the stale template caches task... I'd just truncate the cache tables manually (n.b.: truncate, not delete):


You only need to truncate that one cache table, because it'll cascade can remove the other related columns in templatecacheelements and templatecachequeries as well.

Then I'd truncate the queue table as well to remove the no longer needed stale template cache queue jobs.

Learn more:

  • Yikes - my templatecachequeries table was 3GB.Not sure how it got that outta hand but emptying queue table wasn't sufficient. I'd all but removed cache tag too. Once i cleared that all seems to be sweet – joomkit Jul 24 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.