Jump to Section
The Issue: Severe Umbraco Performance Degradation#
After updating to Umbraco 13.4.1, we observed significant performance issues, especially when publishing and unpublishing documents.
Our Umbraco system, managing around 325,000 documents, encountered ultra-slow operations and frequent database lock errors.
These issues made the Umbraco CMS unusable for our editors.
Symptoms and Initial Observations in Umbraco
- Sluggish Operations: Publishing and unpublishing processes within Umbraco were extremely slow.
- Database Lock Errors: These errors frequently occurred, causing significant disruptions in the Umbraco workflow.
- Upgrade Challenges: The installation process was unusually lengthy, and the Umbraco site required a manual restart to function normally.
Investigation and Troubleshooting in Umbraco#
Identifying the root cause within Umbraco was not straightforward.
We tried multiple strategies to pinpoint the problem:
- Disabling Nucache Local DB: This was an attempt to mitigate caching-related issues in Umbraco.
- Rebuilding Caches and Indexes: We forced a rebuild of both the database/memory cache and database indexes in Umbraco.
- Disabling Custom Handlers: We temporarily disabled all custom handlers, such as ContentPublishingNotificationHandler in Umbraco.
- Reducing Background Processes: Features like DeliveryApi, Webhooks, and the Content Cleanup Hosted Service were disabled to minimize background load in Umbraco.
You can check more details in initial issue #16803 reported to Umbraco HQ.
🛠️ Hey @umbraco ! Could you please review and merge this critical performance fix into the Umbraco CORE?
— Piotr Bach👨💻 (@piotrbachtech) July 30, 2024
PR: https://t.co/7EB3f8c4Rm
More details here: https://t.co/Ckj0zcV8Sg
It's super important for #umbraco13 users! 🙏
Thank you in advance! ❤️#performance
Despite these measures, the problem persisted, indicating a deeper issue within the core Umbraco code.
Regression Bug and Fix#
After a thorough investigation, we discovered a regression bug introduced in a previous Umbraco update.
The critical flaw was the absence of a WHERE clause in specific SQL count queries, which significantly led to operations miscounting records.
This issue was particularly problematic in Umbraco systems with a large content volume.
We created a pull request #16837 to address this issue.
The fix added the missing WHERE clause, significantly improving the performance of publish/unpublish operations in Umbraco.
The solution was tested on databases with over 320,000 nodes, ensuring it addressed the issue comprehensively.
Here is an example of the T-SQL query that was problematic:
The lack of proper filtering in this query caused severe performance issues in our large-scale Umbraco setup.
As a result, the QueryPaged method (located in NPocoDatabaseExtensions.cs) had to iterate over 324,324 items instead of two, due to the incorrect sqlCount query.
This method executes during application cache refresh operations, such as after publish or unpublish actions:
Conclusion: Update Your Umbraco to a Fixed Version#
If you're using Umbraco 13.4.1 and experiencing similar issues, you must update to a version that includes this fix.
Regular updates provide new features and fix critical bugs impacting your system's usability and performance.
Be aware the problem affects Umbraco v10, v13 and v14, so it's recommended to upgrade to the latest version containing the fix.
What's Next?#
Looking for Umbraco experts to help optimize your CMS or resolve issues?
Contact us today!
Our experienced team is ready to assist you with all your Umbraco needs.
Let's ensure your website performs at its best.