My Umbraco website is slow the first time a user visits the website after the app pool is recycled. This is because probably nothing is cached yet. I've used SQL Server Profiler to see what happens if a user visits a page for the first time after the app pool is recycled. Most queries are about loading the marco's which are on the website. After the user refreshed the page only my own queries where executed because the marco's are probably cached now. Is there a way to cache the macro's before the user visits the page for the first time? For example could I load them in a loose thread which I start on the application_start event (ApplicationBase in this case). This way all the macro's could be cached even the ones which aren't on the page the users visits.
Is this possible and if so how can I cache macro's (and more if possible) in C#?
how would you want to accomplish this? you'd have to check every page for a macro and cache the rendering of the macro? why not wait until a first page load for each macro to be cached? also, you'd have to rebuild the macro caches on each page publish as well as caches are invalidated after a page publish.
Sounds like a lot of overhead for what umbraco does out of the box.
Ok that does sounds like a lot of work (hoped it would be easier). Currently the website is slow for the first visitor because nothing is cached. Just hoped there would be a way to make it fast even for the first user who visits the website.
well, maybe you could add something similar as the ping.aspx service and have a "task" visit all of the pages after a app pool recycle, altho may be difficult to know when you're app pool will be recycled.
The website is slow for the first user for nearly all ASP.Net websites. This is due to the compilation that needs to occur in ASP.Net. Your DLL/ASPX files in your web app actually get compiled down further and run in memory. there's a ton of info on this on the net. Also make sure that you don't have compilation debug = true!
Yes, umbraco may not have things cached yet but I would assume that for the most part this 'slowness' is just how ASP.Net handles things. Precompilation could help:
I've got almost the same problem but my problem is mainly with the backend (there isn't much going on in frontend yet, it's a test or Umbraco is something for us).
If i kill the w3wp.exe and startup the website is ok, if i go to Umbraco everything is fine also but then with the first publish it takes 214 seconds to publish (and w3swp.exe takes 50% cpu). It has to do something with the cache because the second publish is fast after that.
All the backend events are disabled, i run Umbraco 7.11.1 with 3074 nodes, the Umbraco.config file is 1,467kb big.. hopefully somebody can help because this is a really major thing if we want to use Umbraco!
Umbraco website slow after app pool is recycled
Hello,
My Umbraco website is slow the first time a user visits the website after the app pool is recycled. This is because probably nothing is cached yet. I've used SQL Server Profiler to see what happens if a user visits a page for the first time after the app pool is recycled. Most queries are about loading the marco's which are on the website. After the user refreshed the page only my own queries where executed because the marco's are probably cached now. Is there a way to cache the macro's before the user visits the page for the first time? For example could I load them in a loose thread which I start on the application_start event (ApplicationBase in this case). This way all the macro's could be cached even the ones which aren't on the page the users visits.
Is this possible and if so how can I cache macro's (and more if possible) in C#?
Jeroen
how would you want to accomplish this? you'd have to check every page for a macro and cache the rendering of the macro? why not wait until a first page load for each macro to be cached? also, you'd have to rebuild the macro caches on each page publish as well as caches are invalidated after a page publish.
Sounds like a lot of overhead for what umbraco does out of the box.
Just my 0.02 cents.
Cheers,
/Dirk
Ok that does sounds like a lot of work (hoped it would be easier). Currently the website is slow for the first visitor because nothing is cached. Just hoped there would be a way to make it fast even for the first user who visits the website.
Jeroen
well, maybe you could add something similar as the ping.aspx service and have a "task" visit all of the pages after a app pool recycle, altho may be difficult to know when you're app pool will be recycled.
I could try that :). The app pool recycle could be a bit difficult. Sounds like a nice idea for a package :).
Jeroen
The website is slow for the first user for nearly all ASP.Net websites. This is due to the compilation that needs to occur in ASP.Net. Your DLL/ASPX files in your web app actually get compiled down further and run in memory. there's a ton of info on this on the net. Also make sure that you don't have compilation debug = true!
http://aspnetresources.com/articles/debug_code_in_production
http://weblogs.asp.net/scottgu/archive/2006/04/11/442448.aspx
Yes, umbraco may not have things cached yet but I would assume that for the most part this 'slowness' is just how ASP.Net handles things. Precompilation could help:
http://msdn.microsoft.com/en-us/library/bb398860.aspx
And you can also try running your compilation in batch mode:
http://geekswithblogs.net/shahed/archive/2006/11/16/97240.aspx
@Shannon: great set of resources, thanks for sharing, i'll bookmark them
I've got almost the same problem but my problem is mainly with the backend (there isn't much going on in frontend yet, it's a test or Umbraco is something for us).
If i kill the w3wp.exe and startup the website is ok, if i go to Umbraco everything is fine also but then with the first publish it takes 214 seconds to publish (and w3swp.exe takes 50% cpu). It has to do something with the cache because the second publish is fast after that.
All the backend events are disabled, i run Umbraco 7.11.1 with 3074 nodes, the Umbraco.config file is 1,467kb big.. hopefully somebody can help because this is a really major thing if we want to use Umbraco!
Anybody?
is working on a reply...