<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Web Wiz Support and Community Forums : Opening Topic = High CPU usage</title>
  <link>https://forums.webwiz.net/</link>
  <description><![CDATA[This is an XML content feed of; Web Wiz Support and Community Forums : Web Wiz Forums : Opening Topic = High CPU usage]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 06 Apr 2026 12:14:53 +0000</pubDate>
  <lastBuildDate>Fri, 12 Oct 2007 15:17:19 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.08</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://forums.webwiz.net/RSS_post_feed.asp?TID=24614</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Web Wiz Support and Community Forums]]></title>
   <url>https://forums.webwiz.net/forum_images/web_wiz_forums.png</url>
   <link>https://forums.webwiz.net/</link>
  </image>
  <item>
   <title><![CDATA[Opening Topic = High CPU usage : Borg I got some information from...]]></title>
   <link>https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128499.html#128499</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=17435">moti</a><br /><strong>Subject:</strong> 24614<br /><strong>Posted:</strong> 12&nbsp;October&nbsp;2007 at 3:17pm<br /><br />Borg I got some information from Profiler please take a look and tell is that normal or no <DIV>&nbsp;</DIV><DIV>I ran this query from forum_topics.asp page in Query Analyzer </DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>'Read in all the topics for this forum and place them in an array<BR>strSQL = "" &amp; _<BR>"SELECT "<BR>If strDatabaseType = "SQLServer" OR strDatabaseType = "Access" Then<BR>&nbsp;strSQL = strSQL &amp; " TOP " &amp; intMaxResults &amp; " "<BR>End If<BR>strSQL = strSQL &amp; _<BR>" " &amp; strDbTable &amp; "Topic.Topic_ID, " &amp; strDbTable &amp; "Topic.Poll_ID, " &amp; strDbTable &amp; "Topic.Moved_ID, " &amp; strDbTable &amp; "Topic.Subject, " &amp; strDbTable &amp; "Topic.Icon, " &amp; strDbTable &amp; "Topic.Start_Thread_ID, " &amp; strDbTable &amp; "Topic.Last_Thread_ID, " &amp; strDbTable &amp; "Topic.No_of_replies, " &amp; strDbTable &amp; "Topic.No_of_views, " &amp; strDbTable &amp; "Topic.Locked, " &amp; strDbTable &amp; "Topic.Priority, " &amp; strDbTable &amp; "Topic.Hide, " &amp; strDbTable &amp; "Thread.Message_date, " &amp; strDbTable &amp; "Thread.Message, " &amp; strDbTable &amp; "Thread.Author_ID, " &amp; strDbTable &amp; "Author.Username, LastThread.Message_date, LastThread.Author_ID, LastAuthor.Username, " &amp; strDbTable &amp; "Topic.Event_date " &amp; _<BR>"FROM " &amp; strDbTable &amp; "Topic" &amp; strDBNoLock &amp; ", " &amp; strDbTable &amp; "Thread" &amp; strDBNoLock &amp; ", " &amp; strDbTable &amp; "Thread AS LastThread" &amp; strDBNoLock &amp; ", " &amp; strDbTable &amp; "Author" &amp; strDBNoLock &amp; ", " &amp; strDbTable &amp; "Author AS LastAuthor" &amp; strDBNoLock &amp; " " &amp; _<BR>"WHERE ("</DIV><DIV>'Do the table joins<BR>strSQL = strSQL &amp; " " &amp; strDbTable &amp; "Thread.Author_ID = " &amp; strDbTable &amp; "Author.Author_ID " &amp; _<BR>&nbsp;"AND LastThread.Author_ID = LastAuthor.Author_ID " &amp; _<BR>&nbsp;"AND " &amp; strDbTable &amp; "Topic.Start_Thread_ID = " &amp; strDbTable &amp; "Thread.Thread_ID " &amp; _<BR>&nbsp;"AND " &amp; strDbTable &amp; "Topic.Last_Thread_ID = LastThread.Thread_ID "</DIV><DIV></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>and I got these information :</DIV><DIV>&nbsp;</DIV><DIV><EM><strong>SQL Server parse and compile time: <BR>&nbsp;&nbsp; CPU time = 94 ms, elapsed time = 116 ms.</strong></EM></DIV><DIV><EM><strong>(386 row(s) affected)<BR><BR></strong></EM></DIV><DIV><EM><strong>Table 'tblAuthor'. Scan count 2, logical reads 292, physical reads 0, read-ahead reads 0.<BR>Table 'tblTopic'. Scan count 1, logical reads 341, physical reads 0, read-ahead reads 0.<BR>Table 'tblThread'. Scan count 2, logical reads 2406, physical reads 0, read-ahead reads 0.</strong></EM></DIV><DIV><BR><EM><strong>SQL Server Execution Times:<BR>&nbsp;&nbsp; CPU time = 63 ms,&nbsp; elapsed time = 4804 ms.<BR></strong></EM><BR></DIV><DIV>As you see its only 386 rows , but look at CPU time and elapsed time its&nbsp; abut 5 sec</DIV><DIV>&nbsp;</DIV><DIV>by the way , I saw this query in Profiler which is one of the queries which take time to run (As I see in profiler) , I have written this for getting number of users posts </DIV><DIV>&nbsp;</DIV><DIV><EM>SELECT Count(tblThread.Thread_ID) AS&nbsp;Posts FROM tblThread, tblTopic WHERE tblThread.topic_id = tblTopic.topic_id AND (tblTopic.forum_id = 1 OR tblTopic.forum_id = 3 OR tblTopic.forum_id = 9) AND tblThread.Author_ID = '125';</EM></DIV><DIV>&nbsp;</DIV><DIV>Does it have any problem ? is the query ok ?&nbsp; can I write it in better way ?</DIV><DIV>&nbsp;</DIV><DIV>Another question , you told me that your server doesn't go above %10 , you mean average, &nbsp;is that correct ? because some times server needs more processing on some queries .</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by moti - 12&nbsp;October&nbsp;2007 at 11:30pm</span>]]>
   </description>
   <pubDate>Fri, 12 Oct 2007 15:17:19 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128499.html#128499</guid>
  </item> 
  <item>
   <title><![CDATA[Opening Topic = High CPU usage :  On a Dual Xeon there should...]]></title>
   <link>https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128495.html#128495</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=1">WebWiz-Bruce</a><br /><strong>Subject:</strong> 24614<br /><strong>Posted:</strong> 12&nbsp;October&nbsp;2007 at 2:10pm<br /><br />On a Dual Xeon there should be no issue of CPU usage, as I mentioned before we have database severs with over 200 web wiz forums databases running off them and CPU usage never goes over 10%.<br><span style="font-size:10px"><br /><br />Edited by -boRg- - 12&nbsp;October&nbsp;2007 at 2:10pm</span>]]>
   </description>
   <pubDate>Fri, 12 Oct 2007 14:10:20 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128495.html#128495</guid>
  </item> 
  <item>
   <title><![CDATA[Opening Topic = High CPU usage : Thank you Borg for taking time...]]></title>
   <link>https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128494.html#128494</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=17435">moti</a><br /><strong>Subject:</strong> 24614<br /><strong>Posted:</strong> 12&nbsp;October&nbsp;2007 at 1:46pm<br /><br />Thank you Borg for taking time and writing this good explanation ,<DIV>Yes , I have to close that topic, </DIV><DIV>No , I don't allow guest to post so I just removed that Join part of query its a little better about 200 millisecend less than old query,</DIV><DIV>the server is Xeon Dual with 2 GB of ram , server seems ok . I have checked all of the counters within Performance Monitoring everything is ok but CPU usage.</DIV><DIV><BR>Really I don't know what's the problem,</DIV><DIV><img src="https://forums.webwiz.net/smileys/smiley6.gif" height="17" width="17" border="0" alt="Unhappy" /></DIV>]]>
   </description>
   <pubDate>Fri, 12 Oct 2007 13:46:32 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128494.html#128494</guid>
  </item> 
  <item>
   <title><![CDATA[Opening Topic = High CPU usage :  In amount of time I think it...]]></title>
   <link>https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128487.html#128487</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=1">WebWiz-Bruce</a><br /><strong>Subject:</strong> 24614<br /><strong>Posted:</strong> 12&nbsp;October&nbsp;2007 at 1:04pm<br /><br />In amount of time I think it was somewhere in the region of a week was spent on writing this query and optimising the page as much as possible without repeated hits on the database. However quite a bit of data is required so joins in the query are unavoidable.<br><br>Most topics themselves only have a 1 to 20 pages, 100 page topic most have allot of posts within it? Often if topics are getting this long it would be more advisable to start a new forum on that topic rather than sticking all the posts in the one topic.<br><br>As most topics only have 1 to 20 pages the page itself has been optimised for this amount of data. If you are wanting topics with larger amounts of posts would need to look at removing data and features displayed with the posts and making them more simplistic so that less data is required from the query.<br><br>If you don't allow guests to post in forums the first place you could look is modifying the code to display the posts and removing the join to the tblGuestName table. This would certainly cut down on the required joins for the query.<br><br>You may also want to look at the server itself, for example if the server running SQL Server is on a Celeron with 512Mb of memory then you are going to be looking at using allot of processing power, as a Celeron CPU is not really up to the amount of resources required for SQL Server. However, if the server is a P4 or a Xeon Dual or Quad Core, then I would have a look at your settings within SQL server as it should not be using this amount of CPU usage. One area to look is to make sure that memory hungry SQL Server has enough memory, even with simple small databases SQL server want's to have at least 1Gig of memory.<br><br>This is where mySQL comes in, in comparison it uses much less memory. We have one server here with 12 database on the SQL server and 100 datbaases on mySQL, with mySQL with the larger databases, yet SQL server is using up almost 4Gig of memory and mySQL is using less than 200Mb.<br><br><br><span style="font-size:10px"><br /><br />Edited by -boRg- - 12&nbsp;October&nbsp;2007 at 1:10pm</span>]]>
   </description>
   <pubDate>Fri, 12 Oct 2007 13:04:14 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128487.html#128487</guid>
  </item> 
  <item>
   <title><![CDATA[Opening Topic = High CPU usage : Thanks Borg So what do you think...]]></title>
   <link>https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128483.html#128483</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=17435">moti</a><br /><strong>Subject:</strong> 24614<br /><strong>Posted:</strong> 12&nbsp;October&nbsp;2007 at 12:37pm<br /><br />Thanks Borg<DIV>So what do you think about that ? what is the problem that cause much cpu usage ?</DIV><DIV>why above query uses that much processing power ?</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 12 Oct 2007 12:37:06 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128483.html#128483</guid>
  </item> 
  <item>
   <title><![CDATA[Opening Topic = High CPU usage :  100 Pages is allot for 1 topic,...]]></title>
   <link>https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128481.html#128481</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=1">WebWiz-Bruce</a><br /><strong>Subject:</strong> 24614<br /><strong>Posted:</strong> 12&nbsp;October&nbsp;2007 at 11:33am<br /><br />100 Pages is allot for 1 topic, you maybe better off having a shut off point to start again.<br><br>However, it shouldn't use that much processing power. We have a database server serving over 100 Web Wiz Forums, with some with on average over 100&nbsp; active users and forums with over 400,000 posts. Yet the CPU usage rarely goes above 10% with the average being under 5%.<br><br>SQL Server does use ALLOT of resources and if you are worried about this we would recommend that you use mySQL instead, it uses less than 1% of the resources SQL Server uses, and we find on larger Web Wiz Forums databases that it out performs SQL Server.<br><span style="font-size:10px"><br /><br />Edited by -boRg- - 12&nbsp;October&nbsp;2007 at 11:35am</span>]]>
   </description>
   <pubDate>Fri, 12 Oct 2007 11:33:58 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128481.html#128481</guid>
  </item> 
  <item>
   <title><![CDATA[Opening Topic = High CPU usage : I have a topic about 100 pages...]]></title>
   <link>https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128480.html#128480</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://forums.webwiz.net/member_profile.asp?PF=17435">moti</a><br /><strong>Subject:</strong> 24614<br /><strong>Posted:</strong> 12&nbsp;October&nbsp;2007 at 10:23am<br /><br />I have a topic about 100 pages , whenever a user&nbsp; opens this topic CPU usage of SQL goes to %45 and some times more than %60 , I don't know this is normal or no, <DIV>one of my friends told me this is not normal and its because of bad writing of query,</DIV><DIV>Average&nbsp;cpu usage of my forum is about %25&nbsp; , is that normal ?</DIV><DIV>&nbsp;</DIV><DIV>I have checked with Profiler and it shows me this line of query :</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>'Intilise SQL query to get all the posts<BR>'Use a LEFT JOIN for the Guest name as there may not be a Guest name and so we want to include null values<BR>strSQL = "" &amp; _<BR>"SELECT " &amp; strDbTable &amp; "Thread.Thread_ID, " &amp; strDbTable &amp; "Thread.Message, " &amp; strDbTable &amp; "Thread.Message_date, " &amp; strDbTable &amp; "Thread.Show_signature, " &amp; strDbTable &amp; "Thread.IP_addr, " &amp; strDbTable &amp; "Thread.Hide, " &amp; strDbTable &amp; "Author.Author_ID, " &amp; strDbTable &amp; "Author.Username, " &amp; strDbTable &amp; "Author.Homepage, " &amp; strDbTable &amp; "Author.Location, " &amp; strDbTable &amp; "Author.No_of_posts, " &amp; strDbTable &amp; "Author.Join_date, " &amp; strDbTable &amp; "Author.Signature, " &amp; strDbTable &amp; "Author.Active, " &amp; strDbTable &amp; "Author.Avatar, " &amp; strDbTable &amp; "Author.Avatar_title, " &amp; strDbTable &amp; "Group.Name, " &amp; strDbTable &amp; "Group.Stars, " &amp; strDbTable &amp; "Group.Custom_stars, " &amp; strDbTable &amp; "GuestName.Name" &amp; _<BR>"FROM (" &amp; strDbTable &amp; "Group INNER JOIN (" &amp; strDbTable &amp; "Author INNER JOIN " &amp; strDbTable &amp; "Thread ON " &amp; strDbTable &amp; "Author.Author_ID = " &amp; strDbTable &amp; "Thread.Author_ID) ON " &amp; strDbTable &amp; "Group.Group_ID = " &amp; strDbTable &amp; "Author.Group_ID) LEFT JOIN " &amp; strDbTable &amp; "GuestName ON " &amp; strDbTable &amp; "Thread.Thread_ID = " &amp; strDbTable &amp; "GuestName.Thread_ID " &amp; _<BR>"WHERE " &amp; strDbTable &amp; "Thread.Topic_ID = " &amp; lngTopicID &amp; " "</DIV><DIV></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>this is from forum_post.asp&nbsp; file</DIV><DIV>it take long time to run</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by moti - 12&nbsp;October&nbsp;2007 at 10:32am</span>]]>
   </description>
   <pubDate>Fri, 12 Oct 2007 10:23:50 +0000</pubDate>
   <guid isPermaLink="true">https://forums.webwiz.net/opening-topic-high-cpu-usage_topic24614_post128480.html#128480</guid>
  </item> 
 </channel>
</rss>