We have a load balanced environment for hosting our umbraco website.
We have followed the documentation about that and configure the servers as the documentation says.
But, we are having important performance issues that we do not have on a standalone (staging) environment.
We have made an analisys about the server logs and we can see that the static files are beeing served by a worker thread rather than a io thread so static files are beeing processed by umbraco rather than iis.
Here we have the logs:
0:030> !aspxpagesext -n
Address Completed Timeout Time (secs) ThreadId ReturnCode Verb Url
AS 000001f231b32b58 no 0s 7 200 GET /media/10969/ico-cheques-en-divisas-2x.png
AS 000001f231bcdbf8 no 0s 5 200 GET /media/18999/dk-cabecera-efectivo-min.jpg
AS 000001f32e03e0d0 no 0s 5 200 GET /media/19000/dk-cabecera-pagos-min.jpg
AS 000001f32e25f220 no 0s 4 200 GET /media/19001/dk-cabecera-pasarelas-de-pago-min.jpg
15 contexts found (6 displayed).
AS == possibly async request
SL == session locked
With the first request, it is looking for a file (Thread 30):
IIS Worker Tread for static files
Hi,
We have a load balanced environment for hosting our umbraco website. We have followed the documentation about that and configure the servers as the documentation says. But, we are having important performance issues that we do not have on a standalone (staging) environment.
We have made an analisys about the server logs and we can see that the static files are beeing served by a worker thread rather than a io thread so static files are beeing processed by umbraco rather than iis.
Here we have the logs:
0:030> !aspxpagesext -n Address Completed Timeout Time (secs) ThreadId ReturnCode Verb Url AS 000001f231b32b58 no 0s 7 200 GET /media/10969/ico-cheques-en-divisas-2x.png AS 000001f231bcdbf8 no 0s 5 200 GET /media/18999/dk-cabecera-efectivo-min.jpg AS 000001f32e03e0d0 no 0s 5 200 GET /media/19000/dk-cabecera-pagos-min.jpg AS 000001f32e25f220 no 0s 4 200 GET /media/19001/dk-cabecera-pasarelas-de-pago-min.jpg 15 contexts found (6 displayed). AS == possibly async request SL == session locked
With the first request, it is looking for a file (Thread 30):
0:030> kc # Call Site 00 ntdll!ZwQueryDirectoryFile 01 KERNELBASE!FindFirstFileExW 02 KERNELBASE!FindFirstFileW 03 SystemWebni 04 SystemWebni!System.Web.Util.FindFileData.FindFile 05 SystemWebni!System.Web.DirectoryMonitor.AddFileMonitor 06 SystemWebni!System.Web.DirectoryMonitor.StartMonitoringFileWithAssert 07 SystemWebni!System.Web.FileChangesMonitor.StartMonitoringPath 08 SystemWebni!System.Web.Caching.CacheDependency.Init 09 SystemWebni!System.Web.Caching.CacheDependency..ctor 0a SystemWebni!System.Web.CachedPathData.GetConfigPathData 0b SystemWebni!System.Web.HttpContext.GetFilePathData 0c SystemWebni!System.Web.Configuration.RuntimeConfig.GetConfig 0d SystemWebni!System.Web.HttpContext.SetImpersonationEnabled 0e SystemWebni!System.Web.HttpApplication.AssignContext 0f SystemWebni!System.Web.HttpRuntime.ProcessRequestNotificationPrivate 10 SystemWebni!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper 11 SystemWebni!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification 12 SystemWebni 13 clr!UM2MThunkWrapperHelper 14 clr!UM2MThunkWrapper 15 clr!Thread::DoADCallBack 16 clr!UM2MDoADCallBack 17 clr!UMThunkStub 18 webengine4!W3MGDHANDLER::ProcessNotification 19 webengine4!ProcessNotificationCallback 1a clr!UnManagedPerAppDomainTPCount::DispatchWorkItem 1b clr!ThreadpoolMgr::ExecuteWorkRequest 1c clr!ThreadpoolMgr::WorkerThreadStart 1d clr!Thread::intermediateThreadProc 1e kernel32!BaseThreadInitThunk 1f ntdll!RtlUserThreadStart
This file is located in a Azure Storage drive:
000000d9`1c6fde08 struct UNICODESTRING PathName = "\??\UNC\ibeumbblob.file.core.windows.net\iisfarm\Data\media\"
0:030> !syncblk Index SyncBlock MonitorHeld Recursion Owning Thread Info SyncBlock Owner 382 000001f45549d658 3 1 000001f4513bfb70 109c 30 000001f32c0a9e08 System.Web.DirectoryMonitor
0:023> !ck2 -l DbgId ThreadId Apartment Kind CLR GC Mode GC Suspending? 23 1014 MTA Worker v4.7.3468.00 Preemptive no
Lock
Method System.Web.DirectoryMonitor.StartMonitoringFileWithAssert(System.String, System.Web.FileChangeEventHandler, System.String) Object 0x000001f32c0a9e08 Owner Thread 1 109c
SP IP Function 000000d9193bdb68 0000000000000000 GCFrame 000000d9193bdd80 0000000000000000 GCFrame 000000d9193bddb8 0000000000000000 HelperMethodFrame [System.Threading.Monitor.Enter(System.Object)] 000000d9193bdeb0 00007ffb0e6da54e System.Web.DirectoryMonitor.StartMonitoringFileWithAssert(System.String, System.Web.FileChangeEventHandler, System.String) 000000d9193bdf20 00007ffb0e6dc49c System.Web.FileChangesMonitor.StartMonitoringFile(System.String, System.Web.FileChangeEventHandler) 000000d9193bdfb0 00007ffb0e6dc1d6 System.Web.Configuration.WebConfigurationHost.StartMonitoringStreamForChanges(System.String, System.Configuration.Internal.StreamChangeCallback) 000000d9193be010 00007ffb1c9326fe System.Configuration.BaseConfigurationRecord.MonitorStream(System.String, System.String, System.String) 000000d9193be0a0 00007ffb1c931a0d System.Configuration.BaseConfigurationRecord.InitConfigFromFile() 000000d9193be170 00007ffb1c930557 System.Configuration.BaseConfigurationRecord.Init(System.Configuration.Internal.IInternalConfigRoot, System.Configuration.BaseConfigurationRecord, System.String, System.String) 000000d9193be290 00007ffb1c937d7c System.Configuration.RuntimeConfigurationRecord.Create(System.Configuration.Internal.InternalConfigRoot, System.Configuration.Internal.IInternalConfigRecord, System.String) 000000d9193be2e0 00007ffb1c9311dc System.Configuration.Internal.InternalConfigRoot.GetConfigRecord(System.String) 000000d9193be390 00007ffb1c94627a System.Configuration.Internal.InternalConfigRoot.GetUniqueConfigRecord(System.String) 000000d9193be3c0 00007ffb0e6dc042 System.Web.Configuration.HttpConfigurationSystem.GetUniqueConfigRecord(System.String) 000000d9193be400 00007ffb0e6dbf53 System.Web.CachedPathData.Init(System.Web.CachedPathData) 000000d9193be450 00007ffb0e6db890 System.Web.CachedPathData.GetConfigPathData(System.String) 000000d9193be5a0 00007ffb0e6db640 System.Web.CachedPathData.GetConfigPathData(System.String) 000000d9193be6f0 00007ffb0e6f2b04 System.Web.HttpContext.GetFilePathData() 000000d9193be720 00007ffb0e6f6250 System.Web.Configuration.RuntimeConfig.GetConfig(System.Web.HttpContext) 000000d9193be750 00007ffb0e6f3b90 System.Web.HttpContext.SetImpersonationEnabled() 000000d9193be780 00007ffb0e6e6fa5 System.Web.HttpApplication.AssignContext(System.Web.HttpContext) 000000d9193be7c0 00007ffb0e6f900c System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext) 000000d9193be840 00007ffb0e6e816d System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32) 000000d9193be9e0 00007ffb0e6e7d73 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32) 000000d9193bea20 00007ffb0ede2ff2 DomainNeutralILStubClass.ILSTUBReversePInvoke(Int64, Int64, Int64, Int32) 000000d9193bebf8 0000000000000000 ContextTransitionFrame
0:030> !mex.ddt 0x000001f4`567a0078 webengine4!CMgdEngHttpModule
dt 0x000001f4`567a0078 webengine4!CMgdEngHttpModule () Recursive: [ -r1 -r2 -r ] Verbose Normal dt
+0x000 _VFNtable : 0x00007ffb
1b5e37a0 +0x008 _pFactory : 0x000001f4
567a0070 CMgdEngModuleFactory 0:030> !mex.ddt 0x000001f4`567a0070 webengine4!CMgdEngModuleFactorydt 0x000001f4`567a0070 webengine4!CMgdEngModuleFactory () Recursive: [ -r1 -r2 -r ] Verbose Normal dt
+0x000 _VFNtable : 0x00007ffb`1b5e38f8 +0x008 _Module : CMgdEngHttpModule +0x018 _ulModuleSpecificData : 0xc (0n12) +0x020 _strName : STRU 0:030> !mex.ddt 000001f4567a0070+0x020 webengine4!STRU
dt 000001f4567a0070+0x020 webengine4!STRU () Recursive: [ -r1 -r2 -r ] Verbose Normal dt
+0x000 mBuff : BUFFER +0x030 mcchLen : 0n13 (0xd) 0:030> !mex.ddt 000001f4567a0090+0x000 webengine4!BUFFER
dt 000001f4567a0090+0x000 webengine4!BUFFER () Recursive: [ -r1 -r2 -r ] Verbose Normal dt
+0x000 mrgb : [32] "U" +0x020 mpb : 0x000001f4`567a0090 "U" = UmbracoModule +0x028 mcb : 0x20 (0n32) +0x02c mfIsDynAlloced : 0y0 +0x02c m_fValid : 0y1
We do not know why UmbracoModule is present when requesting a static image file.
is working on a reply...