What is the best way to have Orchard always responsive?

Topics: Administration, Core, Customizing Orchard, Installing Orchard, Troubleshooting, Writing modules
Nov 18, 2013 at 4:59 PM
What would be the best way to (almost?) always have a near-instant hit on any Orchard site?

I've seen that using application initialization is not really a good idea: https://orchard.codeplex.com/workitem/20287

Setting "Idle timeout" on the application pool to 0 is not a good idea either..

We enabled the Warmup module. But does it get triggered everytime the application pool recycles? And is that even enough? Won't there be other cases where the site will not warmup?
Nov 19, 2013 at 10:24 AM
Setting up the app pool not to time out is not a bad idea I think as far as the app pool is recycled periodically nevertheless (like every day once when you expect the least traffic). But this also depends on how much memory you have and how many resources you're willing to spare generally: if a lot, then recycling can only happen occasionally (Orchard isn't supposed to have any memory leaks or deadlocks so theoretically if the third party modules are also right you wouldn't need to recycle the app pool at all for normal operation).

The Warmup module should solve the issue of slow page loads when the app pool starts. It's kind of a limited workaround though, as it will cache only specific pages (so the users won't notice anything when opening the front page for example, but will experience the delay when calling up some less popular subpage). FYI IIS also has some warmup features built in already, take a look.
Nov 19, 2013 at 10:27 AM
Thanks for the reply.
I see what you mean there.

However, I was thinking: Would it be possible to create 1 single page (maybe a simple controller action) that will hit and fill all caches Orchard uses?
For example, when I click a certain page, it will load relatively slow. When I click it again; it will load instantaneously. It would be very cool to be able to have the warmup trigger all these caches, so they don't have to be built at the moment the user wants to view the page.

That's why warmup exists, right?
Nov 19, 2013 at 10:40 AM
For normal operation you have OutputCache for speeding up subsequent page loads (to them being instantaneous).

You could also hook up Warmup to page loads: i.e. if a page requested it automatically gets added to the configuration of Warmup. This is entirely possible e.g. from an IResultFilter and could be quite interesting. However you also have to take care to remove pages from the list of pages to be warmed up if they are very infrequently visited (unless you want to have possibly thousands of pages periodically fetched by Warmup and stored in App_Data, what can possibly negatively impact the overall performance of the site).