CPU time quota exceeded in Azure WebSite

Topics: Troubleshooting
May 9, 2013 at 3:39 AM
Hello, i use Azure website to host my orchard deployment. It works for a while and after some times (couple of weeks), page rendering became very slow. Orchard use so much CPU that it exceed the CPU quota of 2.5 minutes in 5 minutes.

I use WebMatrix to get the log and when this problem occurs, i see many of these errors happening (every 2 or 3 seconds)
2013-05-09 02:28:15,545 [40] Orchard.DisplayManagement.Implementation.DefaultDisplayManager - RuntimeBinderException thrown from Action`1 by System.Action`1[[Orchard.DisplayManagement.Implementation.ShapeDisplayingContext, Orchard.Framework, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null]]
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Orchard.ContentManagement.ContentItem' does not contain a definition for 'ContentItem'
   at lambda_method(Closure )
   at ClaySharp.ClayBehavior.GetMemberMissing(Func`1 proceed, Object self, String name) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehavior.cs:line 17
   at Orchard.ContentManagement.ContentItemBehavior.GetMemberMissing(Func`1 proceed, Object self, String name) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\ContentItemBehavior.cs:line 14
   at ClaySharp.ClayBehaviorCollection.<>c__DisplayClass38.<>c__DisplayClass3a.<GetMemberMissing>b__37() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 53
   at ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13
   at ClaySharp.ClayBehaviorCollection.GetMemberMissing(Func`1 proceed, Object self, String name) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 53
   at lambda_method(Closure )
   at ClaySharp.ClayBehavior.GetMember(Func`1 proceed, Object self, String name) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehavior.cs:line 8
   at ClaySharp.ClayBehaviorCollection.<>c__DisplayClass2.<>c__DisplayClass4.<GetMember>b__1() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 17
   at ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13
   at ClaySharp.ClayBehaviorCollection.GetMember(Func`1 proceed, Object self, String name) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 17
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at CallSite.Target(Closure , CallSite , Object )
   at Orchard.Core.Shapes.CoreShapes.<Discover>b__91(ShapeDisplayingContext displaying) in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Core\Shapes\CoreShapes.cs:line 103
   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.<>c__DisplayClassc.<Execute>b__3(Action`1 action) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 68
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in c:\Users\sebros\My Projects\Orchard\src\Orchard\InvokeExtensions.cs:line 17
This problem occurs with my custom theme and with The Theme Machine. I don't think that the problem is related to the content because i'm able to create a new azure website and then update the config to use the same content database and it's running ok. I've got this problem on a site using a local DB and on a site that use a SQL Azure DB.

Any idea what could be the problem?
May 9, 2013 at 3:11 PM
You are not the only one. ;) Ive not had time to test the causes yet though.
I had to turn off periodic updates on the warm up module. - Every time that ran it killed it (7 pages - exceeding the cpu time). I think the source of the problem was taxonomies (I really need to test the newer version of it).

Clay has been removed now too (i think) in post 1.6.x (for version 1.7) branch. This makes rendering pages quicker and probably reduces cpu abit. I will be testing it out on azure, but i'm quite busy till next weekend so wont get the time to test it out mostly likely.

My knowledge of clay wont be able to decipher what this error message means though. Hopefully someone else can lend a hand there. Are you using
May 9, 2013 at 3:55 PM
Thank you Matt! Glad to see that i'm not alone with my problem. I will try to get some time to deploy 1.7 on azure websites and will reply my observation here.
May 9, 2013 at 6:26 PM
Edited May 9, 2013 at 6:41 PM
Interested by your feedback on pre 1.7 on Azure Web Sites, relativelly to
https://orchard.codeplex.com/workitem/19679
Coordinator
May 9, 2013 at 7:37 PM
When working with limited hosting plans such as the entry-level Azure plans, it's crucial that you enable caching (so it is crucial that caching works properly, of course...).