<?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>[LINICKX].com &#187; loadbalance</title>
	<atom:link href="http://www.linickx.com/tag/loadbalance/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linickx.com</link>
	<description>Moments of Genius followed by Trash.</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:06:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Load balance anything with HAProxy</title>
		<link>http://www.linickx.com/645/load-balance-anything-with-haproxy</link>
		<comments>http://www.linickx.com/645/load-balance-anything-with-haproxy#comments</comments>
		<pubDate>Fri, 07 Nov 2008 19:38:49 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[haproxy]]></category>
		<category><![CDATA[loadbalance]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=645</guid>
		<description><![CDATA[Recently I wanted to load balance a TCP service i.e. not http, in the past I&#8217;ve used ultramonkey but there doesn&#8217;t seem to be any maintained Redhat/Centos packages. After some googling I found that haproxy can balance non-http services but &#8230; <a href="http://www.linickx.com/645/load-balance-anything-with-haproxy">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I wanted to load balance a TCP service i.e. <strong><u>not</u></strong> http, in the past I&#8217;ve used <a href="http://www.ultramonkey.org">ultramonkey</a> but there doesn&#8217;t seem to be any maintained Redhat/Centos packages.</p>
<p>After some googling I found that <a href="http://haproxy.1wt.eu/">haproxy</a> can balance non-http services but examples of non-http configurations are few and far between, <a href="http://strugglers.net/~andy/blog/2007/04/29/haproxy-bafflement/">this blog post</a> lead me to my solution, so after the jump I have a haproxy.cfg which will load balance smtp round-robin style across 4 servers, you also get a webstats interface listening on http://IP:8080/haproxy?stats (<em>username = me, password = password</em>).</p>
<p>By changing the port numbers from 25 (<em>SMTP</em>) you can effectively load balance any TCP app <img src='http://www.linickx.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-645"></span></p>
<pre>
global
        log 127.0.0.1   local0
        log 127.0.0.1   local1 notice
        maxconn 4096
        chroot /var/lib/haproxy
        user haproxy
        group haproxy
        daemon
        #debug
        #quiet

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        option redispatch
        retries 3
        maxconn 2000
        contimeout      5000
        clitimeout      50000
        srvtimeout      50000

listen stats :8080
        balance
        mode http
        stats enable
        stats auth me:password

listen smtp :25
        mode tcp
        option tcplog
        balance roundrobin

        server smtp 192.168.0.1:25 check
        server smtp1 192.168.0.2:25 check
        server smtp2 192.168.0.3:25 check
        server smtp3 192.168.0.4:25 check
</pre>
<p>Redhat/Centos rpm packages of haproxy are avilable from <a href="http://fedoraproject.org/wiki/EPEL">Fedora&#8217;s EPEL Project</a></p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/645/load-balance-anything-with-haproxy/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

