<?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/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: Scaling Up: Reducing Drag, Increasing Lift</title>
	<atom:link href="http://www.brandonsavage.net/scaling-up-reducing-drag-increasing-lift/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/scaling-up-reducing-drag-increasing-lift/</link>
	<description>The personal blog of Brandon Savage. Contains entries of a personal and professional nature focusing on PHP, Apple, LAMP, MySQL and Washington, DC.</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:36:33 -0500</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Matthew Weier O'Phinney</title>
		<link>http://www.brandonsavage.net/scaling-up-reducing-drag-increasing-lift/#comment-73</link>
		<dc:creator>Matthew Weier O'Phinney</dc:creator>
		<pubDate>Wed, 25 Feb 2009 13:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=190#comment-73</guid>
		<description>@1stvamp I should have mentioned that when I mentioned usage of autoloaders. Zend Framework&#039;s Zend_Loader::loadClass() actually uses include() internally (after first checking against class_exists()), so when used within an autoloader, it&#039;s doing exactly what you suggest -- and that&#039;s what I was benchmarking.</description>
		<content:encoded><![CDATA[<p>@1stvamp I should have mentioned that when I mentioned usage of autoloaders. Zend Framework&#8217;s Zend_Loader::loadClass() actually uses include() internally (after first checking against class_exists()), so when used within an autoloader, it&#8217;s doing exactly what you suggest &#8212; and that&#8217;s what I was benchmarking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wesley Mason</title>
		<link>http://www.brandonsavage.net/scaling-up-reducing-drag-increasing-lift/#comment-72</link>
		<dc:creator>Wesley Mason</dc:creator>
		<pubDate>Wed, 25 Feb 2009 12:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=190#comment-72</guid>
		<description>@weierophinney: Opcode caches such as APC and Xcache have trouble caching opcodes called using require_once and include_once due to the architecture of the Zend engine and the way it handles these, so even when using a cache it can be more optimal to avoid the extra IO of a *_once function call.
One way I get around this is by emulating the use of _once within an spl_autoloader class, which just calls require instead.</description>
		<content:encoded><![CDATA[<p>@weierophinney: Opcode caches such as APC and Xcache have trouble caching opcodes called using require_once and include_once due to the architecture of the Zend engine and the way it handles these, so even when using a cache it can be more optimal to avoid the extra IO of a *_once function call.<br />
One way I get around this is by emulating the use of _once within an spl_autoloader class, which just calls require instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/scaling-up-reducing-drag-increasing-lift/#comment-66</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Tue, 24 Feb 2009 16:47:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=190#comment-66</guid>
		<description>Thanks Eli. You&#039;ll note that I modified the article somewhat to reflect your statements, and I know you&#039;re right about some of them. I do agree with Matthew Weier O&#039;Phinney, though, relating to require_once, and I think that good planning can help with these things.

Thank you both for your comments. I welcome the discussion.</description>
		<content:encoded><![CDATA[<p>Thanks Eli. You&#8217;ll note that I modified the article somewhat to reflect your statements, and I know you&#8217;re right about some of them. I do agree with Matthew Weier O&#8217;Phinney, though, relating to require_once, and I think that good planning can help with these things.</p>
<p>Thank you both for your comments. I welcome the discussion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Weier O'Phinney</title>
		<link>http://www.brandonsavage.net/scaling-up-reducing-drag-increasing-lift/#comment-65</link>
		<dc:creator>Matthew Weier O'Phinney</dc:creator>
		<pubDate>Tue, 24 Feb 2009 16:42:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=190#comment-65</guid>
		<description>require_once calls are expensive -- but when you use an opcode cache and PHP &gt;= 5.2.0, the impact becomes trivial. PHP 5.2.0 adds a realpath cache, which greatly speeds up the lookups and reduces the number of hits to the filesystem. Even if you&#039;re loading dozens or hundreds of files, under APC or Zend Accelerator, the performance impact is greatly mitigated.

Another tip: strip the require_once calls and use autoloading. I did this when profiling Zend Framework, and the performance impact was dramatic. If you have a good autoload strategy and use an opcode cache, I often saw performance increases of 4-10x.</description>
		<content:encoded><![CDATA[<p>require_once calls are expensive &#8212; but when you use an opcode cache and PHP &gt;= 5.2.0, the impact becomes trivial. PHP 5.2.0 adds a realpath cache, which greatly speeds up the lookups and reduces the number of hits to the filesystem. Even if you&#8217;re loading dozens or hundreds of files, under APC or Zend Accelerator, the performance impact is greatly mitigated.</p>
<p>Another tip: strip the require_once calls and use autoloading. I did this when profiling Zend Framework, and the performance impact was dramatic. If you have a good autoload strategy and use an opcode cache, I often saw performance increases of 4-10x.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli White</title>
		<link>http://www.brandonsavage.net/scaling-up-reducing-drag-increasing-lift/#comment-62</link>
		<dc:creator>Eli White</dc:creator>
		<pubDate>Tue, 24 Feb 2009 15:59:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=190#comment-62</guid>
		<description>Overall, a decent writeup; however, I disagree on some of the points.  The SQL code you first present for example, is IMO the more scalable code (if perhaps not more performant).  It is my experience that doing many smaller compact &amp; direct queries allows you to scale better.  They can be farmed out to multiple DBs, they have a greater chance of hitting a DB cache, they are easier for you to cache yourself, they create less DB load overall by requiring less &#039;complicated work&#039; of the DB, etc.

Secondly, you state that if you are going to include a number of files, that you should turn APC off because it&#039;s not helping you.  Again, I disagree.  Sure if you happen to include a dozen (or hundreds) of separate PHP files, you are requiring some stat commands to happen, and if using require_once, then a hash lookup.  But those are so minor when compared to recompiling each file over and over again.  Trying to avoid those stat/hash things is a good concept, but is a real fine-tune performance measure.  And can harm your code maintainability in the process as you attempt to clump files together.

Finally, you have a very nice section on concurrency, something that many people overlook.  (Also Slave Lag is often overlooked and can be seen as related to concurrency).  However, having code designed for concurrency has nothing to do with scalability (nor performance)</description>
		<content:encoded><![CDATA[<p>Overall, a decent writeup; however, I disagree on some of the points.  The SQL code you first present for example, is IMO the more scalable code (if perhaps not more performant).  It is my experience that doing many smaller compact &amp; direct queries allows you to scale better.  They can be farmed out to multiple DBs, they have a greater chance of hitting a DB cache, they are easier for you to cache yourself, they create less DB load overall by requiring less &#8216;complicated work&#8217; of the DB, etc.</p>
<p>Secondly, you state that if you are going to include a number of files, that you should turn APC off because it&#8217;s not helping you.  Again, I disagree.  Sure if you happen to include a dozen (or hundreds) of separate PHP files, you are requiring some stat commands to happen, and if using require_once, then a hash lookup.  But those are so minor when compared to recompiling each file over and over again.  Trying to avoid those stat/hash things is a good concept, but is a real fine-tune performance measure.  And can harm your code maintainability in the process as you attempt to clump files together.</p>
<p>Finally, you have a very nice section on concurrency, something that many people overlook.  (Also Slave Lag is often overlooked and can be seen as related to concurrency).  However, having code designed for concurrency has nothing to do with scalability (nor performance)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 4/11 queries in 0.006 seconds using disk: basic
Content Delivery Network via Amazon Web Services: S3: files.brandonsavage.net.s3.amazonaws.com

Served from: www.brandonsavage.net @ 2012-02-07 04:50:36 -->
