<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Site under volume</title>
	<atom:link href="http://ussmariner.com/2006/12/06/site-under-volume/feed/" rel="self" type="application/rss+xml" />
	<link>http://ussmariner.com/2006/12/06/site-under-volume/</link>
	<description>Seattle Mariners and general baseball discussion with David Cameron and Derek Zumsteg</description>
	<lastBuildDate>Sat, 21 Nov 2009 08:17:03 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: sidereal</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-158076</link>
		<dc:creator>sidereal</dc:creator>
		<pubDate>Sat, 09 Dec 2006 06:20:05 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-158076</guid>
		<description>#80: the work the DB does is almost totally in scanning the tables or indices for matching rows and merging them for joins.  Once it&#039;s got them, actually pumping out the data is negligible.  Since Derek said the CPU was spiking we can assume that&#039;s the bottleneck rather than I/O.  The problem is that it&#039;s doing the same expensive joins over and over again on every hit.  It sounds like DMZ put some caching in the DB layer to prevent excessive querying, so that&#039;s good.  But I persist in the belief that any site that executes redundant queries on every page request is cruising for growing pains, and should be moved over to pagebuilding model.  An easy first step might be dropping in mod_cache, which could cache your pages rather than rebuild.  The problem is you have to figure out the expiration model so the pages are rebuilt after someone comments, and I have no idea whether mod_cache supports explicit expirations.</description>
		<content:encoded><![CDATA[<p>#80: the work the DB does is almost totally in scanning the tables or indices for matching rows and merging them for joins.  Once it&#8217;s got them, actually pumping out the data is negligible.  Since Derek said the CPU was spiking we can assume that&#8217;s the bottleneck rather than I/O.  The problem is that it&#8217;s doing the same expensive joins over and over again on every hit.  It sounds like DMZ put some caching in the DB layer to prevent excessive querying, so that&#8217;s good.  But I persist in the belief that any site that executes redundant queries on every page request is cruising for growing pains, and should be moved over to pagebuilding model.  An easy first step might be dropping in mod_cache, which could cache your pages rather than rebuild.  The problem is you have to figure out the expiration model so the pages are rebuilt after someone comments, and I have no idea whether mod_cache supports explicit expirations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oNeiRiC232</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157800</link>
		<dc:creator>oNeiRiC232</dc:creator>
		<pubDate>Fri, 08 Dec 2006 21:24:57 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157800</guid>
		<description>#80:  Whether the client receives their comments via a separately included flat file or via inclusion into the original HTML via the database doesn&#039;t really seem like it should make a difference.

All a database is is a bunch of flat files with a bunch of double hash tables on top of it for quicker searching, sorting, etc.  So either way, you&#039;re still reading the comment from disk and therefore hitting your main bottleneck -- disk seek time and disk I/O.  Except now your excluding yourself from nice things like query caching and stuff, which can minimize disk usage.

The only time that this would be applicable was if you were doing an insane amount of writes on myISAM (or similar) tables, which lock the entire table whenever it&#039;s getting written to, meaning no one could read from the table easily.  And in this case, I&#039;d just say go to a better table style, like InnoDB. =)

Unless you&#039;re storing your comments in CLOBs inside MySql.  In my experience they&#039;re f*&amp;^ed up performance-wise and need some fixing.  In this case, I&#039;d say yeah, this would be a good workaround until those bugs in MySql are fixed.</description>
		<content:encoded><![CDATA[<p>#80:  Whether the client receives their comments via a separately included flat file or via inclusion into the original HTML via the database doesn&#8217;t really seem like it should make a difference.</p>
<p>All a database is is a bunch of flat files with a bunch of double hash tables on top of it for quicker searching, sorting, etc.  So either way, you&#8217;re still reading the comment from disk and therefore hitting your main bottleneck &#8212; disk seek time and disk I/O.  Except now your excluding yourself from nice things like query caching and stuff, which can minimize disk usage.</p>
<p>The only time that this would be applicable was if you were doing an insane amount of writes on myISAM (or similar) tables, which lock the entire table whenever it&#8217;s getting written to, meaning no one could read from the table easily.  And in this case, I&#8217;d just say go to a better table style, like InnoDB. =)</p>
<p>Unless you&#8217;re storing your comments in CLOBs inside MySql.  In my experience they&#8217;re f*&amp;^ed up performance-wise and need some fixing.  In this case, I&#8217;d say yeah, this would be a good workaround until those bugs in MySql are fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tangotiger</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157746</link>
		<dc:creator>tangotiger</dc:creator>
		<pubDate>Fri, 08 Dec 2006 18:35:20 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157746</guid>
		<description>sid/#71:

I was thinking about a possible idea on that in terms of limiting the DB doing work, and putting the strain on Apache instead.

Store each comment as its own flat file.  The database will hold the name of the file, but not the comment itself.  When the application requests a page, it goes to the database to get the names of the files for the comments, and it will request it as a series of server-side includes.

I did this for my archived site here:
http://www.tangotiger.net/archives/stud0141.shtml

Each of those comments you see on that webpage is stored as its own file. If you were to see the actual source code for the page, it would be almost entirely a series of include statements.</description>
		<content:encoded><![CDATA[<p>sid/#71:</p>
<p>I was thinking about a possible idea on that in terms of limiting the DB doing work, and putting the strain on Apache instead.</p>
<p>Store each comment as its own flat file.  The database will hold the name of the file, but not the comment itself.  When the application requests a page, it goes to the database to get the names of the files for the comments, and it will request it as a series of server-side includes.</p>
<p>I did this for my archived site here:<br />
<a href="http://www.tangotiger.net/archives/stud0141.shtml" rel="nofollow">http://www.tangotiger.net/archives/stud0141.shtml</a></p>
<p>Each of those comments you see on that webpage is stored as its own file. If you were to see the actual source code for the page, it would be almost entirely a series of include statements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DMZ</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157741</link>
		<dc:creator>DMZ</dc:creator>
		<pubDate>Fri, 08 Dec 2006 12:34:31 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157741</guid>
		<description>&lt;blockquote&gt;mysql optimization is a waste of time. it isnt going to save you any more resources in your time than hardware resources&lt;/blockquote&gt;

My counter-argument to that is that on Day 1, USSM was essentially unusable under extreme load and on Day 2, after I turned on query caching, making some reasonable guesses about settings, it was perfectly usable all day long under the same request load.

If I can do something like that and it saves us from having to buy another $2000 server, that&#039;s worth doing.</description>
		<content:encoded><![CDATA[<blockquote><p>mysql optimization is a waste of time. it isnt going to save you any more resources in your time than hardware resources</p></blockquote>
<p>My counter-argument to that is that on Day 1, USSM was essentially unusable under extreme load and on Day 2, after I turned on query caching, making some reasonable guesses about settings, it was perfectly usable all day long under the same request load.</p>
<p>If I can do something like that and it saves us from having to buy another $2000 server, that&#8217;s worth doing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tyler</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157739</link>
		<dc:creator>tyler</dc:creator>
		<pubDate>Fri, 08 Dec 2006 12:01:44 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157739</guid>
		<description>hey guys, ive had a few beers here, but since i do web dev (not networking) for a living ill chirp in my not thought-out thoughts: mysql optimization is a waste of time. it isnt going to save you any more resources in your time than hardware resources. if you dont have any bandwidth issues, if its all server performance, then just get another box and split the loads. you guys seem to be growing at a steady rate and pinching performance barely gets you buy. my sugg is to just spring for a new box. with load balancing it should be fine. maybe get some cheap machines at re-pc and multiply that sh*t. - another donation round before the new season- its ok, we love your content, we dont like your outages!</description>
		<content:encoded><![CDATA[<p>hey guys, ive had a few beers here, but since i do web dev (not networking) for a living ill chirp in my not thought-out thoughts: mysql optimization is a waste of time. it isnt going to save you any more resources in your time than hardware resources. if you dont have any bandwidth issues, if its all server performance, then just get another box and split the loads. you guys seem to be growing at a steady rate and pinching performance barely gets you buy. my sugg is to just spring for a new box. with load balancing it should be fine. maybe get some cheap machines at re-pc and multiply that sh*t. &#8211; another donation round before the new season- its ok, we love your content, we dont like your outages!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joser</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157702</link>
		<dc:creator>joser</dc:creator>
		<pubDate>Fri, 08 Dec 2006 04:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157702</guid>
		<description>&lt;i&gt;Well, the difference between MT and Wordpress, as it’s always been explained to me, is that while WP is (to whatever degree) dynamically generated, MT has static pages to serve but for each change or comment has to regenerate that page. It seems like that operation would be more than a trivial drain on system resources. &lt;/i&gt;

Except that WP has to do exactly the same work to regenerate the page, and it&#039;s doing it for &lt;i&gt;every request&lt;/i&gt;.  A far better design for a middleware layer (call it X -- Wordpress, Movable Type, whatever):
1. Page is first requested
2. X queries the db and generates the page
3. The page is cached somewhere and Apache serves it
Now every subsequent user agent that requests the page gets the cached version from Apache, with no db hit or middleware work required

When a user submits a comment, the cached version is thrown out and a new page is regenerated to be sent down to the submitter.  That page goes into the cache for all subsequent requests

I know nothing about MT or WP, but it sounds like MT does this the right way -- the work is only done when there&#039;s a write, not when there&#039;s a read.</description>
		<content:encoded><![CDATA[<p><i>Well, the difference between MT and Wordpress, as it’s always been explained to me, is that while WP is (to whatever degree) dynamically generated, MT has static pages to serve but for each change or comment has to regenerate that page. It seems like that operation would be more than a trivial drain on system resources. </i></p>
<p>Except that WP has to do exactly the same work to regenerate the page, and it&#8217;s doing it for <i>every request</i>.  A far better design for a middleware layer (call it X &#8212; Wordpress, Movable Type, whatever):<br />
1. Page is first requested<br />
2. X queries the db and generates the page<br />
3. The page is cached somewhere and Apache serves it<br />
Now every subsequent user agent that requests the page gets the cached version from Apache, with no db hit or middleware work required</p>
<p>When a user submits a comment, the cached version is thrown out and a new page is regenerated to be sent down to the submitter.  That page goes into the cache for all subsequent requests</p>
<p>I know nothing about MT or WP, but it sounds like MT does this the right way &#8212; the work is only done when there&#8217;s a write, not when there&#8217;s a read.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DMZ</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157691</link>
		<dc:creator>DMZ</dc:creator>
		<pubDate>Fri, 08 Dec 2006 04:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157691</guid>
		<description>I know! Isn&#039;t it awesome?</description>
		<content:encoded><![CDATA[<p>I know! Isn&#8217;t it awesome?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oNeiRiC232</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157688</link>
		<dc:creator>oNeiRiC232</dc:creator>
		<pubDate>Fri, 08 Dec 2006 03:51:34 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157688</guid>
		<description>The site has been running MUCH better today for me.  Maybe enabling the query cache (and whatever else was done) hit the root of the problem.

How is it for everyone else?</description>
		<content:encoded><![CDATA[<p>The site has been running MUCH better today for me.  Maybe enabling the query cache (and whatever else was done) hit the root of the problem.</p>
<p>How is it for everyone else?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DMZ</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157679</link>
		<dc:creator>DMZ</dc:creator>
		<pubDate>Fri, 08 Dec 2006 03:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157679</guid>
		<description>Well, the difference between MT and Wordpress, as it&#039;s always been explained to me, is that while WP is (to whatever degree) dynamically generated, MT has static pages to serve but for each change or comment has to regenerate that page. It seems like that operation would be more than a trivial drain on system resources.</description>
		<content:encoded><![CDATA[<p>Well, the difference between MT and Wordpress, as it&#8217;s always been explained to me, is that while WP is (to whatever degree) dynamically generated, MT has static pages to serve but for each change or comment has to regenerate that page. It seems like that operation would be more than a trivial drain on system resources.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nat Irons</title>
		<link>http://ussmariner.com/2006/12/06/site-under-volume/comment-page-2/#comment-157677</link>
		<dc:creator>Nat Irons</dc:creator>
		<pubDate>Fri, 08 Dec 2006 03:00:20 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2006/12/06/site-under-volume/#comment-157677</guid>
		<description>What is it that seems counterintuitive?</description>
		<content:encoded><![CDATA[<p>What is it that seems counterintuitive?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
