<?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>[ t h e f r a g g l e . c o m ] &#187; squid</title>
	<atom:link href="http://www.thefraggle.com/tag/squid/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thefraggle.com</link>
	<description>technology, photography and anything else that springs to mind.</description>
	<lastBuildDate>Tue, 13 Sep 2011 09:37:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>http load balancing with squid</title>
		<link>http://www.thefraggle.com/2007/04/09/http-load-balancing-with-squid/</link>
		<comments>http://www.thefraggle.com/2007/04/09/http-load-balancing-with-squid/#comments</comments>
		<pubDate>Mon, 09 Apr 2007 17:54:17 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/2007/04/09/http-load-balancing-with-squid/</guid>
		<description><![CDATA[A while back at work I had to create a configuration for an internal squid http accelerator, and thought &#8220;hey, wouldn&#8217;t it be neat if I could load balance thefraggle.com with this method&#8221;. Now, usually Squid is used to act as a caching proxy server, which means that client http requests are sent to the [...]]]></description>
			<content:encoded><![CDATA[<p>A while back at work I had to create a configuration for an internal squid http accelerator, and thought &#8220;hey, wouldn&#8217;t it be neat if I could load balance thefraggle.com with this method&#8221;.</p>
<p>Now, usually Squid is used to act as a caching proxy server, which means that client http requests are sent to the proxy server, the proxy server then goes out onto the web and attempts to grab the request, and returns the entry back to the client; in the process caching the pages (depending on the way the cache has been set up).</p>
<p><span id="more-40"></span></p>
<p>Another neat feature that squid supports, is that it can be configured to act as a caching http accellerator. This means that you can sit a squid instance masqerading itself as your website, infront of your multiple webservers/application servers, and it will serve traffic on their behalf, performing basic round robin load balancing, and caching results based on your cache configuration.</p>
<p>The way I decided to setup this load balancing, was to use my existing main server (beastie.thefraggle.com) as the squid and primary webserver, and to use my new VPS with <a href="http://www.bitfolk.com" target="_blank" title="BitFolk VPS">bitfolk</a> (etch.thefraggle.com), as the secondary webserver. From reading the <a href="http://wiki.squid-cache.org/SquidFaq/ReverseProxy" title="SquidFAQ" target="_blank"> </a><a href="http://wiki.squid-cache.org/SquidFaq/ReverseProxy" title="SquidFAQ" target="_blank">SquidFAQ</a> I managed to come up with the following configuration:</p>
<blockquote><p><code><br />
http_port 81.171.136.148:80 defaultsite=www.thefraggle.com vhost<br />
cache_peer 127.0.0.1 parent 80 0 no-query originserver round-robin<br />
cache_peer 212.13.198.106 parent 80 0 no-query originserver round-robin</code></p></blockquote>
<p>The rest of the configuration was as standard, but if you want to see the entire thing I&#8217;ve included the file to this post:</p>
<p><a href="http://www.thefraggle.com/wp-content/uploads/2007/04/squidconf.txt" title="Squid Configuration">Squid Configuration</a></p>
<p>As you can see it&#8217;s not the most pretty configuration ever, but it was a starting point <img src='http://www.thefraggle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>HTTP ACCEL is a pretty neat feature huh? However, I&#8217;m not sure of how useful it may be in the future, as from what I can see there is now an extension to mod_proxy in apache2, called mod_proxy_balancer; This may be able to manage this same simple kind of http load balancing. Future posts may well include how to use this, and how to do simple mysql balancing/replication <img src='http://www.thefraggle.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2007/04/09/http-load-balancing-with-squid/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

