Dave Burke : Freelance .NET Web Developer specializing in Online Communities

CS Nuglet: Ratchet back the Cachefactor

Extensive caching is one of the reasons Community Server rocks and scales out the ying-yang for sites like Dell, MSNBC, Microsoft and MySpace.  But for off-the-highway sites like DBVT.COM CS Caching can be annoying, especially in CS 2007.1 where something happened and we've got Cache Extremo.  "Oh darn, there's an error in that post I just published.  Better touch the web.config before the cached post with the error goes out to 100 subscribers."  Word!

I've found peace with Community Server caching by ratcheting back the Cachefactor Core setting in the CommunityServer.config file from 5 as the default to 2 without seeing any performance issues at all.  It really makes a difference in post updates appearing more quickly.

The title of this nuglet was going to be "Dr. Strangelove or How I Learned to Stop Worrying and Love Community Server Caching."  But it was a little long and I got to use the word "Ratchet" instead, which is always a grammatical pleasure for me.

Comments (6) | Post RSS RSS comment feed

Posted on 2/2/2008 7:26:25 PM by Dave Burke
Categories: Community Server

Related posts

Comments

2/3/2008 7:19:49 PM Permalink

I just wrote a cs module that clears the cache when a blog post is created or edited.

Blake Niemyjski |

2/3/2008 7:45:13 PM Permalink

Hi, Blake!  Thanks for your comment. I visited your site but couldn't find it.  What cache does it clear, on the weblogpostlist, weblogpost or something else?  

daveburke |

2/3/2008 9:02:32 PM Permalink

yea, Its not on my site, I'm going to release a module pack soon. I have you on msn, so feel free to hit me up. I dug into the cs core code and theres no real *good way* of figuring out the cachekey. So I just cleared the whole cache if the post being updated was a weblogpost. :\ I have some of the remove by pattern code figured out. If you would like to take over what i have done just send me an im. and I'll give you my code Smile.

Blake Niemyjski |

2/3/2008 11:45:36 PM Permalink

Caching is great...up to a point.  If the server starts running low on RAM (imagine a webserver running several SharePoint sites), anything you cache will just get bumped from memory.  The problem with cache is its affinity to a server.  You need to make sure your load balancer always redirects a user to the same server in a farm environment.  I wonder if MS has plans to "providerize" the ASP.NET cache or allow some kind of distributed caching like memcached?

Vince |

2/4/2008 5:23:25 AM Permalink

Hey, Blake.  For my needs I'm good with the CacheFactor being lowered, but thanks!

Vince, you're right.  Caching does have its downside.  Thanks for pointing that out.  I know there have been problems with some hosted environments because CS's RAM footprint exceeds 100MBs which causes the app pool to recycle frequently.  That's a lot of caching...  

daveburke |

2/9/2008 6:06:28 PM Permalink

For low load sites I usually set the cacheFactor to 1, but the cacheFactor isn't what drives most of what you guys are talking about.  If I remember correctly, the cacheFactor pertains mainly to the User context and similar items.  It is actually the Task timers that control the majority of what you are talking about.  Again, on low load systems I set the Task thread timers to 1 minute each, which ensures that everything is processed every minute.

Bill Bosacker |

Comments are closed

Copyright © 2008 Dave Burke Consulting  |  All Rights reserved.