3

I have a multi-site Sitecore instance (Sitecore 8.2), and one of the sites is very slow to load. I enabled Pipeline profiling, and saw that the httpRequestBegin pipeline is taking a large majority of the time, more specifically the Sitecore.Pipelines.HttpRequest.EnsureServerUrl processor. The most I could find about what that processor does was from this link, which only says:

EnsureServerUrl (Kernel): Ensures that Sitecore.Globals.ServerUrl has a value.


Does anyone have a better idea of what the EnsureServerUrl processor does and what could cause it to become so slow? Or is there any way I can further debug that specific pipeline to see what is causing the problem?

  • EnsureServerUrl does nothing more than setting the server url in a global viariable: WebUtil.GetServerUrl(args.HttpContext.Request.Url, false) where the GetServerUrl just does some string manipulations. No idea why this would be slow... – Gatogordo Aug 8 '18 at 18:14
  • Put dotTrace on it. That processor is a false flag. – Mark Cassidy Aug 8 '18 at 18:57
  • 1
    The only thing I could see is this pipeline eventually calls (in the Sitecore.Globals.ServerUrl setter) the method Sitecore.Web.WebUtil.GetHostIPAddress(). If you have Sitecore PowerShell Extensions installed, you can try calling [System.Net.Dns]::GetHostEntry(problematicSiteHostName) in a console on the server to see if this is delaying things. I would also check the log for warnings. – maz Aug 8 '18 at 19:42
  • @maz I haven't seen anything in the logs, but I'll have to see what that PowerShell call says. Thanks! – Alex Aug 8 '18 at 19:49
4

This ended up being a DNS issue; the site name was not being resolved properly. I took @maz's advice and called [System.Net.Dns]::GetHostEntry("siteHostName") in PowerShell (I didn't have Sitecore PowerShell Extensions installed, so I just called it from PowerShell on the server). It took about 4-5 seconds and then the call would error out, and that was about the same amount of time as the EnsureServerUrl processor was taking according to the Pipeline profiling results.


Side note: Despite my last comment, there did end up being a warning in the logs for this issue. It only warns once for the exception, so it can be easy to miss and it may not be in every log file. The message displayed in the logs is Cannot resolve the IP address of the web server with the specified hostname:

| improve this answer | |

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.