I've been having an issue lately when trying to save products in Magento, we run into a max execution time error. The error gives one of two lines that it errors out on, either:

$ids = $ids + $this->_getTagIds($tag);


return explode("\n", $ids); - which is within the function _getTagIds

within the file /lib/Mage/Cache/Backend/File.php

Does anyone know where to begin troubleshooting this? This didn't happen before about a week ago. I've been bumping up the max_execution_time to see what the limit is but haven't reached it yet and putting an excessive max_execution_time on the server isn't a great solution. Additionaly, this product that I'm trying to save has no tags associated with it, so there shouldn't be an overload getting tag IDs for the product.

  • What server you are using?? Is it sufficient to run magento? Please reindex magento tables. and do mysql reindex. Seems, you need to enable mysql_slow_query. then, we can find which query is taking time to run. all the best. Write back, I will try my best.
    – Sundar
    Nov 5, 2014 at 17:13
  • The server that we're running is a VPS with nothing else on it and we haven't had any other issues for the past 10 months or so running Magento on it. I'm getting with my server people right now to check on the mysql reindex.
    – Eric Strom
    Nov 5, 2014 at 17:17
  • Sounds good.. Tell them to turn on the "log_slow_query" setting. Let me know if any lucks.
    – Sundar
    Nov 5, 2014 at 17:21

2 Answers 2


This has nothing to do with tags, as in words classifying a thing. These are cache tags. What you are seeing is a slow filesystem. Either because it is stuffed with a tremendous amount of files, or because the virtualized or networked filesystem is underperforming. Products always have cache tags associated with them. This typically happens in the cart, when the stock is modified, all product, catalog, upsell, cross-sell and blocks/pages like that are purged from the cache. The product has a cache tag, the category or categories it's part of also has that product's cache tag, etc. This is how the purging is done.

If you switch to a faster cache storage like Redis, you will not have this problem or if you fix whatever is slowing down the filesystem.


The Problem you see may be misleading.

max execution time does not error on the problematic point, it does error where it reaches the limit. Means the problem is very likely not related to the _getTagIds() function. On product save the long running part is often the index update, which can especially for the url rewrite very heavy. So set the index mode to manual.

Next use general profiling solutions to identify the long running and time consuming parts.

For further Advices you need to provide some more informations.

  • php Version
  • opcache
  • max execution time
  • number of products

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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