<?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: USSM scalability and general geekery</title>
	<atom:link href="http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/feed/" rel="self" type="application/rss+xml" />
	<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/</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: dks</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174622</link>
		<dc:creator>dks</dc:creator>
		<pubDate>Fri, 20 Apr 2007 01:40:55 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174622</guid>
		<description>&lt;blockquote&gt;Yeah, CPU #2 is the top of my list of things to do.

Here’s the problem with that, though: that’s it for CPU slots. After that I’m looking at… another server? We just went into the black on this one. And, essentially, only for game threads? That doesn’t seem like a wise use of resources.

&lt;/blockquote&gt;

I tried searching the site, but I couldn&#039;t find any mention of exactly what box you got.  If it&#039;s a recent Intel-based server, though, you can probably replace the CPU with one of the E53xx quad-cores (and eventually have quad-cores in both sockets).  Not cheap, though -- anywhere from &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16819117115&quot; rel=&quot;nofollow&quot;&gt;$500&lt;/a&gt; to &lt;a href=&quot;http://www.newegg.com/Product/Product.aspx?Item=N82E16819117110&quot; rel=&quot;nofollow&quot;&gt;$1200&lt;/a&gt;, each.</description>
		<content:encoded><![CDATA[<blockquote><p>Yeah, CPU #2 is the top of my list of things to do.</p>
<p>Here’s the problem with that, though: that’s it for CPU slots. After that I’m looking at… another server? We just went into the black on this one. And, essentially, only for game threads? That doesn’t seem like a wise use of resources.</p>
</blockquote>
<p>I tried searching the site, but I couldn&#8217;t find any mention of exactly what box you got.  If it&#8217;s a recent Intel-based server, though, you can probably replace the CPU with one of the E53xx quad-cores (and eventually have quad-cores in both sockets).  Not cheap, though &#8212; anywhere from <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16819117115" rel="nofollow">$500</a> to <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16819117110" rel="nofollow">$1200</a>, each.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sidereal</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174620</link>
		<dc:creator>sidereal</dc:creator>
		<pubDate>Fri, 20 Apr 2007 01:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174620</guid>
		<description>Yay for caching.

A couple other quick hits:
We use xcache as our php bytecode cacher.  It&#039;s pretty tight and is friendly with php5.

Run &#039;vmstat 10 &gt; /root/vmstat.txt &amp;;tail -f /root/vmstat.txt&#039; during a game and watch the stats.  This is the clearest way I know of to find your bottleneck.  If it&#039;s disk, you&#039;ll see pagefile operations here.  If it&#039;s cpu, you&#039;ll see it here.</description>
		<content:encoded><![CDATA[<p>Yay for caching.</p>
<p>A couple other quick hits:<br />
We use xcache as our php bytecode cacher.  It&#8217;s pretty tight and is friendly with php5.</p>
<p>Run &#8216;vmstat 10 &gt; /root/vmstat.txt &amp;;tail -f /root/vmstat.txt&#8217; during a game and watch the stats.  This is the clearest way I know of to find your bottleneck.  If it&#8217;s disk, you&#8217;ll see pagefile operations here.  If it&#8217;s cpu, you&#8217;ll see it here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oNeiRiC232</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174562</link>
		<dc:creator>oNeiRiC232</dc:creator>
		<pubDate>Fri, 20 Apr 2007 00:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174562</guid>
		<description>Well, now the source has two lines:

(!-- Dynamic Page Served (once) in 0.748 seconds --)
(!-- Cached page served by WP-Cache --)

It looks like the wp-cache was actually off before and someone&#039;s tinkering with the on button right now.  ;-P</description>
		<content:encoded><![CDATA[<p>Well, now the source has two lines:</p>
<p>(!&#8211; Dynamic Page Served (once) in 0.748 seconds &#8211;)<br />
(!&#8211; Cached page served by WP-Cache &#8211;)</p>
<p>It looks like the wp-cache was actually off before and someone&#8217;s tinkering with the on button right now.  ;-P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scotje</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174552</link>
		<dc:creator>scotje</dc:creator>
		<pubDate>Thu, 19 Apr 2007 23:47:01 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174552</guid>
		<description>I believe that comment is WP-Cache&#039;s notification of how long it took to build the page initially, that is, the copy that it cached.

Also, keep in mind that, although the game thread is only 300-400 posts long, those posts don&#039;t come at a regular rate throughout the game.

I&#039;m not saying that this is definitely a disk IO issue (or even that I think that, in this specific situation, it&#039;s likely to be the cause), I&#039;m just saying that &quot;Oh we have query caching on&quot; doesn&#039;t mean you shouldn&#039;t still inspect the IO situation. 

A methodical approach of definitively ruling out various potential bottlenecks seems like the best way to approach things.


Derek, I would definitely take a look at installing a byte code cache like the aforementioned Zend Optimizer (which I believe is still free) or the &lt;a href=&quot;http://eaccelerator.net/&quot; rel=&quot;nofollow&quot;&gt;eAccelerator&lt;/a&gt; that is mentioned in the WP optimization article. These things really can work wonders for PHP execution times.</description>
		<content:encoded><![CDATA[<p>I believe that comment is WP-Cache&#8217;s notification of how long it took to build the page initially, that is, the copy that it cached.</p>
<p>Also, keep in mind that, although the game thread is only 300-400 posts long, those posts don&#8217;t come at a regular rate throughout the game.</p>
<p>I&#8217;m not saying that this is definitely a disk IO issue (or even that I think that, in this specific situation, it&#8217;s likely to be the cause), I&#8217;m just saying that &#8220;Oh we have query caching on&#8221; doesn&#8217;t mean you shouldn&#8217;t still inspect the IO situation. </p>
<p>A methodical approach of definitively ruling out various potential bottlenecks seems like the best way to approach things.</p>
<p>Derek, I would definitely take a look at installing a byte code cache like the aforementioned Zend Optimizer (which I believe is still free) or the <a href="http://eaccelerator.net/" rel="nofollow">eAccelerator</a> that is mentioned in the WP optimization article. These things really can work wonders for PHP execution times.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oNeiRiC232</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174545</link>
		<dc:creator>oNeiRiC232</dc:creator>
		<pubDate>Thu, 19 Apr 2007 23:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174545</guid>
		<description>Sorry for the botched quote.  It should say --



&lt;blockquote&gt;Dynamic Page Served (once) in 0.753 seconds&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>Sorry for the botched quote.  It should say &#8211;</p>
<blockquote><p>Dynamic Page Served (once) in 0.753 seconds</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: oNeiRiC232</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174544</link>
		<dc:creator>oNeiRiC232</dc:creator>
		<pubDate>Thu, 19 Apr 2007 23:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174544</guid>
		<description>#31:

A game thread is a few hundred posts long, made over a few hours.  Invalidating the MySQL cache ~300 times in a few hours isn&#039;t going to thrash anything.  That&#039;s an average of two or three invalidations a minute.  I&#039;d be shocked if MySQL is thrashing the HD.

Anyways...  I just pulled this from the bottom of the source HTML of the page right now, when it&#039;s pretty calm and we&#039;re just BS&#039;ing about server stuff --

&lt;blockquote&gt;&lt;!-- Dynamic Page Served (once) in 0.753 seconds --&gt;&lt;/blockquote&gt;

Even when there&#039;s no game thread it takes WP almost a second just to generate the page it sends you.  0.75 sec/page * 2,000 people slamming refresh = Melted plastic.

WordPress just blows.  The only way to make it work under such heavy load would be to throw a lot of resources at it via replication and load balancing -- put MySQL on it&#039;s own box and then replicate the webserver.  Or chuck WordPress...</description>
		<content:encoded><![CDATA[<p>#31:</p>
<p>A game thread is a few hundred posts long, made over a few hours.  Invalidating the MySQL cache ~300 times in a few hours isn&#8217;t going to thrash anything.  That&#8217;s an average of two or three invalidations a minute.  I&#8217;d be shocked if MySQL is thrashing the HD.</p>
<p>Anyways&#8230;  I just pulled this from the bottom of the source HTML of the page right now, when it&#8217;s pretty calm and we&#8217;re just BS&#8217;ing about server stuff &#8211;</p>
<blockquote><p><!-- Dynamic Page Served (once) in 0.753 seconds --></p></blockquote>
<p>Even when there&#8217;s no game thread it takes WP almost a second just to generate the page it sends you.  0.75 sec/page * 2,000 people slamming refresh = Melted plastic.</p>
<p>WordPress just blows.  The only way to make it work under such heavy load would be to throw a lot of resources at it via replication and load balancing &#8212; put MySQL on it&#8217;s own box and then replicate the webserver.  Or chuck WordPress&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nat Irons</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174528</link>
		<dc:creator>Nat Irons</dc:creator>
		<pubDate>Thu, 19 Apr 2007 22:20:49 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174528</guid>
		<description>&lt;i&gt;I wonder if it’s the “Logged in as DMZ. Logout »” line — that’s going to vary for every user, right? I wonder if that forces generation of a new version for each person/login.&lt;/i&gt;

Does wp-cache arrange to serve static files, or just produce a highly optimized database result? I would hope it&#039;d be serving static files, because no amount of optimization would save the server when Felix comes out in the first inning. And in that case the results should be plainly apparent in the apache logs -- you&#039;ll see lots and lots of the cached .html files being pushed over the wire.

&lt;i&gt;I have, in relative secrecy, experimented with Movable Type and other options, and the results were pretty awful.&lt;/i&gt;

What flavor of awful? I know MT a lot better than WordPress, and USSM isn&#039;t doing anything that MT can&#039;t handle. Switching over would still be a pain, though, so if wp-cache can arrange to serve static files with only ~300 or so database updates per game thread, that should be a big win.</description>
		<content:encoded><![CDATA[<p><i>I wonder if it’s the “Logged in as DMZ. Logout »” line — that’s going to vary for every user, right? I wonder if that forces generation of a new version for each person/login.</i></p>
<p>Does wp-cache arrange to serve static files, or just produce a highly optimized database result? I would hope it&#8217;d be serving static files, because no amount of optimization would save the server when Felix comes out in the first inning. And in that case the results should be plainly apparent in the apache logs &#8212; you&#8217;ll see lots and lots of the cached .html files being pushed over the wire.</p>
<p><i>I have, in relative secrecy, experimented with Movable Type and other options, and the results were pretty awful.</i></p>
<p>What flavor of awful? I know MT a lot better than WordPress, and USSM isn&#8217;t doing anything that MT can&#8217;t handle. Switching over would still be a pain, though, so if wp-cache can arrange to serve static files with only ~300 or so database updates per game thread, that should be a big win.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scotje</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174518</link>
		<dc:creator>scotje</dc:creator>
		<pubDate>Thu, 19 Apr 2007 22:02:10 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174518</guid>
		<description>Part of the problem is that we still haven&#039;t identified exactly what the performance bottleneck is, other than that there winds up being way too much work pending for the CPU.

#25: Query caching doesn&#039;t fix everything, when the table changes (like when a comment is posted) the cached queries for that table are invalidated. On a game thread, this happens a lot. MySQL could very well still be thrashing the disk leaving a lot of processes in an IOWAIT state. This is by far the #1 most common performance bottleneck on a Apache/MySQL/PHP architecture.

2GB of RAM and a decent CPU should get you into 7 figures in terms of hits/day unless something really complicated is going on with the pages. Disabling swap is...not wise. FreeBSD and other unix systems are a lot better at memory management than windows is. All the memory being in use but none of the swap being in use is an indication of efficient memory management. Unix doesn&#039;t like to waste RAM, so it finds something useful to put in there and doesn&#039;t take it out until it needs to.

Stepping back for a second though, the game threads are pretty much a doomsday scenario in terms of scalability: constantly changing data with teeming throngs pounding the refresh button. If I was going to look at something from a software standpoint, I would look into finding or developing a real simple (but high performance) solution that would handle the game thread discussions exclusively and leave the rest of the site in Wordpress&#039; capable hands. This could probably even be developed in the context of a WP plugin as something that didn&#039;t even touch MySQL for those discussions.</description>
		<content:encoded><![CDATA[<p>Part of the problem is that we still haven&#8217;t identified exactly what the performance bottleneck is, other than that there winds up being way too much work pending for the CPU.</p>
<p>#25: Query caching doesn&#8217;t fix everything, when the table changes (like when a comment is posted) the cached queries for that table are invalidated. On a game thread, this happens a lot. MySQL could very well still be thrashing the disk leaving a lot of processes in an IOWAIT state. This is by far the #1 most common performance bottleneck on a Apache/MySQL/PHP architecture.</p>
<p>2GB of RAM and a decent CPU should get you into 7 figures in terms of hits/day unless something really complicated is going on with the pages. Disabling swap is&#8230;not wise. FreeBSD and other unix systems are a lot better at memory management than windows is. All the memory being in use but none of the swap being in use is an indication of efficient memory management. Unix doesn&#8217;t like to waste RAM, so it finds something useful to put in there and doesn&#8217;t take it out until it needs to.</p>
<p>Stepping back for a second though, the game threads are pretty much a doomsday scenario in terms of scalability: constantly changing data with teeming throngs pounding the refresh button. If I was going to look at something from a software standpoint, I would look into finding or developing a real simple (but high performance) solution that would handle the game thread discussions exclusively and leave the rest of the site in Wordpress&#8217; capable hands. This could probably even be developed in the context of a WP plugin as something that didn&#8217;t even touch MySQL for those discussions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mat</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174516</link>
		<dc:creator>Mat</dc:creator>
		<pubDate>Thu, 19 Apr 2007 21:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174516</guid>
		<description>Is the bottleneck in performance MySQL?

Looking at the pre-spike table, we see that MySQL seems to be using about 5% of the CPU, and it wouldn&#039;t appear to need much more than that since you still have some available CPU left at that point.  Then in the next table, MySQL is nowhere to be found, which would naively seem like a big problem to me.

I would suspect that if MySQL wants 5% of the CPU when the server isn&#039;t choking, it probably still wants at least 5% of the CPU when the server is choking, but isn&#039;t getting it.  If it really is happy using less than 0.3% of the CPU during the slowdown, then even if you can get it to run 100 times faster through better caching or whatever, then you&#039;re only going to open up enough space for one more httpd process.

Basically, I guess I&#039;d say that if MySQL is the bottleneck, you might want to look into getting it more CPU time by giving it a higher priority or something.  If it isn&#039;t the bottleneck, then it seems like you won&#039;t really gain anything by spending any extra time optimizing the MySQL side of things.</description>
		<content:encoded><![CDATA[<p>Is the bottleneck in performance MySQL?</p>
<p>Looking at the pre-spike table, we see that MySQL seems to be using about 5% of the CPU, and it wouldn&#8217;t appear to need much more than that since you still have some available CPU left at that point.  Then in the next table, MySQL is nowhere to be found, which would naively seem like a big problem to me.</p>
<p>I would suspect that if MySQL wants 5% of the CPU when the server isn&#8217;t choking, it probably still wants at least 5% of the CPU when the server is choking, but isn&#8217;t getting it.  If it really is happy using less than 0.3% of the CPU during the slowdown, then even if you can get it to run 100 times faster through better caching or whatever, then you&#8217;re only going to open up enough space for one more httpd process.</p>
<p>Basically, I guess I&#8217;d say that if MySQL is the bottleneck, you might want to look into getting it more CPU time by giving it a higher priority or something.  If it isn&#8217;t the bottleneck, then it seems like you won&#8217;t really gain anything by spending any extra time optimizing the MySQL side of things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DMZ</title>
		<link>http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/comment-page-1/#comment-174497</link>
		<dc:creator>DMZ</dc:creator>
		<pubDate>Thu, 19 Apr 2007 20:26:34 +0000</pubDate>
		<guid isPermaLink="false">http://ussmariner.com/2007/04/18/ussm-scalability-and-general-geekery/#comment-174497</guid>
		<description>Yeah, CPU #2 is the top of my list of things to do.

Here&#039;s the problem with that, though: that&#039;s it for CPU slots. After that I&#039;m looking at... another server? We just went into the black on this one. And, essentially, only for game threads? That doesn&#039;t seem like a wise use of resources.</description>
		<content:encoded><![CDATA[<p>Yeah, CPU #2 is the top of my list of things to do.</p>
<p>Here&#8217;s the problem with that, though: that&#8217;s it for CPU slots. After that I&#8217;m looking at&#8230; another server? We just went into the black on this one. And, essentially, only for game threads? That doesn&#8217;t seem like a wise use of resources.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
