<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MaisonBisson.com &#187; scaling</title>
	<atom:link href="http://maisonbisson.com/blog/post/tag/scaling/feed/" rel="self" type="application/rss+xml" />
	<link>http://maisonbisson.com</link>
	<description>A bunch of stuff I would have emailed you about.</description>
	<lastBuildDate>Sat, 14 Nov 2009 20:14:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Scaling PHP</title>
		<link>http://maisonbisson.com/blog/post/11407/scaling-php/</link>
		<comments>http://maisonbisson.com/blog/post/11407/scaling-php/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 13:28:50 +0000</pubDate>
		<dc:creator>Casey Bisson</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[callgrind]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Rasmus Lerdorf]]></category>
		<category><![CDATA[scaling]]></category>
		<category><![CDATA[scaling, php2008]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://maisonbisson.com/blog/post/11407/</guid>
		<description><![CDATA[
This two year old post about Rasmus Lerdorf&#8217;s PHP scaling tips (slides) is interesting in the context of what we&#8217;ve learned since then. APC now seems common, and it&#8217;s supposedly built-in to PHP6. Still, I&#8217;d be interested in seeing an update. Are MySQL prepared statements still slow?
And that&#8217;s where Rasmus&#8217; latest presentation comes in. We [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="maisonbisson-11407"><!-- &nbsp; --></abbr>
<p>This two year old post about <a title="Rasmus Lerdorf on scaling web apps with PHP" href="http://www.niallkennedy.com/blog/archives/2006/07/rasmus-lerdorf-php-web20.html">Rasmus Lerdorf&#8217;s PHP scaling tips</a> (<a href="http://talks.php.net/show/oscon06/0">slides</a>) is interesting in the context of what we&#8217;ve learned since then. <a href="http://pecl.php.net/package/APC">APC</a> now seems common, and it&#8217;s supposedly built-in to PHP6. Still, I&#8217;d be interested in seeing an update. Are MySQL prepared statements still slow?</p>
<p>And that&#8217;s where <a href="http://talks.php.net/show/drupal08/">Rasmus&#8217; latest presentation</a> comes in. We don&#8217;t learn anything about MySQL prepared statements, but we do learn how to find choke points in our applications using callgrind and other tools. In his examples, he can do a little over 600 transactions per second with both static HTML <em>and</em> simple PHP, but various frameworks &#8212; with many inclusions and function calls &#8212; can slow that to under 50 transactions per second (I suppose they&#8217;d explain that in a <a href="http://en.wikipedia.org/wiki/Office_Space">TPS report</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://maisonbisson.com/blog/post/11407/scaling-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speedy PHP: Intermediate Code Caching</title>
		<link>http://maisonbisson.com/blog/post/10970/speedy-php-intermediate-code-caching/</link>
		<comments>http://maisonbisson.com/blog/post/10970/speedy-php-intermediate-code-caching/#comments</comments>
		<pubDate>Thu, 31 May 2007 15:10:08 +0000</pubDate>
		<dc:creator>Casey Bisson</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[acceleration]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[intermediate code cache]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scaling]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://maisonbisson.com/blog/post/10970/#speedy-php-intermediate-code-caching</guid>
		<description><![CDATA[
I&#8217;ve been working on MySQL optimization for a while, and though there&#8217;s still more to done on that front, I&#8217;ve gotten to the point where the the cumulative query times make up less than half of the page generation time.
So I&#8217;m optimizing code when the solution is obvious (and I hope to rope Zach into [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="maisonbisson-10970"><!-- &nbsp; --></abbr>
<p>I&#8217;ve been working on MySQL optimization for a while, and though there&#8217;s still more to done on that front, I&#8217;ve gotten to the point where the the cumulative query times make up less than half of the page generation time.</p>
<p>So I&#8217;m optimizing code when the solution is obvious (and I hope to rope <a href="http://nosheep.net/">Zach</a> into giving the code a performance audit soon), but I&#8217;m also looking at optimizing how PHP works.</p>
<p>Once upon a time, most of us ran PHP as a CGI, and every time a request came in, the PHP interpreter would have to launch, read/compile/execute the script, then spit out the result and shutdown. Now (hopefully) everybody&#8217;s running PHP as an Apache module, so all the time spent launching the interpreter, allocating memory and other resources for it, and then shutting it down and cleaning up after it, is done just once for each thread of Apache.</p>
<p>It might not sound like much, but I had a chance to compare CGI vs. module performance recently and found that a fairly simple, but frequently accessed script running as a CGI completely swamped a server as a CGI (creating a load average over 20), but was hardly noticed when running as a module. </p>
<p>But even as a module, the PHP scripts still need to be interpreted and compiled before they can be executed. And because of the way PHP works, this is done every time the page/script is requested.</p>
<p>Java programmers, among others, criticize PHP for this, but that <a href="http://www.37signals.com/svn/archives2/fear_shark_attacks_and_will_it_scale.php">small inefficiency</a> is part of what makes PHP so easy to use (and popular). And that ease of use means people are building some really interesting <a href="http://gettingreal.37signals.com/ch04_Scale_Later.php">apps worth scaling</a>.</p>
<p>Anyway, there&#8217;s a solution to eliminate that inefficiency in PHP: intermediate code caching.</p>
<p>By caching the executable code generated by the interpreter, then the using the cached copy instead of the source script for the next request, you can enjoy the benefits of PHP&#8217;s easy development and compiled code&#8217;s fast execution time. A number of projects all promise anywhere from double to 10X jump in performance.</p>
<ul>
<li><a href="http://www.php-accelerator.co.uk/" title="The ionCube PHP Accelerator: Home">ionCube PHP Accelerator</a><br />This has the most recognizable “brand,” and some hosting providers even offer it, but it&#8217;s offered <a href="http://phprpms.sourceforge.net/phpa">only in binary form</a> and <a href="http://www.php-accelerator.co.uk/faq.php#license">the license</a> seems intentionally ambiguous (um, <a href="http://www.fsf.org/licensing/essays/free-sw.html">not free</a>?).</li>
<li><a href="http://sourceforge.net/projects/turck-mmcache/" title="SourceForge.net: Turck MMCache for PHP">Turck MMCache for PHP</a><br />Has a good <a href="http://turck-mmcache.sourceforge.net/index_old.html">performance chart</a>, and is GPL&#8217;d, but development appears to have ended in 2003.</li>
<li><a href="http://web.archive.org/web/20040401135239/bwcache.bware.it/cache.htm">afterBURNERr*Cache</a><br />Yeah, I had to point to a page in the Wayback Machine, this project is dead.</li>
<li><a href="http://www.zend.com/products/zend_platform/">Zend Platform Performance Suite</a><br />A commercial suite that includes <a href="http://www.zend.com/products/zend_platform/features_comparison">piles of goodies</a>, if you pay.</li>
<li><a href="http://pecl.php.net/package/apc" title="PECL :: Package :: APC">APC: Alternative PHP Cache</a><br />It&#8217;s under active development and includes Rasmus Lerdorf, the guy who created PHP, among the project leads. License: <a href="http://www.php.net/license/2_02.txt">BSD-style</a> (<a href="http://www.gnu.org/philosophy/license-list.html">non-copyleft</a>)</li>
</ul>
<p>I haven&#8217;t actually tried any of these yet, but I&#8217;m looking for information and suggestions, and I&#8217;m likely to try APC, maybe even Zend soon. Just as soon as I make an app compelling enough (and large enough) to need it.</p>
<p><tags>php, caching, acceleration, zend, apc, intermediate code cache, optimization, scaling, web applications</tags></p>
]]></content:encoded>
			<wfw:commentRss>http://maisonbisson.com/blog/post/10970/speedy-php-intermediate-code-caching/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>