Search
  
 
Mitchel Sellers' DotNetNuke, .NET, and Other Topics BlogMinimize
 
 
Subscribe To Blog Updates by E-Mail

Current Articles | Categories | Search | Syndication

   
 Simple DotNetNuke Performance Improvements
By Mitchel Sellers on Tuesday, April 24, 2007 @ 4:10 PM
 
  4922 Views :: 9 Comments :: :: DotNetNuke, Tutorials
  
 

I have been seeing a large number of questions recently regarding DotNetNuke performance and things that can be done to help improve the performance of the site.  Typically these questions surround the SiteLog and EventLog tables so I thought I would post a few simple queries that you can run to help keep your database lean which will keep your DotNetNuke site running at peak performance.

Site Log

I will start with the Site Log table, the site log functionality is not one that I actually utilize in my site, however for those of you who use it in yours you will want to keep an eye on it, I have noticed that after the log has grown to over about 4-5 thousand records that you can start to notice some performance decreases. Additionally if you are like myself and have turned off the site log I found out that it does not necessarily clean itself up if you turned it off, therefore in my case I had 1000 lingering records, which just unnecessarily increased the size of my database.

To check the number of records in your Site Log use the following query

SELECT Count(*)
FROM SiteLog

To find the oldest record in the site log use the following.

SELECT MIN([DateTime])
FROM SiteLog

After you have viewed this information you can determine your needed course of action. In my case since the site log is disabled on all portals I simply deleted all records from the table using a simple delete statement. In your case you might only want to purge specific records but that determination is outside the scope of this article.

Event Log

The Event log stores portal specific event information such as logins, invalid login attempts and actual errors. If you have a fairly active portal this table can grow very large quite quickly. For my sites with their traffic of about 100-120 visitors per day I have noticed an EventLog of over 2000 records in a 2.5 month period. Now unless you are auditing logins or doing specific tracking you can typically rid yourself of these records without much effect. You can purge these portal by portal via the "Event Viewer" within DotNetNuke, or you can view and modify records via the database. Below I will provide you two helpful queries.

To identify the number of records, and the number of records per portal. Note, in the results of the per portal query, you will find many entries listed with a NULL portal id, this is for DNN installation wide items, such as scheduler and application events.

--Overall total
SELECT COUNT(*)
FROM EventLog

--Total by portal (null is not portal specific)
SELECT LogPortalId, COUNT(*)
FROM EventLog
GROUP BY logPortalId

To identify the oldest records you can use one of the following queries, again an overall minimum and a per portal minimum will be found.

SELECT MIN(LogCreateDate)
FROM EventLog

SELECT LogPortalId, MIN(LogCreateDate)
FROM EventLog
GROUP BY logPortalId

Again for deleting these records the decision really depends on your portals use of the Event Log and any need for user login auditing. In my case I again do not need this information and currently I have resolved all of my routine errors that were happening, therefore I removed all records in my listing across all sites. I try to complete this at least once as month to ensure that the table size has been reduced.

Viewing DB Size

If you would like to view the size of your database files you can use the query below to view the size of each file for the current database.

SELECT *
from SYSFILES

Using these tips you can start to get a better understanding of your database size and you can help manage it and keep your DotNetNuke site running at peak performance!

Please share your thoughts and concerns below.

 
  
 Share/Save This Article 
 

Use the below controls to save this article to one of many popular social bookmarking sites!

   kick it on DotNetKicks.com  
 
  
 Article Rating 
  
  
 Article Comments 
 
By bonder @ Thursday, June 21, 2007 11:29 PM
Also, page weight is something that you should keep an eye on. Skins that are very beautiful can often go over 300K total page weight, and involve many objects that browsers must manage in memory.

A tool I use to check out page weight, load times, and object complexity is

http://www.websiteoptimization.com/services/analyze/

HTH!

By Mitchel Sellers @ Friday, June 22, 2007 3:58 AM
This is a VERY valid point!

By Amanda Mahannah @ Monday, October 15, 2007 5:23 AM
What if our log viewer isn't appearing as an option? Is there a simple setting we can fix to see it?

By Mitchel Sellers @ Monday, October 15, 2007 3:16 PM
Amanda,

If you can't see it as a menu option in the 'Admin" menu, then you have some other issues going on with your site.

If you need some assistance please let me know, but that is beyond the scope of what can be answered here.

By Brian @ Thursday, March 27, 2008 2:59 PM
Hey all,
When I run a SQL query in the Host/SQL on DNN for SELECT *
from SYSFILES everything is fine however when I try to run a query for the event log or the site log I receive this error message.

There is an error in your query!

Any ideas?

By Mitchel Sellers @ Friday, March 28, 2008 6:04 AM
Brian,

If you have an object qualifier specified in your web.config you will need to append that to the beginning of your table name...

By Michigan DotNetNuke Expert @ Saturday, April 05, 2008 12:57 PM
Use the gzip compression, keep your page size and image sizes down, we tend to schedule and restart the app pools for our really large websites about twice a day. We tend to turn off the logging for our large sites, it is pretty rough. Caching, we run high cache. On our dedicated boxes where we host DNN sites for our clients we don't give everyone there own app pool even though we should. We just see too much of a performance hit when doing 50+ sites.
Module called pageblaster is worth looking at.

By DNN Performance Module @ Sunday, April 13, 2008 9:20 AM
For anyone wanting to try out PageBlaster you can find a free edition here:
http://www.snapsis.com/PageBlaster-Community-Edition.aspx

The free edition may be all you need for performance and automatic web optimization, but if you decide to upgrade to professional then you can use the following coupon code for a 25% discount: Sellers


By Dotnetnuke custom modules @ Friday, May 02, 2008 7:23 AM
If you are running an older version of Dotnetnuke prior to version 4.5 you have to consider upgrading to the latest version as it is a whole lot faster. Also you may consider removing dll files for modules you are not using in you web. Be sure you know what you are doing though as removing the wrong dll will cause problems running your web. Creating a backup before doing anything is always good practice.

Click here to post a comment
 

 Add to Technorati Favorites
 Print   
 
  
 
ArchiveMinimize
 
 
 Print   
 
  
 
CategoriesMinimize
 
 
 Print   
 
  
 
DonateMinimize
 
 

Show your appreciation for the content/modules made available by MitchelSellers.com by making a donation. Donations are used to assist with dedicating time to creating free content. 

 Print