<?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>Saiweb &#187; cache</title>
	<atom:link href="http://www.saiweb.co.uk/tag/cache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.saiweb.co.uk</link>
	<description>Ramblings of a Sys admin</description>
	<lastBuildDate>Mon, 06 Feb 2012 14:57:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Make your webapp shine with varnish – Part 2 backends</title>
		<link>http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-%e2%80%93-part-2-backends</link>
		<comments>http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-%e2%80%93-part-2-backends#comments</comments>
		<pubDate>Sat, 18 Jun 2011 12:09:39 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[high]]></category>
		<category><![CDATA[performance.]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=1039</guid>
		<description><![CDATA[Pre-req reading: Part 1 In this part we will cover setting up a backend. A backend is your application server, whether this be apache / nginx / iis (IIS &#8211; Is Inherently Stupid) you are telling varnish where it should sends it&#8217;s requests to. Very basic configuration 1234.backend app1 { &#160; &#160; .host = &#34;127.0.0.1&#34;; [...]]]></description>
			<content:encoded><![CDATA[<p>Pre-req reading: <a href="http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-part-1">Part 1</a></p>
<p>In this part we will cover setting up a backend. A backend is your application server, whether this be apache / nginx / iis (IIS &#8211; <strong>I</strong>s <strong>I</strong>nherently <strong>S</strong>tupid) you are telling varnish where it should sends it&#8217;s requests to.<br />
<strong><br />
Very basic configuration</strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.backend app1 {<br />
&nbsp; &nbsp; .host = &quot;127.0.0.1&quot;;<br />
&nbsp; &nbsp; .port = &quot;8080;&quot;<br />
}</div></td></tr></tbody></table></div>
<p>For a quick start that&#8217;s it really you tell varnish a backend and the port to connect to it on &#8230; just make sure you use it in vcl_recv, but you&#8217;re not here for simple and quick start are you? lets add the following.</p>
<ul>
<li>timeout settings</li>
<li>probe settings</li>
</ul>
<p><strong>Timeout settings</strong></p>
<p>Your timeout settings deinf how long varnish should wait for a response from your backend</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.backend app1 {<br />
&nbsp; &nbsp; .host = &quot;127.0.0.1&quot;;<br />
&nbsp; &nbsp; .port = &quot;8080;&quot;<br />
&nbsp; &nbsp; .connect_timeout = 0.05s;<br />
&nbsp; &nbsp; .first_byte_timeout = 2s;<br />
&nbsp; &nbsp; .between_bytes_timeout = 2s;<br />
}</div></td></tr></tbody></table></div>
<ul>
<li><strong>connect_timeout</strong> wait 50ms for a tcp connection to take place</li>
<li><strong>first_byte_timeout</strong> wait 2s for the first byte of data to be sent from the backend</li>
<li><strong>between_bytes_timeout</strong> wait 2s if there is a pause mid data stream</li>
</ul>
<p>Timeouts are a basic way of determining if a backend is down / miss behaving if you have multiple backends if timeouts occur then the backend is marked as sick and the other backends will be used.</p>
<p><strong>probe settings &#8211; Trust me I&#8217;m a doctor</strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.backend app1 {<br />
&nbsp; &nbsp; .host = &quot;127.0.0.1&quot;;<br />
&nbsp; &nbsp; .port = &quot;8080;&quot;<br />
&nbsp; &nbsp; .connect_timeout = 0.05s;<br />
&nbsp; &nbsp; .first_byte_timeout = 2s;<br />
&nbsp; &nbsp; .between_bytes_timeout = 2s;<br />
&nbsp; &nbsp; .probe = {<br />
&nbsp; &nbsp; .url = &quot;/status.html&quot;;<br />
&nbsp; &nbsp; .timeout = 0.05s;<br />
&nbsp; &nbsp; .window = 5;&nbsp; &nbsp; <br />
&nbsp; &nbsp; .threshold = 3; #60% of last checks must of been OK for this backend to be healthy<br />
&nbsp; &nbsp; .interval = 2s; #how often to run the checks<br />
&nbsp; &nbsp; }<br />
}</div></td></tr></tbody></table></div>
<ul>
<li><strong>url</strong> the URL to to query this must return a 200 OK response, you could use a php script to return a 500 on say a mySQL outage</li>
<li><strong>timeout</strong> how long to wait for a 200 OK response from the URL</li>
<li><strong>window</strong> keep the result of the last 5 probes in memory</li>
<li><strong>threshold</strong> how many of the window total must be OK for the backend to be &#8220;healthy&#8221;</li>
<li><strong>interval</strong> how often to run the probe</li>
</ul>
<p>And that about wraps up this post.<span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-%e2%80%93-part-2-backends" data-text="Make your webapp shine with varnish – Part 2 backends" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Fmake-your-webapp-shine-with-varnish-%25e2%2580%2593-part-2-backends&#038;text=Make%20your%20webapp%20shine%20with%20varnish%20%E2%80%93%20Part%202%20backends" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-%e2%80%93-part-2-backends/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make your webapp shine with varnish &#8211; Part 1</title>
		<link>http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-part-1</link>
		<comments>http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-part-1#comments</comments>
		<pubDate>Tue, 12 Oct 2010 12:56:55 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[high]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[performance.]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=957</guid>
		<description><![CDATA[Part 1, what is varnish? The varnish cache project is one you really need to get familiar with if you manage any high volume websites, it can mean the difference between a self destructing web app that buckles under it&#8217;s own load, and an apparently seamless web app serving 1000&#8242;s of concurrent connections per second [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Part 1, what is varnish?</strong></p>
<p>The <a href="www.varnish-cache.org">varnish cache project</a> is one you really need to get familiar with if you manage any high volume websites, it can mean the difference between a self destructing web app that buckles under it&#8217;s own load, and an apparently seamless web app serving 1000&#8242;s of concurrent connections per second with relative ease.</p>
<p><strong>How does it work?</strong></p>
<p>Varnish acts as a proxy server, in that when a use sends a GET request varnish will lookup in its internal database for a cached version and if it can not find one it will pass the request to the &#8220;back end&#8221; or in this case an apache server, varnish will then cache the response for subsequent accesses.</p>
<p>Now you may ask yourself why do you need this? this boils down to what you are trying to achieve with your web application, if your application is heavily reliant on dynamic content and regularly gets some 400 concurrent users for example, lets assume the following:</p>
<ol>
<li>400 concurrent unique users</li>
<li>Average page render time is 0.85s</li>
</ol>
<p><strong>The Math</strong></p>
<p>Based on this if you were to place varnish in front of your application with a 60second ttl (time to live, length of time varnish will hold an object in cache):</p>
<ol>
<li>Varnish ttl 60 seconds</li>
<li>400/0.85 = 470.59/second</li>
<li>28235.29/minute</li>
<li>Factor of reduction to &#8220;back end&#8221;: x28235.29</li>
</ol>
<p>So in the example above simply by caching a page for as little as 60 seconds, the requests/minute as reduced from 28235.29 to 1, now even reducing the cache times to 10 seconds in this example would give a x4705.88 reduction.</p>
<p>How is this reduction a good thing, well time on cpu for one, varnish when configured correctly is very very fast, and even with an out of the box configuration it&#8217;s still going to be much faster than your dynamic web application.</p>
<p><strong>Summary</strong></p>
<p>So here ends a brief introduction to varnish and why you realy want to start using it, in the following parts we will cover</p>
<ul>
<li>Configuration overview</li>
<ul>
<li>brief overview of each sub section based on the 2.1 syntax</li>
</ul>
<ul>
<li>Advanced configuration</li>
<ul>
<li>Load balancing</li>
<li>Failover handling</li>
<li>Raising cache hitrate</li>
<li>Pros and cons of each setup</li>
<li>Benchmarks</li>
</ul>
</ul>
</ul>
<p><span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-part-1" data-text="Make your webapp shine with varnish &#8211; Part 1" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Fmake-your-webapp-shine-with-varnish-part-1&#038;text=Make%20your%20webapp%20shine%20with%20varnish%20%26%238211%3B%20Part%201" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/make-your-webapp-shine-with-varnish-part-1/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP &amp; Caching an in depth review.</title>
		<link>http://www.saiweb.co.uk/hosting/php-caching-an-in-depth-review</link>
		<comments>http://www.saiweb.co.uk/hosting/php-caching-an-in-depth-review#comments</comments>
		<pubDate>Thu, 26 Aug 2010 18:11:59 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[faster]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=800</guid>
		<description><![CDATA[Sounds simple enough, right? Use a cache to serve pages faster, well yes that is true but people often do not realize the fundamentals of caching and how if not done properly it can lead to a detriment in performance. The first thing you need to realize that by caching your content is no longer [...]]]></description>
			<content:encoded><![CDATA[<p>Sounds simple enough, right?</p>
<p>Use a cache to serve pages faster, well yes that is true but people often do not realize the fundamentals of caching and how if not done properly it can lead to a detriment in performance.</p>
<p>The first thing you need to realize that by caching your content is no longer dynamic, &#8230; (short pause while we wait for the outrage in the back to die down).</p>
<p>The whole point behind your cache is that it will be used instead of processing all your code, why this is beneficial?</p>
<p>You have to remember that PHP is an interpreted language, meaning it takes the following I/O flow:</p>
<p>Apache -&gt; mod_php -&gt; Script -&gt; Interpreter -&gt; Bytecode -&gt; Execution -&gt; Output Buffer</p>
<p>Now there are two types of caching to consider, the first is completion output caching, this also yields the best performance, the second is opcode caching, this caches the byte code generated by the interpreter thus removing that step from the chain of execution.</p>
<p>With me so far? Ok take a deep breath because here we go &#8230;</p>
<p><strong>Output caching</strong></p>
<p>This option often yields the best performance, but at the cost of removing the dynamic element from your web app.<br />
But this can be summed up in a single line: What good is dynamic content if you can serve all of 5% of your audience at a given time?</p>
<p>Another turn of phrase is &#8220;The slashdot effect&#8221;, there are many options for output caching, and you should ideally provide gziped and plain cache files to your end user,  for instance on this blog I use WP Super Cache, and can high recommend it, as new content is posted the relevant caches are regenerated, if you are writing your own WebApp check for the &#8220;Accept-Encoding:gzip&#8221; header being sent via the users browser.</p>
<p>For end user transparency couple this with some mod_rewrite voodoo</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">RewriteCond %{HTTP:Accept-Encoding} gzip<br />
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/%{REQUEST_FILENAME}.gz -f<br />
RewriteRule ^(.*) &quot;/cache/%{HTTP_HOST}/%{REQUEST_FILENAME}.gz&quot; [L]</div></td></tr></tbody></table></div>
<p>1: If gzip is supported<br />
2: and the cache file exists<br />
3: Redirect visitor to compressed cached file</p>
<p>You &#8220;chain of execution&#8221; is now</p>
<p>Apache -&gt; readfile</p>
<p>To serve non gziped content:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">RewriteCond %{HTTP:Accept-Encoding} !gzip<br />
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/%{REQUEST_FILENAME} -f<br />
RewriteRule ^(.*) &quot;/cache/%{HTTP_HOST}/%{REQUEST_FILENAME}&quot; [L]</div></td></tr></tbody></table></div>
<p>Now to clarify a point you should not be caching images,css,js etc, we&#8217;re only covering dynamic content here, and the above are only examples to get you started, you should write rules to exclude certain content specific to your needs.</p>
<p>And before going of at any more of a tangent, here are some figures for you!</p>
<p><strong>ab -c 100 -n 500 -g ./saiweb-nocache-nogzip.bpl http://www.saiweb.co.uk/</strong></p>
<ul>
<li>No caching</li>
<li>No Gzip</li>
</ul>
<p>Server Hostname:        www.saiweb.co.uk<br />
Server Port:            80</p>
<p>Document Path:          /<br />
Document Length:        109086 bytes</p>
<p>Concurrency Level:      100<br />
Time taken for tests:   123.304 seconds<br />
Complete requests:      500<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      54831652 bytes<br />
HTML transferred:       54692607 bytes<br />
Requests per second:    4.06 [#/sec] (mean)<br />
Time per request:       24660.828 [ms] (mean)<br />
Time per request:       246.608 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          434.26 [Kbytes/sec] received</p>
<p>Connection Times (ms)<br />
min  mean[+/-sd] median   max<br />
Connect:       57  423 225.5    374    1837<br />
Processing:  2331 20460 16701.2  17232  115192<br />
Waiting:      270 1835 4155.8    576   38549<br />
Total:       2656 20882 16648.1  17692  115421</p>
<p>Percentage of the requests served within a certain time (ms)<br />
50%  17692<br />
66%  20700<br />
75%  24063<br />
80%  25770<br />
90%  35157<br />
95%  53328<br />
98%  82957<br />
99%  101497<br />
100%  115421 (longest request)</p>
<p><a href="http://cdn.saiweb.co.uk/wp-content/uploads/2010/08/saiweb-nocache-nogzip.png"><img class="aligncenter size-full wp-image-939" title="saiweb-nocache-nogzip" src="http://cdn.saiweb.co.uk/wp-content/uploads/2010/08/saiweb-nocache-nogzip.png" alt="" width="640" height="480" /></a></p>
<p>As can be seen as the number of requests grew the response time began to increase sharply and the overall performace of the site degrade, bare in mind these benchmarks are being made on my home DSL for the time being.</p>
<p><strong><br />
ab -c 100 -n 500 -g ./saiweb-cached.bpl http://www.saiweb.co.uk/</strong></p>
<p>Server Hostname:        www.saiweb.co.uk<br />
Server Port:            80</p>
<p>Document Path:          /<br />
Document Length:        109086 bytes</p>
<p>Concurrency Level:      100<br />
Time taken for tests:   79.212 seconds<br />
Complete requests:      500<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      54889292 bytes<br />
HTML transferred:       54705058 bytes<br />
Requests per second:    6.31 [#/sec] (mean)<br />
Time per request:       15842.342 [ms] (mean)<br />
Time per request:       158.423 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          676.70 [Kbytes/sec] received</p>
<p>Connection Times (ms)<br />
              min  mean[+/-sd] median   max<br />
Connect:       56  314 112.5    322    1341<br />
Processing:  2545 14721 5116.7  14296   36677<br />
Waiting:      216 1283 2228.2    351   13776<br />
Total:       2647 15035 5108.9  14624   36897</p>
<p>Percentage of the requests served within a certain time (ms)<br />
  50%  14624<br />
  66%  16675<br />
  75%  18058<br />
  80%  19093<br />
  90%  21608<br />
  95%  23489<br />
  98%  27684<br />
  99%  29972<br />
 100%  36897 (longest request)</p>
<p><a href="http://cdn.saiweb.co.uk/wp-content/uploads/2010/08/saiweb-cached1.png"><img src="http://cdn.saiweb.co.uk/wp-content/uploads/2010/08/saiweb-cached1.png" alt="" title="saiweb-cached" width="640" height="480" class="aligncenter size-full wp-image-941" /></a></p>
<p>A much more consistent line here, however as you can clearly see response times are roughly equal this is due to my DSL connection, so lets run these tests from somewhere with a little more bandwidth say the webserver itself using a loop back connection.</p>
<p><strong><br />
ab -c 100 -n 500 -g ./saiweb-cached.bpl http://www.saiweb.co.uk/</strong></p>
<p>Server Hostname:        www.saiweb.co.uk<br />
Server Port:            80</p>
<p>Document Path:          /<br />
Document Length:        109086 bytes</p>
<p>Concurrency Level:      100<br />
Time taken for tests:   0.262199 seconds<br />
Complete requests:      500<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      54945406 bytes<br />
HTML transferred:       54761172 bytes<br />
Requests per second:    1906.95 [#/sec] (mean)<br />
Time per request:       52.440 [ms] (mean)<br />
Time per request:       0.524 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          204642.27 [Kbytes/sec] received</p>
<p>Connection Times (ms)<br />
              min  mean[+/-sd] median   max<br />
Connect:        0    1   2.6      0       9<br />
Processing:     4   45  10.3     49      58<br />
Waiting:        1   38   9.9     41      50<br />
Total:          9   47   9.5     50      64</p>
<p>Percentage of the requests served within a certain time (ms)<br />
  50%     50<br />
  66%     51<br />
  75%     52<br />
  80%     52<br />
  90%     54<br />
  95%     56<br />
  98%     59<br />
  99%     61<br />
 100%     64 (longest request)</p>
<p><a href="http://cdn.saiweb.co.uk/wp-content/uploads/2010/08/saiweb-cached21.png"><img src="http://cdn.saiweb.co.uk/wp-content/uploads/2010/08/saiweb-cached21.png" alt="" title="saiweb-cached2" width="640" height="480" class="aligncenter size-full wp-image-943" /></a></p>
<p>In this case the response times rise and then plateau, no after which no further degradation occurs. </p>
<p><strong><br />
ab -c 100 -n 500 -g ./saiweb-nocache.bpl http://www.saiweb.co.uk/</strong></p>
<p>Server Hostname:        www.saiweb.co.uk<br />
Server Port:            80</p>
<p>Document Path:          /<br />
Document Length:        109086 bytes</p>
<p>Concurrency Level:      100<br />
Time taken for tests:   8.919565 seconds<br />
Complete requests:      500<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      54680788 bytes<br />
HTML transferred:       54543000 bytes<br />
Requests per second:    56.06 [#/sec] (mean)<br />
Time per request:       1783.913 [ms] (mean)<br />
Time per request:       17.839 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          5986.73 [Kbytes/sec] received</p>
<p>Connection Times (ms)<br />
              min  mean[+/-sd] median   max<br />
Connect:        0   14  30.7      0      85<br />
Processing:   246 1556 714.3   1365    6735<br />
Waiting:      241 1539 707.8   1360    6731<br />
Total:        250 1571 708.0   1368    6735</p>
<p>Percentage of the requests served within a certain time (ms)<br />
  50%   1368<br />
  66%   1451<br />
  75%   1550<br />
  80%   1700<br />
  90%   2658<br />
  95%   3121<br />
  98%   3491<br />
  99%   3638<br />
 100%   6735 (longest request)</p>
<p><a href="http://cdn.saiweb.co.uk/wp-content/uploads/2010/08/saiweb-cached3.png"><img src="http://cdn.saiweb.co.uk/wp-content/uploads/2010/08/saiweb-cached3.png" alt="" title="saiweb-cached3" width="640" height="480" class="aligncenter size-full wp-image-944" /></a></p>
<p>Oh dear of dear lets cut to the hard facts shall we?</p>
<p>We&#8217;ve gone from serving 1906.95 requests a second to 56.06 </p>
<ul>
<li>a 97.1% decrease in performance when removing caching</li>
<li>or a 3401.1% increase in performance when implementing caching</li>
</ul>
<p>We&#8217;ve gone from a response time of ~50ms to ~2000ms</p>
<ul>
<li>a 97.5% decrease in performance when removing caching</li>
<li>or a 4000% increase in performance when caching is on</li>
</ul>
<p>Then there is the CPU an memory overheads to consider, in this case a more prolonged test is required to gain the relevant sar data,<br />
now let me tell you that intentionally trying to get a test like this to run over a 10 minute period with the correct caching on is a lot harder than it sounds, the tests infact were completing far too quickly &#8230; </p>
<p>The problem I face is to make ab perform a long enough timed duration of results cached, I know for a fact uncached the server will fail under the load, so I have no way at present of grabbing this reliably, </p>
<p>what I can tell you is that this command: ab -c 300 -n 1000000 -g ./saiweb-cached.bpl http://www.saiweb.co.uk/</p>
<p>caused a load average of 2.96, 1.9,0.93 cache, and got as high as 21 before I killed it uncached.</p>
<p>Now I am going to bring this post to an end as it is getting quiet long, I plan to cover the following in a 2nd part.</p>
<ol>
<li>Opcode caching</li>
<li>CPU &#038; Memory usage, Cached vs. UNcached</li>
</ol>
<p><span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/hosting/php-caching-an-in-depth-review" data-text="PHP &#038; Caching an in depth review." href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Fhosting%2Fphp-caching-an-in-depth-review&#038;text=PHP%20%26%23038%3B%20Caching%20an%20in%20depth%20review." >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/hosting/php-caching-an-in-depth-review/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE7, Internet Explorer 7, Clear Cache</title>
		<link>http://www.saiweb.co.uk/windows/ie7-internet-explorer-7-clear-cache</link>
		<comments>http://www.saiweb.co.uk/windows/ie7-internet-explorer-7-clear-cache#comments</comments>
		<pubDate>Wed, 04 Mar 2009 11:03:10 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[clear cache]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=589</guid>
		<description><![CDATA[Some users apparently do not know how to clear their Internet Explorer cache, so I have taken two minutes to do a screen cast here: http://screencast.com/t/FGDnc2gjcft WPFP(document).ready(function() { //load player $f("saiweb_8d4c21ed6cc4f013cb4ed4ba21443531", "/wp-content/plugins/wordpress-flowplayer/flowplayer/gpl/flowplayer-3.1.5.swf", { plugins: { controls: { sliderGradient: 'none', progressGradient: 'medium', backgroundColor: '#141648', backgroundGradient: 'none', bufferGradient: 'none', opacity:1.0 } }, clip: { url:'http://content.screencast.com/users/D.Busby/folders/Jing/media/1bc86df6-fcb6-4f36-a369-5fa94b24ea24/00000107.mp4', autoPlay: false, [...]]]></description>
			<content:encoded><![CDATA[<p>Some users apparently do not know how to clear their Internet Explorer cache, so I have taken two minutes to do a screen cast here: <a href="http://screencast.com/t/FGDnc2gjcft">http://screencast.com/t/FGDnc2gjcft</a></p>
<p><div id="saiweb_a45db7c2d76306a4b6c1a5d006724b91" style="width:400px; height:325px;"></div><script language="Javascript" type="text/javascript">
	WPFP(document).ready(function() {
		//load player
		$f("saiweb_a45db7c2d76306a4b6c1a5d006724b91", "/wp-content/plugins/wordpress-flowplayer/flowplayer/gpl/flowplayer-3.1.5.swf", {
				plugins: {
  					 controls: {    					
      					
      					
      					
      					sliderGradient: 'none',
      					progressGradient: 'medium',
      					
      					
      					backgroundColor: '#141648',
      					
      					
      					backgroundGradient: 'none',
      					bufferGradient: 'none',
   						opacity:1.0
   						}
				},
			clip: {
					url:'http://content.screencast.com/users/D.Busby/folders/Jing/media/1bc86df6-fcb6-4f36-a369-5fa94b24ea24/00000107.mp4',
					autoPlay: false,
       				autoBuffering: false
				},
				canvas: {
					backgroundColor:''
				}})
			});</script>
				<span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/windows/ie7-internet-explorer-7-clear-cache" data-text="IE7, Internet Explorer 7, Clear Cache" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Fwindows%2Fie7-internet-explorer-7-clear-cache&#038;text=IE7%2C%20Internet%20Explorer%207%2C%20Clear%20Cache" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/windows/ie7-internet-explorer-7-clear-cache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://content.screencast.com/users/D.Busby/folders/Jing/media/1bc86df6-fcb6-4f36-a369-5fa94b24ea24/00000107.mp4" length="4168506" type="video/mp4" />
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 10/34 queries in 0.068 seconds using apc
Object Caching 952/1016 objects using apc
Content Delivery Network via Rackspace Cloud Files: cdn.saiweb.co.uk

Served from: www.saiweb.co.uk @ 2012-02-08 13:37:22 -->
