DNN Blog

Dec 14

Posted by: Charles Nurse
12/14/2007  RssIcon

This is a real story.

Yesterday shaun and I decided to look into reports that this site has been a bit slow over the last two weeks.  As usual my first reaction was to check the Exception Logs in the Event Viewer, as frequent exceptions are often a sign of major issues on the site, especially Database timeouts.

One frequent error was a message that indicated a problem with the "BlogFeed" page, in particular the URL used to return the consolidated feed.  This error was being logged about once every 10 secs.  When I saw that, I remembered that recently my RSS Reader (I use the Wizz RSS Extension for Firefox) had quite frequently been returning errors.

The Consolidated RSS feed makes a call to the Database for each request (I have discussed this with Antonio and recommended that this should be cached on a high priority).  This request calls a stored procedure that returns the 20 most recent posts (this is configurable in Module options but this site had the value set to 20).

When I used SQL Management Studio to analyse this stored procedure, this stored procedure took between 20 and 40 seconds to run.  Since we use the default SqlCommand timeout of 30 secs this means that quite a few of these databse requests were timing out.  I started using the Execution Plan and the Database Performance Tuning Wizard to try and figure out a better performing query.  Both of these tools basically had no recommendations short of removing information from the returned set of columns, so the clever guy in me said - If 20 requests take ~30 secs then 10 requests will take ~15 secs.

Was I wrong - reducing the number to 10 made the query take 1-2 secs.  Wow.  why such a huge difference.  I investigated further and found that 12 requests took 1-2 secs but 13 took 30-40 secs.

What was special about the 13th Blog.  This Blog was Phil's blog with a table on the different CMS systems.  The problem with this blog is that Phil copied a fairly large Excel Spreadsheet and pasted it into the HTML Editor.  Unfortunately MS Office products when they "create" html versions of their text add a huuuuge ammount of style tags.  This huge ammount of text is being returned as part of the query used for the RSS Feed and obviously takes about 30 secs.

So the solution I used was to reduce the setting on this site to return 10 blogs so that this blog would not be included.  Instead of seeing an error (due to DB timeouts) every 5-10 secs we now see maybe 1 every 15 mins.

Please: Don't get me wrong.  I have used Phil's blog as an example because it tells a story.  I found the content of the Blog very instersting and I know he struggled with how to publish the information.

The moral of this story is that simple (and unexpected things) can be impacting site performance.  Because of this large Blog, a query that is called more than 10 times a minute, takes about 30 secs to run, and will seriously impact site performance as other queries get less CPU time in the database.  A second moral of this story is that this content should have been cached - it is a classic example of content that is fairly static - Blogs are infrequently updated - in the order of hrs and days not minutes.

 

Tags:
Categories:
Location: Blogs Parent Separator Charles Nurse

9 comment(s) so far...


Re: How one Blog can affect a whole site

I also might suggest that Phil and others use tidyHTML (http://infohound.net/tidy/ ) before posting heavy html...

Table before: 849kb

This is the table with just the TidyHTML filter...
www.sprylegaldesign.com/tidyhtml.html (130k)

This is the page after I cleaned up the CSS to proper semantics...
www.sprylegaldesign.com/semantic.html (102k)

Both use in-body CSS which is tectonically wrong but what can you do on a blog.

By lancelong on   12/14/2007

Re: How one Blog can affect a whole site

... yes, I did mean "earth movingly" wrong. (oops)

By lancelong on   12/14/2007

Re: How one Blog can affect a whole site

As I mentioned - my point is not really how to get the best html - but the impact a seemingly isolated part of the website could have on overal perf.

By cnurse on   12/14/2007

Re: How one Blog can affect a whole site

I understand your point but thought I would provided an option that would make the posts smaller. That, in turn, should reduce the risk of a slow down occuring.

By lancelong on   12/14/2007

Re: How one Blog can affect a whole site

i love to hear real world problems and solutions. thanks for sharing.

By afromobile on   12/14/2007

Re: How one Blog can affect a whole site

Very good point .... I also experienced similar behaviour with the repository and forums. Some users would copy and paste part of the description or post from a previous entry into FCKeditor and even though it looked ok on the outside, there was a huge amount of html stored in the db that was un-needed and caused trouble for rss feeds of those modules. I was able to track down the usrs who like to copy and paste and taught them to use the paste as plain text button in fckeditor, which strips out all the html.

By G-Hunter on   12/14/2007

Re: How one Blog can affect a whole site

I may have misunderstood this, but I'm finding the article somewhat disconcerting. Is this really suggesting that users cannot publish their Office documents to their website or intranet for fear of bringing down the system? That would be a very serious drawback. Is this isolated to the current version of the blog module or is this a system wide problem with any module that is used for publishing content?

By robax on   12/17/2007

Re: How one Blog can affect a whole site

Robax: I'm no expert here, but the problem seems to be with modules that lets users post via FCKeditor(or FTB) and that then become part of an RSS feed. So forum and blog come to the top of my mind. One mans bug is another mans meal ticket.

By BentAngle on   12/23/2007

Re: How one Blog can affect a whole site

Just wondering if the consolidated RSS feed is gone for good or if it was it a snake it would have bit me already? I can't find the RSS link nor can I figure how to finagle a URL to get ALL blogs?

By kennster on   10/20/2008
Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft .NET. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates Snowcovered.com where users purchase third party apps for the platform.