-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Which Umbraco version are you using?
15.4.2
Bug summary
For our website Umbraco hangs over 1 minute during stratup right after "Acquired MainDom". After a pause of approx. 1 minute and 17 seconds the startup resumes and everything runs normally.
During the time there is little to no IO or sql requests, but the CPU usage is maxed out (around 20%, but could be 100% on a single core).
This started right after upgrading to 15.4.2 from 15.3.1.
I have tried troubleshooting and I believe a likely cause is in DocumentUrlService. v15.4.0 introduced a call to "ConvertToCacheModel" for the published URL's.
We have around 200.000 records in [umbracoDocumentUrl]. In ConvertToCacheModel there is a call to GetModelFromCache, which scans for a given key in an in-memory list of urls. This has complexity O(N^2) and with N=200000 this could explain why just the CPU is busy during startup.
Specifics
https://github.com/umbraco/Umbraco-CMS/blob/main/src/Umbraco.Core/Services/DocumentUrlService.cs (lines method ConvertToCacheModel.
Steps to reproduce
- (Somehow get thousands (200K) of records into table [umbracoDocumentUrl])
- Start up Umbraco as normal.
Expected result / actual result
The intended outcome is the Umbraco spends no more then 5-10 seconds in the "Acquired MainDom" stage.
What actually happens is that Umbraco appears to be hanging during startup for over 1 minute in "Acquired MainDom".