<?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>BenScobie.com</title>
	<atom:link href="http://www.benscobie.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benscobie.com</link>
	<description></description>
	<lastBuildDate>Sat, 21 Aug 2010 23:52:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>WP Super Cache Benchmarks</title>
		<link>http://www.benscobie.com/wp-super-cache-benchmarks/</link>
		<comments>http://www.benscobie.com/wp-super-cache-benchmarks/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 19:46:58 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[compressed]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[wp super cache]]></category>

		<guid isPermaLink="false">http://benscobie.com/?p=5</guid>
		<description><![CDATA[Today I will be covering the amazing plugin WP Super Cache. If you&#8217;re ever listed on the front page of Digg or some other popular social media website your going to get flooded with visitors, which in turn will put a lot of pressure on your server to keep up with all the requests. On [...]]]></description>
			<content:encoded><![CDATA[<p>Today I will be covering the amazing plugin <a rel="nofollow" href="http://wordpress.org/extend/plugins/wp-super-cache/" target="_blank">WP Super Cache</a>. If you&#8217;re ever listed on the front page of Digg or some other popular  social media website your going to get flooded with visitors, which in  turn will put a lot of pressure on your server to keep up with all the  requests. On every page view PHP and MySQL is called and things are  executed, this can put a lot of strain on your server if you happen to  have a lot of active users. This is where WP Super Cache comes in.</p>
<p>WP Super Cache reduces this strain by storing a static HTML version of the current pages and posts. This In turn means that MySQL is called fewer times thus reducing the strain. When the page changes, such as when someone comments or the post is altered, this HTML cache is simply updated.</p>
<p>I&#8217;ve also included benchmarks so you can compare the different options it has.</p>
<p><span id="more-5"></span></p>
<p>Lets get started!</p>
<hr />WP Super Cache has three different modes:</p>
<p><strong>Off Mode<br />
</strong></p>
<p>When this option is enabled WP Super Cache is completely disabled, really only useful if you&#8217;re having problems with it.</p>
<p>I&#8217;m benchmarking this site with the <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">Apache HTTP server benchmarking tool</a> from another VPS in the same data center, running the benchmark from the same server would only give inaccurate results. I&#8217;ve also left the number of requests low otherwise the benchmark would take too long to run. I probably should mention the command I&#8217;m using  so here you are:</p>
<blockquote><p>ab -c 5 -n 1000 http://benscobie.com/</p></blockquote>
<p>The Requests per second is what we&#8217;re mainly looking at:</p>
<blockquote><p>Concurrency Level:      5<br />
Time taken for tests:   62.744147 seconds<br />
Complete requests:      1000<br />
Failed requests:        87<br />
(Connect: 0, Length: 87, Exceptions: 0)<br />
Write errors:           0<br />
Total transferred:      4959906 bytes<br />
HTML transferred:       4674906 bytes<br />
<strong>Requests per second:    15.94 [#/sec] (mean)</strong><br />
Time per request:       313.721 [ms] (mean)<br />
Time per request:       62.744 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          77.19 [Kbytes/sec] received</p></blockquote>
<p><strong>Half-on Mode</strong></p>
<p>When this option is enabled static HTML files are generated so the database doesn&#8217;t need to be called, however the PHP engine still needs to be loaded to serve the cached files. Your blog however will still load a lot faster.</p>
<p>I&#8217;ve chosen to go with 10000 requests this time to get a better average:</p>
<blockquote><p>Concurrency Level:      5<br />
Time taken for tests:   34.855934 seconds<br />
Complete requests:      10000<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      51030000 bytes<br />
HTML transferred:       47980000 bytes<br />
<strong>Requests per second:    286.90 [#/sec] (mean)</strong><br />
Time per request:       17.428 [ms] (mean)<br />
Time per request:       3.486 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          1429.68 [Kbytes/sec] received</p></blockquote>
<p>As you can see with just the Half-mode turned on the site can handle nearly 18x more requests than without it.</p>
<p><strong>On Mode</strong></p>
<p>This option is like the Half-On mode above but it gets around having to call the PHP engine, which in turn will help speed up your site even more. It also adds a few more features such as having the option to preload the cache. You can also enable Super Cache Compression which will compress your HTML files on the first page request and serve these to your visitors. This is a much better option to use because turning on something such as zlib compression will waste CPU cycles and will be served a tad slower, this is because the HTML file has to be compressed on every page view.</p>
<p>When I first ran this benchmark using the On mode a few days ago I didn&#8217;t get amazing results like this, maybe I had Super Cache Compression turned off, but here you go(This was with Super Cache Compression enabled):</p>
<blockquote><p>Concurrency Level:      5<br />
Time taken for tests:   4.835772 seconds<br />
Complete requests:      10000<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      51870000 bytes<br />
HTML transferred:       48180000 bytes<br />
<strong>Requests per second:    2067.92 [#/sec] (mean)</strong><br />
Time per request:       2.418 [ms] (mean)<br />
Time per request:       0.484 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          10474.85 [Kbytes/sec] received</p></blockquote>
<p>That&#8217;s a staggering 7x more requests than the Half-on mode and nearly 130x more requests than with the plugin disabled. Now if your site got featured on the first page of Digg your server should be able to cope with the amount of requests you&#8217;ll receive!</p>
<p>Another thing that came to mind was that I could setup Nginx behind Apache to serve the HTML files and let Apache do everything else, I should be able to squeeze a lot more requests out of that. I haven&#8217;t learnt how to do something like that just yet but when I do I&#8217;ll post the results. Also if anybody has any good tutorials on how to do this could you please post them below too! :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benscobie.com/wp-super-cache-benchmarks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
