<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Cain Manor</title>
	
	<link>http://cainmanor.com</link>
	<description>Your Guide To All Things Cain™</description>
	<lastBuildDate>Wed, 08 Sep 2010 19:25:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CainManor" /><feedburner:info uri="cainmanor" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Basic Samba-Active Directory troubleshooting using wbinfo</title>
		<link>http://feedproxy.google.com/~r/CainManor/~3/1Rx1nF85q8c/basic-samba-active-directory-troubleshooting-using-wbinfo</link>
		<comments>http://cainmanor.com/tech/basic-samba-active-directory-troubleshooting-using-wbinfo#comments</comments>
		<pubDate>Wed, 08 Sep 2010 19:25:39 +0000</pubDate>
		<dc:creator>Greg Cain</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://cainmanor.com/?p=1146</guid>
		<description><![CDATA[This document is intended to step you through some of the basics of troubleshooting samba connectivity with your domain controller, using wbinfo.   This is not intended to show you how to configure Samba to talk to your domain controller.  Others have done a much better job that I can. winbind must be running in [...]]]></description>
			<content:encoded><![CDATA[<p>This document is intended to step you through some of the basics of troubleshooting samba connectivity with your domain controller, using wbinfo.   This is not intended to show you how to configure Samba to talk to your domain controller.  Others have done a much better job that I can.</p>
<p>winbind must be running in order for wbinfo to work, and you need to be connected to your domain.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-p</span>
Ping to winbindd succeeded on fd <span style="color: #000000;">4</span></pre></div></div>
<p>A simple ping test to see if your DC is alive</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-t</span>
checking the trust secret via RPC calls succeeded</pre></div></div>
<p>Verify that the workstation trust account created when the Samba server is added to the Windows NT domain is working.  This is a good first step to make sure you can talk to your DC<br />
<span id="more-1146"></span></p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-u</span></pre></div></div>
<p>This will list your domain users.   Make sure the users you expect are there</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-a</span> greg.cain<span style="color: #000000; font-weight: bold;">%</span>password</pre></div></div>
<p>This is an easy way to check that your user can authenticate against the domain.  However, I&#8217;d recommend against using it since it will show your password on the command line, in your history, and in the ps command if it&#8217;s executed at the right time (there are many other reasons, but those should be enough to dissuade you.)  Use a dummy account if possible.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-g</span></pre></div></div>
<p>Show a list of domain groups.   Again, make sure the groups you expect are present.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-n</span> greg.cain
S-<span style="color: #000000;">1</span>-<span style="color: #000000;">5</span>-<span style="color: #000000;">21</span>-XXXX789314-<span style="color: #000000;">3545391909</span>-<span style="color: #000000;">2802175779</span>-XXXX User <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>
<p>This will get you the SID for the user you&#8217;ve specified (greg.cain in this case.)</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-s</span> S-<span style="color: #000000;">1</span>-<span style="color: #000000;">5</span>-<span style="color: #000000;">21</span>-XXXX789314-<span style="color: #000000;">3545391909</span>-<span style="color: #000000;">2802175779</span>-XXXX
DOMAIN\greg.cain</pre></div></div>
<p>Using the SID you just returned, let&#8217;s make sure the reverse mappings are correct.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-r</span> greg.cain
16XXX216
16XXX217
....</pre></div></div>
<p>This will show a list of groups that the user greg.cain belongs to.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-G</span> 16XXX217
S-<span style="color: #000000;">1</span>-<span style="color: #000000;">5</span>-<span style="color: #000000;">21</span>-<span style="color: #000000;">1540789314</span>-<span style="color: #000000;">3545391909</span>-<span style="color: #000000;">2802175779</span>-YYY</pre></div></div>
<p>This converts the GID to the SID.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wbinfo <span style="color: #660033;">-Y</span> S-<span style="color: #000000;">1</span>-<span style="color: #000000;">5</span>-<span style="color: #000000;">21</span>-<span style="color: #000000;">1540789314</span>-<span style="color: #000000;">3545391909</span>-<span style="color: #000000;">2802175779</span>-YYY
16XXX217</pre></div></div>
<p>This is the reverse mapping of the SID to the GID</p>
<img src="http://feeds.feedburner.com/~r/CainManor/~4/1Rx1nF85q8c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cainmanor.com/tech/basic-samba-active-directory-troubleshooting-using-wbinfo/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cainmanor.com/tech/basic-samba-active-directory-troubleshooting-using-wbinfo</feedburner:origLink></item>
		<item>
		<title>Setup logging for Varnish – The right way</title>
		<link>http://feedproxy.google.com/~r/CainManor/~3/KqYX2b_E904/setup-logging-for-varnish-the-right-way</link>
		<comments>http://cainmanor.com/tech/setup-logging-for-varnish-the-right-way#comments</comments>
		<pubDate>Fri, 30 Jul 2010 02:45:45 +0000</pubDate>
		<dc:creator>Greg Cain</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">http://cainmanor.com/?p=1125</guid>
		<description><![CDATA[Initially, logging Varnish didn&#8217;t really work that well. Varnish, by default, doesn&#8217;t log (varnishncsa can do some logging, but I haven&#8217;t figured that out yet.) I&#8217;ve been parsing my logs with JAWstats, which reads the Apache logs. However, by default, varnish will replace the IP address of the originating client with the IP address of [...]]]></description>
			<content:encoded><![CDATA[<p>Initially, logging Varnish didn&#8217;t really work that well.  Varnish, by default, doesn&#8217;t log (varnishncsa can do some logging, but I haven&#8217;t figured that out yet.)  I&#8217;ve been parsing my logs with JAWstats, which reads the Apache logs.  However, by default, varnish will replace the IP address of the originating client with the IP address of the proxy server, meaning all traffic will look like it comes from my single server.  This is what an entry looks like</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">173.230.157.240 - - <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">29</span><span style="color: #000000; font-weight: bold;">/</span>Jul<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>:<span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">47</span> -0700<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #ff0000;">&quot;GET / HTTP/1.1&quot;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">20046</span> <span style="color: #ff0000;">&quot;-&quot;</span> <span style="color: #ff0000;">&quot;Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)&quot;</span>
173.230.157.240 - - <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">29</span><span style="color: #000000; font-weight: bold;">/</span>Jul<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>:<span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">48</span> -0700<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #ff0000;">&quot;GET / HTTP/1.1&quot;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">20046</span> <span style="color: #ff0000;">&quot;-&quot;</span> <span style="color: #ff0000;">&quot;Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)&quot;</span>
173.230.157.240 - - <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">29</span><span style="color: #000000; font-weight: bold;">/</span>Jul<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>:<span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">49</span> -0700<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #ff0000;">&quot;GET / HTTP/1.1&quot;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">20046</span> <span style="color: #ff0000;">&quot;-&quot;</span> <span style="color: #ff0000;">&quot;Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)&quot;</span>
173.230.157.240 - - <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">29</span><span style="color: #000000; font-weight: bold;">/</span>Jul<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>:<span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">50</span> -0700<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #ff0000;">&quot;GET / HTTP/1.1&quot;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">20046</span> <span style="color: #ff0000;">&quot;-&quot;</span> <span style="color: #ff0000;">&quot;Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)&quot;</span>
Yeah, I made this up, but you get the idea.</pre></div></div>
<p>That&#8217;s no good.   How will I tell that I&#8217;m famous in Sweden?  I found a way to get the client IP information passed to the backend<br />
<span id="more-1125"></span></p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sub vcl_recv <span style="color: #7a0874; font-weight: bold;">&#123;</span>
       remove req.http.X-Forwarded-For;
       <span style="color: #000000; font-weight: bold;">set</span>    req.http.X-Forwarded-For = client.ip;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>
<p>This is what we get from this.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">207.218.231.170, 207.218.231.170 - - <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">29</span><span style="color: #000000; font-weight: bold;">/</span>Jul<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>:<span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">47</span> -0700<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #ff0000;">&quot;GET / HTTP/1.1&quot;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">20046</span> <span style="color: #ff0000;">&quot;-&quot;</span> <span style="color: #ff0000;">&quot;Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)&quot;</span></pre></div></div>
<p>Ok, this is better, but the IP address is duplicated.  I don&#8217;t know if it causes trouble with JAWstats (I assume it does), but I know that it is ugly to me.  After much <a href="https://wiki.fourkitchens.com/display/PF/Workaround+for+Varnish+X-Forwarded-For+bug">googling</a>, I found this…</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sub vcl_recv <span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #666666; font-style: italic;"># 	Rename the incoming XFF header to work around a Varnish bug.</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.http.X-Forwarded-For<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #666666; font-style: italic;">#	Append the client IP</span>
    <span style="color: #000000; font-weight: bold;">set</span> req.http.X-Real-Forwarded-For = req.http.X-Forwarded-For <span style="color: #ff0000;">&quot;, &quot;</span> regsub<span style="color: #7a0874; font-weight: bold;">&#40;</span>client.ip, <span style="color: #ff0000;">&quot;:.*&quot;</span>, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    <span style="color: #7a0874; font-weight: bold;">unset</span> req.http.X-Forwarded-For;
  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">//</span> Simply use the client IP
    <span style="color: #000000; font-weight: bold;">set</span> req.http.X-Real-Forwarded-For = regsub<span style="color: #7a0874; font-weight: bold;">&#40;</span>client.ip, <span style="color: #ff0000;">&quot;:.*&quot;</span>, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>
<p>And finally we have a working log file.    </p>
<p>This is the first log file from this server</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">82.103.128.63 - - <span style="color: #7a0874; font-weight: bold;">&#91;</span>04<span style="color: #000000; font-weight: bold;">/</span>Jul<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>:03:<span style="color: #000000;">57</span>:<span style="color: #000000;">47</span> -0400<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #ff0000;">&quot;GET / HTTP/1.0&quot;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">23301</span> <span style="color: #ff0000;">&quot;-&quot;</span> <span style="color: #ff0000;">&quot;Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)&quot;</span></pre></div></div>
<p>And this is the last</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">24.19.50.69 - - <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">29</span><span style="color: #000000; font-weight: bold;">/</span>Jul<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>:<span style="color: #000000;">19</span>:<span style="color: #000000;">44</span>:<span style="color: #000000;">18</span> -0700<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #ff0000;">&quot;POST /wp-admin/admin-ajax.php HTTP/1.1&quot;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">177</span> <span style="color: #ff0000;">&quot;http://cainmanor.com/wp-admin/post-new.php&quot;</span> <span style="color: #ff0000;">&quot;Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16&quot;</span></pre></div></div>
<img src="http://feeds.feedburner.com/~r/CainManor/~4/KqYX2b_E904" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cainmanor.com/tech/setup-logging-for-varnish-the-right-way/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cainmanor.com/tech/setup-logging-for-varnish-the-right-way</feedburner:origLink></item>
		<item>
		<title>Setup logging for Varnish</title>
		<link>http://feedproxy.google.com/~r/CainManor/~3/tkhaOekD7Xg/setup-logging-for-varnish</link>
		<comments>http://cainmanor.com/tech/setup-logging-for-varnish#comments</comments>
		<pubDate>Sun, 25 Jul 2010 19:10:11 +0000</pubDate>
		<dc:creator>Greg Cain</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">http://cainmanor.com/?p=1123</guid>
		<description><![CDATA[So far, we&#8217;ve got Varnish installed and have a correct default.vcl. Now let&#8217;s make sure AWStats/JAWStats can read them. In your default.vcl, make sure you have this stanza. Otherwise, the Apache log files will only show traffic from your proxy server IP address. This allows the client.ip to be forwarded to your log file. sub [...]]]></description>
			<content:encoded><![CDATA[<p>So far, we&#8217;ve got Varnish <a href="http://cainmanor.com/tech/how-to-use-varnish-cache-with-wordpress">installed</a> and have a correct <a href="http://cainmanor.com/tech/updated-default-vcl">default.vcl</a>.  Now let&#8217;s make sure <a href="http://www.awstats.org/">AWStats</a>/<a href="http://www.jawstats.com/">JAWStats</a> can read them.</p>
<p>In your default.vcl, make sure you have this stanza.  Otherwise, the Apache log files will only show traffic from your proxy server IP address.  This allows the client.ip to be forwarded to your log file.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sub vcl_recv <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Add a unique header containing the client address</span>
  remove req.http.X-Forwarded-For;
  <span style="color: #000000; font-weight: bold;">set</span>    req.http.X-Forwarded-For = client.ip;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>
<p> <span id="more-1123"></span><br />
Now we need to setup Apache to log correctly.  You need to add this line your httpd.conf to get the correct logging format.  Notice the http.X-Forwarded-For we just set.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">LogFormat <span style="color: #ff0000;">&quot;%{X-Forwarded-For}i %l %u %t <span style="color: #000099; font-weight: bold;">\&quot;</span>%r<span style="color: #000099; font-weight: bold;">\&quot;</span> %&gt;s %b <span style="color: #000099; font-weight: bold;">\&quot;</span>%{Referer}i<span style="color: #000099; font-weight: bold;">\&quot;</span> <span style="color: #000099; font-weight: bold;">\&quot;</span>%{User-Agent}i<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> varnishcombined</pre></div></div>
<p>Further down (or in your virtual server.conf file, if you break those out), we need to set our server to use that custom logging.  I have a domain (cainmanor.com) and a subdomain (photos.cainmanor.com), so I just pointed both virtual host to the same log file.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">8080</span><span style="color: #000000; font-weight: bold;">&gt;</span>
        DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>wordpress
        ServerName cainmanor.com
        CustomLog <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>cainmanor.com-access.log varnishcombined
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>
<p>Once you&#8217;ve done this, you should be able to look in your custom log (/var/log/httpd/cainmanor.com-access.log) and see your traffic coming from varied IP addresses.  </p>
<p>Now we tell AWStats where to find the custom log ( /etc/awstat/awstats.cainmanor.com.conf ) we created.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#LogFile=&quot;/var/log/httpd/access_log&quot; &lt;- OLD</span>
<span style="color: #007800;">LogFile</span>=<span style="color: #ff0000;">&quot;/var/log/httpd/cainmanor.com-access.log&quot;</span></pre></div></div>
<p>Now all you need to do is restart varnish and apache, and you should be logging successfully.  </p>
<p>Happy Computing!!</p>
<img src="http://feeds.feedburner.com/~r/CainManor/~4/tkhaOekD7Xg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cainmanor.com/tech/setup-logging-for-varnish/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cainmanor.com/tech/setup-logging-for-varnish</feedburner:origLink></item>
		<item>
		<title>Updated Varnish default.vcl</title>
		<link>http://feedproxy.google.com/~r/CainManor/~3/WtxBezek0ek/updated-default-vcl</link>
		<comments>http://cainmanor.com/tech/updated-default-vcl#comments</comments>
		<pubDate>Sun, 25 Jul 2010 18:50:19 +0000</pubDate>
		<dc:creator>Greg Cain</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">http://cainmanor.com/?p=1122</guid>
		<description><![CDATA[I wasn&#8217;t able to get the varnish logs in a format awstats/jawstats could understand. After a LOT of googling, I&#8217;ve gotten this to work. I added sub vcl_recv &#123; # Add a unique header containing the client address remove req.http.X-Forwarded-For; set req.http.X-Forwarded-For = client.ip; &#125; as you can see below. &#91; root@CainManor:/etc/varnish &#93; cat default.vcl [...]]]></description>
			<content:encoded><![CDATA[<p>I wasn&#8217;t able to get the varnish logs in a format awstats/jawstats could understand.  After a LOT of googling, I&#8217;ve gotten this to work.  I added</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sub vcl_recv <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Add a unique header containing the client address</span>
  remove req.http.X-Forwarded-For;
  <span style="color: #000000; font-weight: bold;">set</span>    req.http.X-Forwarded-For = client.ip;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>
<p>as you can see below.<br />
<span id="more-1122"></span></p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span> root<span style="color: #000000; font-weight: bold;">@</span>CainManor:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>varnish <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> default.vcl
backend default <span style="color: #7a0874; font-weight: bold;">&#123;</span>
.host = <span style="color: #ff0000;">&quot;173.230.157.240&quot;</span>;
.port = <span style="color: #ff0000;">&quot;8080&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
sub vcl_recv <span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #666666; font-style: italic;"># Add a unique header containing the client address</span>
<span style="color: #666666; font-style: italic;"># This is so we can forward the headers to the Apache logs.</span>
  remove req.http.X-Forwarded-For;
  <span style="color: #000000; font-weight: bold;">set</span>    req.http.X-Forwarded-For = client.ip;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
sub vcl_recv <span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #666666; font-style: italic;"># Let's make sure we aren't compressing already compressed formats.</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.http.Accept-Encoding<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url ~ <span style="color: #ff0000;">&quot;\.(jpg|png|gif|gz|tgz|bz2|mp3|mp4|m4v)(\?.*|)$&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            remove req.http.Accept-Encoding;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span> elsif <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.http.Accept-Encoding ~ <span style="color: #ff0000;">&quot;gzip&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">set</span> req.http.Accept-Encoding = <span style="color: #ff0000;">&quot;gzip&quot;</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span> elsif <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.http.Accept-Encoding ~ <span style="color: #ff0000;">&quot;deflate&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">set</span> req.http.Accept-Encoding = <span style="color: #ff0000;">&quot;deflate&quot;</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            remove req.http.Accept-Encoding;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;"># Remove cookies and query string for real static files</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url ~ <span style="color: #ff0000;">&quot;^/[^?]+\.(jpeg|jpg|png|gif|ico|js|css|txt|gz|zip|lzma|bz2|tgz|tbz|html|htm)(\?.*|)$&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
       <span style="color: #7a0874; font-weight: bold;">unset</span> req.http.cookie;
       <span style="color: #000000; font-weight: bold;">set</span> req.url = regsub<span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url, <span style="color: #ff0000;">&quot;\?.*$&quot;</span>, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;"># Remove cookies from front page</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url ~ <span style="color: #ff0000;">&quot;^/$&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
       <span style="color: #7a0874; font-weight: bold;">unset</span> req.http.cookie;
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>
<img src="http://feeds.feedburner.com/~r/CainManor/~4/WtxBezek0ek" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cainmanor.com/tech/updated-default-vcl/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cainmanor.com/tech/updated-default-vcl</feedburner:origLink></item>
		<item>
		<title>How to use Varnish cache with WordPress</title>
		<link>http://feedproxy.google.com/~r/CainManor/~3/4ReCETYWuE0/how-to-use-varnish-cache-with-wordpress</link>
		<comments>http://cainmanor.com/tech/how-to-use-varnish-cache-with-wordpress#comments</comments>
		<pubDate>Sun, 25 Jul 2010 04:41:00 +0000</pubDate>
		<dc:creator>Greg Cain</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">http://cainmanor.com/?p=1120</guid>
		<description><![CDATA[I&#8217;ve been wanting to play around with a Web Cache/proxy in front of my web server, just to see how hard it would be and how well it would work. Initially, I was going to try Squid, which is used far and wide.  Pretty quickly I found out about Varnish, which is supposed to be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to play around with a Web Cache/proxy in front of my web server, just to see how hard it would be and how well it would work.</p>
<p>Initially, I was going to try Squid, which is used far and wide.  Pretty quickly I found out about Varnish, which is supposed to be easy to use, and quick to install.   That may have been true, but getting it to work with WordPress was relatively painful for me.   However, once I got it working, it made some crazy improvements in the speed of this site.</p>
<p>I won&#8217;t go into too much detail about the more standard parts.   Should you need help with things like installing or finding packages, Varnish might not be for you.  I will also assume you have a fully functional WordPress installed on Apache 2.</p>
<p>Install Varnish</p>
<p>Configure your Varnish config file (/etc/varnish/default.vcl.)  Here is mine (also, check <a href="http://cainmanor.com/tech/updated-default-vcl">THIS</a> post.)<br />
<span id="more-1120"></span></p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">backend default <span style="color: #7a0874; font-weight: bold;">&#123;</span>
.host = <span style="color: #ff0000;">&quot;173.230.157.240&quot;</span>;
.port = <span style="color: #ff0000;">&quot;8080&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
sub vcl_recv <span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #666666; font-style: italic;"># Normalize Content-Encoding</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.http.Accept-Encoding<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url ~ <span style="color: #ff0000;">&quot;\.(jpg|png|gif|gz|tgz|bz2|lzma|tbz)(\?.*|)$&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            remove req.http.Accept-Encoding;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span> elsif <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.http.Accept-Encoding ~ <span style="color: #ff0000;">&quot;gzip&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">set</span> req.http.Accept-Encoding = <span style="color: #ff0000;">&quot;gzip&quot;</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span> elsif <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.http.Accept-Encoding ~ <span style="color: #ff0000;">&quot;deflate&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">set</span> req.http.Accept-Encoding = <span style="color: #ff0000;">&quot;deflate&quot;</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
            remove req.http.Accept-Encoding;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;"># Remove cookies and query string for real static files</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url ~ <span style="color: #ff0000;">&quot;^/[^?]+\.(jpeg|jpg|png|gif|ico|js|css|txt|gz|zip|lzma|bz2|tgz|tbz|html|htm)(\?.*|)$&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
       <span style="color: #7a0874; font-weight: bold;">unset</span> req.http.cookie;
       <span style="color: #000000; font-weight: bold;">set</span> req.url = regsub<span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url, <span style="color: #ff0000;">&quot;\?.*$&quot;</span>, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;"># Remove cookies from front page</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url ~ <span style="color: #ff0000;">&quot;^/$&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
       <span style="color: #7a0874; font-weight: bold;">unset</span> req.http.cookie;
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
sub vcl_fetch <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>req.url ~ <span style="color: #ff0000;">&quot;^/$&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                <span style="color: #7a0874; font-weight: bold;">unset</span> obj.http.set-cookie;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>
<p>Regretfully I don&#8217;t remember where I got that particular  file, but I&#8217;m going to see if I can find it again.  It&#8217;s  perfect for what we need to do.  All you need to do is change your  IP to match your host.   By doing this, you&#8217;ll be pointing at your web server (called backend.)  We&#8217;re going to change your web server to listing on 8080, and varnish will answer all normal port 80 traffic.</p>
<p>Now to configure Apache.  Edit your /etc/httpd/conf/httpd.conf, and look for these lines, and add 8080 to the end (the majority were just 80.)</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Listen 127.0.0.1:<span style="color: #000000;">8080</span>
Listen 173.230.157.240:<span style="color: #000000;">8080</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># for each of your Virtual host</span>
NameVirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">8080</span></pre></div></div>
<p>Now stop apache, and stop and start varnish, and start apache.</p>
<p>There are a few ways to see if it&#8217;s working.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">varnishstat
varnishhist <span style="color: #660033;">-d</span>
varnishtop</pre></div></div>
<p>Probably the most fun is to use ab (Apache Benchmark.)   I did this from my desktop client against my Linode 512MB slice.</p>
<p>First, let&#8217;s look at our web server directly (via 8080 we changed it to.)</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ab <span style="color: #660033;">-c</span> <span style="color: #000000;">100</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1000</span> http:<span style="color: #000000; font-weight: bold;">//</span>cainmanor.com:<span style="color: #000000;">8080</span><span style="color: #000000; font-weight: bold;">/</span>
This is ApacheBench, Version <span style="color: #000000;">2.3</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #007800;">$Revision</span>: <span style="color: #000000;">655654</span> $<span style="color: #000000; font-weight: bold;">&amp;</span>gt;
Copyright <span style="color: #000000;">1996</span> Adam Twiss, Zeus Technology Ltd, http:<span style="color: #000000; font-weight: bold;">//</span>www.zeustech.net<span style="color: #000000; font-weight: bold;">/</span>
Licensed to The Apache Software Foundation, http:<span style="color: #000000; font-weight: bold;">//</span>www.apache.org<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
Benchmarking cainmanor.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>be patient<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Completed <span style="color: #000000;">100</span> requests
Completed <span style="color: #000000;">200</span> requests
Completed <span style="color: #000000;">300</span> requests
Completed <span style="color: #000000;">400</span> requests
Completed <span style="color: #000000;">500</span> requests
Completed <span style="color: #000000;">600</span> requests
Completed <span style="color: #000000;">700</span> requests
Completed <span style="color: #000000;">800</span> requests
Completed <span style="color: #000000;">900</span> requests
Completed <span style="color: #000000;">1000</span> requests
Finished <span style="color: #000000;">1000</span> requests
&nbsp;
Server Software:        Apache
Server Hostname:        cainmanor.com
Server Port:            <span style="color: #000000;">8080</span>
&nbsp;
Document Path:          <span style="color: #000000; font-weight: bold;">/</span>
Document Length:        <span style="color: #000000;">0</span> bytes
&nbsp;
Concurrency Level:      <span style="color: #000000;">100</span>
Time taken <span style="color: #000000; font-weight: bold;">for</span> tests:   <span style="color: #000000;">54.226</span> seconds
Complete requests:      <span style="color: #000000;">1000</span>
Failed requests:        <span style="color: #000000;">0</span>
Write errors:           <span style="color: #000000;">0</span>
Non-2xx responses:      <span style="color: #000000;">1000</span>
Total transferred:      <span style="color: #000000;">291000</span> bytes
HTML transferred:       <span style="color: #000000;">0</span> bytes
Requests per second:    <span style="color: #000000;">18.44</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #666666; font-style: italic;">#/sec] (mean)</span>
Time per request:       <span style="color: #000000;">5422.552</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Time per request:       <span style="color: #000000;">54.226</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean, across all concurrent requests<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Transfer rate:          <span style="color: #000000;">5.24</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Kbytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#93;</span> received
&nbsp;
Connection Times <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
              min  mean<span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #000000; font-weight: bold;">/</span>-sd<span style="color: #7a0874; font-weight: bold;">&#93;</span> median   max
Connect:       <span style="color: #000000;">28</span>   <span style="color: #000000;">35</span>   <span style="color: #000000;">6.4</span>     <span style="color: #000000;">33</span>      <span style="color: #000000;">72</span>
Processing:    <span style="color: #000000;">89</span> <span style="color: #000000;">3852</span> <span style="color: #000000;">7070.4</span>   <span style="color: #000000;">1924</span>   <span style="color: #000000;">48164</span>
Waiting:       <span style="color: #000000;">89</span> <span style="color: #000000;">3852</span> <span style="color: #000000;">7070.3</span>   <span style="color: #000000;">1923</span>   <span style="color: #000000;">48163</span>
Total:        <span style="color: #000000;">119</span> <span style="color: #000000;">3887</span> <span style="color: #000000;">7071.0</span>   <span style="color: #000000;">1957</span>   <span style="color: #000000;">48202</span>
&nbsp;
Percentage of the requests served within a certain <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000;">50</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">1957</span>
  <span style="color: #000000;">66</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">1997</span>
  <span style="color: #000000;">75</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">2041</span>
  <span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">2091</span>
  <span style="color: #000000;">90</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">4021</span>
  <span style="color: #000000;">95</span><span style="color: #000000; font-weight: bold;">%</span>  <span style="color: #000000;">18134</span>
  <span style="color: #000000;">98</span><span style="color: #000000; font-weight: bold;">%</span>  <span style="color: #000000;">35079</span>
  <span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">%</span>  <span style="color: #000000;">41195</span>
 <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span>  <span style="color: #000000;">48202</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>longest request<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>
<p>Now let&#8217;s go to port 80 directly</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ab <span style="color: #660033;">-c</span> <span style="color: #000000;">100</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1000</span> http:<span style="color: #000000; font-weight: bold;">//</span>cainmanor.com<span style="color: #000000; font-weight: bold;">/</span>
This is ApacheBench, Version <span style="color: #000000;">2.3</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #007800;">$Revision</span>: <span style="color: #000000;">655654</span> $<span style="color: #000000; font-weight: bold;">&amp;</span>gt;
Copyright <span style="color: #000000;">1996</span> Adam Twiss, Zeus Technology Ltd, http:<span style="color: #000000; font-weight: bold;">//</span>www.zeustech.net<span style="color: #000000; font-weight: bold;">/</span>
Licensed to The Apache Software Foundation, http:<span style="color: #000000; font-weight: bold;">//</span>www.apache.org<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
Benchmarking cainmanor.com <span style="color: #7a0874; font-weight: bold;">&#40;</span>be patient<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Completed <span style="color: #000000;">100</span> requests
Completed <span style="color: #000000;">200</span> requests
Completed <span style="color: #000000;">300</span> requests
Completed <span style="color: #000000;">400</span> requests
Completed <span style="color: #000000;">500</span> requests
Completed <span style="color: #000000;">600</span> requests
Completed <span style="color: #000000;">700</span> requests
Completed <span style="color: #000000;">800</span> requests
Completed <span style="color: #000000;">900</span> requests
Completed <span style="color: #000000;">1000</span> requests
Finished <span style="color: #000000;">1000</span> requests
&nbsp;
Server Software:        Apache
Server Hostname:        cainmanor.com
Server Port:            <span style="color: #000000;">80</span>
&nbsp;
Document Path:          <span style="color: #000000; font-weight: bold;">/</span>
Document Length:        <span style="color: #000000;">18654</span> bytes
&nbsp;
Concurrency Level:      <span style="color: #000000;">100</span>
Time taken <span style="color: #000000; font-weight: bold;">for</span> tests:   <span style="color: #000000;">3.507</span> seconds
Complete requests:      <span style="color: #000000;">1000</span>
Failed requests:        <span style="color: #000000;">0</span>
Write errors:           <span style="color: #000000;">0</span>
Total transferred:      <span style="color: #000000;">19276653</span> bytes
HTML transferred:       <span style="color: #000000;">18960147</span> bytes
Requests per second:    <span style="color: #000000;">285.17</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #666666; font-style: italic;">#/sec] (mean)</span>
Time per request:       <span style="color: #000000;">350.665</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Time per request:       <span style="color: #000000;">3.507</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>ms<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>mean, across all concurrent requests<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Transfer rate:          <span style="color: #000000;">5368.33</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Kbytes<span style="color: #000000; font-weight: bold;">/</span>sec<span style="color: #7a0874; font-weight: bold;">&#93;</span> received
&nbsp;
Connection Times <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
              min  mean<span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #000000; font-weight: bold;">/</span>-sd<span style="color: #7a0874; font-weight: bold;">&#93;</span> median   max
Connect:       <span style="color: #000000;">30</span>   <span style="color: #000000;">75</span> <span style="color: #000000;">127.0</span>     <span style="color: #000000;">52</span>    <span style="color: #000000;">1052</span>
Processing:   <span style="color: #000000;">121</span>  <span style="color: #000000;">254</span> <span style="color: #000000;">153.4</span>    <span style="color: #000000;">203</span>    <span style="color: #000000;">1104</span>
Waiting:       <span style="color: #000000;">33</span>   <span style="color: #000000;">78</span>  <span style="color: #000000;">86.4</span>     <span style="color: #000000;">54</span>     <span style="color: #000000;">984</span>
Total:        <span style="color: #000000;">167</span>  <span style="color: #000000;">329</span> <span style="color: #000000;">189.5</span>    <span style="color: #000000;">262</span>    <span style="color: #000000;">1235</span>
&nbsp;
Percentage of the requests served within a certain <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000;">50</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">262</span>
  <span style="color: #000000;">66</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">299</span>
  <span style="color: #000000;">75</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">317</span>
  <span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">343</span>
  <span style="color: #000000;">90</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">481</span>
  <span style="color: #000000;">95</span><span style="color: #000000; font-weight: bold;">%</span>    <span style="color: #000000;">767</span>
  <span style="color: #000000;">98</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">1125</span>
  <span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">1143</span>
 <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span>   <span style="color: #000000;">1235</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>longest request<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>
<p>I also tried to use W3 Total Cache and memcached at the same time, but I got slightly slower response times.</p>
<p>These are impressive improvements.<br />
Before &#8211; Time taken for tests:   54.226 seconds<br />
After    &#8211; Time taken for tests:   3.507 seconds</p>
<p>Have Fun</p>
<img src="http://feeds.feedburner.com/~r/CainManor/~4/4ReCETYWuE0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://cainmanor.com/tech/how-to-use-varnish-cache-with-wordpress/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://cainmanor.com/tech/how-to-use-varnish-cache-with-wordpress</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.776 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-09-10 07:56:54 -->
