Wednesday, January 14, 2009

One of the things to remember before you go live


As I mentioned in one of my previous posts, it is always a good idea and common sense to block at least a week in project's timeline for load testing and performance optimization of your web site before the launch.

The performance optimization is a good topic for a separate blog and will not fit into one post BUT one of the things can be done pretty easily and give drastic performance improvements (2x and more times) for the content delivery side, also take the load of your SQL box. I am talking about database-level caching, particularly Item and Data caches.

First thing to check is the current max cache sizes of Item and Data caches on the cache statistics page, and it makes a lot of sense to perform this check while your solution is under the load testing: http://localhost/sitecore/admin/cache.aspx

If the values of "Size" column for web[data] and web[items] are approaching the "MaxSize" value, consider adjusting the values in web.config. There are no actual rules here 'cause the recommended values depend on your solution (content volume mostly). So by playing with the values, find the one that fits your needs. What will happen if your caches are maxed out? Nothing too exciting, actually. The next item information will trap into the cache but some lonely item will be evicted without two week notice.

You can find the description of cache settings here, but in nutshell, there are multiple locations where you can specify cache sizes:
1. /databases/database
2. /cacheSizes/databases
3. /settings/Caching.Default<cache_name>Size
4. value assigned in the assembly as a last try.

This is the order of processing. If any value greater than 0 is defined in a higher level, this value will be returned.

As for #3, it is important to note that some caches do not have the default cache values defined in the <settiings> section. This includes ChildCache, ParentCache and ItemCache. So if the search of the cache size falls down to #3, the value specified in code will be assigned.

As a part of the cache value assignment process, check this known issue for 5.3.x version, you may need to adjust the names of the caches. In Sitecore 6 it is not an issue.

I also want to stress that same rules are applied to other database-level and website-level caching types.

1 comments:

GRB said...

Awesome, thanks for the information. I have played around with these settings some, but nice to have a little more directed input as far as what to look for.