Magento 2.4.8-p3 Backend Categories Slow? A Community-Confirmed Solution for Large Catalogs

Addressing Magento 2.4.8-p3 Backend Category Loading Issues for Large Catalogs

For e-commerce merchants and developers managing extensive product catalogs on Magento, backend performance is paramount. A recent GitHub issue highlighted a critical problem for users updating to Magento Open Source or Adobe Commerce 2.4.8-p3: the backend Catalog > Categories section failing to load, presenting an endless spinner.

The Problem: Slow Category Loading Post-Update

The issue, reported by vincentwennink, specifically occurred after an update from Magento 2.4.7-p8 to 2.4.8-p3. The user's environment featured a substantial catalog of over 150,000 products and 800+ categories, a common scenario for growing businesses. The 'Categories' grid in the admin panel simply wouldn't load, indicating a significant performance bottleneck.

Identifying the Root Cause

The original reporter quickly pinpointed the source of the slowdown to the loadProductCount() function within vendor/magento/module-catalog/Model/ResourceModel/Category/Collection.php. This function, responsible for retrieving product counts for categories, was executing an excessively long query. The issue seemed to stem from a change in the conditional logic around if ($countAnchor) { between the two Magento versions. Reverting this specific code block to its 2.4.7-p8 state immediately resolved the loading problem for the reporter:

if ($countAnchor) {
    // Retrieve Anchor categories product counts
    $categoryIds = array_keys($anchor);
    $countSelect = $this->getProductsCountQuery($categoryIds, (bool)$websiteId);
    $categoryProductsCount = $this->_conn->fetchPairs($countSelect);
    foreach ($anchor as $item) {
        $productsCount = isset($categoryProductsCount[$item->getId()])
            ? (int)$categoryProductsCount[$item->getId()]
            : $this->getProductsCountFromCategoryTable($item, $websiteId);
        $item->setProductCount($productsCount);
    }
}

The Community Solution: Quality Patches to the Rescue

The Magento community quickly chimed in, with hostep pointing out that this issue resonated with previously reported problems (issues #39829 and #39584) concerning slow category loading in the admin. Crucially, an official fix for these related issues was already slated for release in Magento 2.4.9, identified as "ACP2E-3891: Categories in admin are loading very slow."

More importantly, this fix was also available as a Quality Patch under the name ACSD-65848. Quality Patches are invaluable for Magento users, offering targeted fixes for specific bugs before they are officially integrated into a full release. This allows merchants and developers to address critical issues without waiting for a major version update.

Upon suggestion from the community and Adobe Commerce team member engcom-Bravo, the original reporter applied the ACSD-65848 patch. The result was a definitive success:

vendor/bin/magento-patches apply ACSD-65848

This command successfully applied the patch, resolving the backend category loading issue.

Key Takeaways for Magento Users

  • Stay Informed on Quality Patches: For critical performance or functionality issues, always check the Magento Quality Patches repository. They often provide immediate relief for problems identified in newer versions.
  • Large Catalog Considerations: Magento's performance can be significantly impacted by catalog size. Be vigilant for issues related to product counts, indexing, and collection loading, especially after updates.
  • Community Collaboration is Key: GitHub issues are not just for reporting bugs; they are a vital hub for community-driven solutions and workarounds.

This incident underscores the importance of proactive monitoring and leveraging the Magento community and official resources like Quality Patches to maintain optimal store performance, particularly after critical system updates.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools