Thursday, October 25, 2007

The Object of My Cache

In the first post on caching I explained the output cache and how it can speed up your MOSS site. In this post I will explain the object cache. This cache comes ready to use in MOSS by default and does not require much tweaking except for the size of the cache.

Since MOSS uses SQL Server to store all the content of a site, it can get pretty expensive to make round trips to the database for each piece of content, so MOSS stores the most used objects such as document library and list fields and site navigation on the disk. This caching is very granular and is less expensive over time.

As the site administrator you can adjust the maximum disk size alloted for the object cache. The default is 100MB per site collection. In order to find the right size for this cache you will need to monitor the Sharepoint Publishing Cache in performance monitor. Keep an eye on the publishing cache hit ratio, and the total object discards counters to give you an idea of how you should adjust the cache size.

To change the size of the cache:

1. Click site actions->site settings->modify all site settings

2. Click Site Collection Object Cache

3. Change the value of Max. Cache Size and click OK.


One thing to keep in mind when using all of the different caches is that they all share the same virtual memory within the process. If you set the object cache really high that leaves less memory available for the other types of caching. If you are running on a 32-bit operating system then the W3WP process has a maximum limit of 2GB to use for the application. This 2GB also includes the space alloted to dll's and modules loaded by MOSS. A good rule of thumb for the object cache is to start at 200MB and increase it until the hit ratio is low high (< 85%). You can also test the cache by hitting the pages and seeing the response time for a user.

In the next post I will cover disk-based (BLOB) caching.

Labels: , , ,

2 Comments:

At June 16, 2008 at 8:55 AM , Anonymous Anonymous said...

Surely you mean that the cache hit ratio must be LARGER not LOWER than 85%!

 
At June 17, 2008 at 9:21 PM , Blogger Michael Markel said...

Yes, what I meant to say is that you should increase the amount of cache space if the hit count is low. The hit count should be a higher number.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home