<?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>Load Balancing Digest &#187; Tech Notes</title>
	<atom:link href="http://lbdigest.com/category/tech-notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://lbdigest.com</link>
	<description>Server Load Balancing Articles and News</description>
	<lastBuildDate>Thu, 12 Aug 2010 23:32:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Best of Both Worlds: Selective Source-NAT</title>
		<link>http://lbdigest.com/2009/03/11/best-of-both-worlds-selective-source-nat/</link>
		<comments>http://lbdigest.com/2009/03/11/best-of-both-worlds-selective-source-nat/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 04:23:32 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[Load Balancing 101]]></category>
		<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lbdigest.com/?p=289</guid>
		<description><![CDATA[One of the most common issues that comes up is something often referred to as the &#8220;same subnet&#8221; problem.Â  In certain configurations, you cannot connect to a VIP (Virtual IP address, or Virtual Server) if the client you&#8217;re connecting from is on the same subnet...]]></description>
			<content:encoded><![CDATA[<p>One of the most common issues that comes up is something often referred to as the &#8220;same subnet&#8221; problem.Â  In certain configurations, you cannot connect to a VIP (Virtual IP address, or Virtual Server) if the client you&#8217;re connecting from is on the same subnet as the real server.</p>
<p>For many situations, connecting from the same subnet as your real servers is not a big deal.Â  However, there are some situations where this is required.Â  One of the most common reasons I see is that one of the web application servers needs to connect to a VIP that distributes load between other servers on that same subnet.</p>
<p>Most server load balancing happens through NAT (Network Address Translation), with the only exception being <a href="http://lbwiki.com/index.php/DSR">DSR (Direct Server Return)</a>.Â  You have the option of two different types of NAT: Half-NAT and Source-NAT (SNAT).Â  In half-NAT, only the destination address is changed on the way in.Â  In SNAT, both the source and destination are changed.</p>
<p>If you&#8217;re using half-NAT, you cannot connect to a VIP from the same subnet a server resides on.Â  The reason for this has something to do with the 4-steps required to do server load balancing NAT.</p>
<p style="text-align: center;"><img class="size-medium wp-image-295 aligncenter" title="network1" src="http://lbdigest.com/wp-content/uploads/2009/03/network1-254x300.png" alt="network1" width="254" height="300" /><em>Figure 1: Network Scenario</em></p>
<p>Take a look at the network scenario depicted in Figure 1.Â  In this diagram, you see a client with the IP of 10.1.1.1, a VIP on a load balancer with an IP address of 192.168.1.200, and a server with an IP address of 192.168.1.11 as well as some other devices.</p>
<p>Now, the NAT happens in 4-steps, regardless of whether the load balancer is operating in Layer 4 or Layer 7 mode.Â  Take a look at Table 1 and it&#8217;s companion figure, Figure 2.</p>
<table border="0" align="center">
<tbody>
<tr>
<td colspan="4" align="center" bgcolor="#666666"><span style="color: #ffffff;">Half-NAT 4-Step</span></td>
</tr>
<tr>
<td bgcolor="#aaaaaa">Step</td>
<td bgcolor="#aaaaaa">Connection</td>
<td bgcolor="#aaaaaa">Source IP</td>
<td bgcolor="#aaaaaa">Destination IP</td>
</tr>
<tr>
<td bgcolor="#cccccc">1</td>
<td bgcolor="#cccccc">Client -&gt; LB</td>
<td bgcolor="#cccccc">10.1.1.1</td>
<td bgcolor="#cccccc">192.168.1.200</td>
</tr>
<tr>
<td bgcolor="#cccccc">2</td>
<td bgcolor="#cccccc">LB -&gt; Server</td>
<td bgcolor="#cccccc">10.1.1.1</td>
<td bgcolor="#cccccc">192.168.1.11</td>
</tr>
<tr>
<td bgcolor="#cccccc">3</td>
<td bgcolor="#cccccc">Server -&gt; LB</td>
<td bgcolor="#cccccc">192.168.1.11</td>
<td bgcolor="#cccccc">10.1.1.1</td>
</tr>
<tr>
<td bgcolor="#cccccc">4</td>
<td bgcolor="#cccccc">LB -&gt; Client</td>
<td bgcolor="#cccccc">192.168.1.200</td>
<td bgcolor="#cccccc">10.1.1.1</td>
</tr>
</tbody>
</table>
<p style="text-align: center;"><em>Table 1: Half-NAT</em></p>
<p style="text-align: center;"><em><img class="alignnone size-medium wp-image-296" title="network1-steps" src="http://lbdigest.com/wp-content/uploads/2009/03/network1-steps-254x300.png" alt="network1-steps" width="254" height="300" /></em></p>
<p style="text-align: center;"><em>Figure 2: Half-NAT Path</em></p>
<p style="text-align: left;">Because NAT is done on the way in and on the way out, the load balancer needs to be in the path of traffic on the way and on the way out.Â  With half-NAT, this is done by either being in the Layer 2 path of traffic, or somewhat more commonly, the load balancer is the default gateway.</p>
<p style="text-align: left;">Now look what happens when we try to connect from the client PC on the same network as the servers.</p>
<table border="0" align="center">
<tbody>
<tr>
<td colspan="4" align="center" bgcolor="#666666"><span style="color: #ffffff;">Half-NAT 4-Step (from same subnet)<br />
</span></td>
</tr>
<tr>
<td bgcolor="#aaaaaa">Step</td>
<td bgcolor="#aaaaaa">Connection</td>
<td bgcolor="#aaaaaa">Source IP</td>
<td bgcolor="#aaaaaa">Destination IP</td>
</tr>
<tr>
<td bgcolor="#cccccc">1</td>
<td bgcolor="#cccccc">Client -&gt; LB</td>
<td bgcolor="#cccccc">192.168.1.50</td>
<td bgcolor="#cccccc">192.168.1.200</td>
</tr>
<tr>
<td bgcolor="#cccccc">2</td>
<td bgcolor="#cccccc">LB -&gt; Server</td>
<td bgcolor="#cccccc">192.168.1.50</td>
<td bgcolor="#cccccc">192.168.1.11</td>
</tr>
<tr>
<td bgcolor="#cccccc">3</td>
<td bgcolor="#cccccc">Server -&gt; Client</td>
<td bgcolor="#cccccc"><span style="color: #ff0000;">192.168.1.11</span></td>
<td bgcolor="#cccccc"><span style="color: #ff0000;">192.168.1.50</span></td>
</tr>
</tbody>
</table>
<address style="text-align: center;">Table 2: Half-NAT from Same Subnet<br />
</address>
<p style="text-align: left;">Note that only three-steps occured.Â  This is because the server responds <em>directly</em> to the client.Â  Since everything is on the same Layer 3 network, there&#8217;s no reason to go through a default gateway.Â  The critical 4th step doesn&#8217;t occur, so the source address for the server response to the client is invalid.Â  The client sent a connection to 192.168.1.200, and it got a response back from 192.168.1.11.Â  When that happens, the client&#8217;s IP stack correctly drops all the reponses.</p>
<p style="text-align: left;">One solution is to do SNAT.Â  By NATing the source and destination addresses simultaneously, ensure that traffic goes through the load balancer on the way in and on the way out.Â  Observe what happens when we do Full-NAT in Table 3.Â  You&#8217;ll note we&#8217;ve added a new IP address 192.168.1.5, the SNAT address (this can also be a pool of multiple IP addresses).</p>
<table border="0" align="center">
<tbody>
<tr></tr>
<tr>
<td colspan="4" align="center" bgcolor="#666666"><span style="color: #ffffff;">Half-NAT 4-Step</span></td>
</tr>
<tr>
<td bgcolor="#aaaaaa">Step</td>
<td bgcolor="#aaaaaa">Connection</td>
<td bgcolor="#aaaaaa">Source IP</td>
<td bgcolor="#aaaaaa">Destination IP</td>
</tr>
<tr>
<td bgcolor="#cccccc">1</td>
<td bgcolor="#cccccc">Client -&gt; LB</td>
<td bgcolor="#cccccc">192.168.1.50</td>
<td bgcolor="#cccccc">192.168.1.200</td>
</tr>
<tr>
<td bgcolor="#cccccc">2</td>
<td bgcolor="#cccccc">LB -&gt; Server</td>
<td bgcolor="#cccccc">192.168.1.5</td>
<td bgcolor="#cccccc">192.168.1.11</td>
</tr>
<tr>
<td bgcolor="#cccccc">3</td>
<td bgcolor="#cccccc">Server -&gt; LB</td>
<td bgcolor="#cccccc">192.168.1.11</td>
<td bgcolor="#cccccc">192.168.1.5</td>
</tr>
<tr>
<td bgcolor="#cccccc">4</td>
<td bgcolor="#cccccc">LB -&gt; Client</td>
<td bgcolor="#cccccc">192.168.1.200</td>
<td bgcolor="#cccccc">192.168.1.50</td>
</tr>
</tbody>
</table>
<address style="text-align: center;">Table 3: Full-NAT from Same Subnet</address>
<p style="text-align: left;">SNAT makes it possible to connect to the VIP from the same subnet that the servers are on.Â  But there&#8217;s one little problem:Â  The true source IP address is now hidden from the servers, so the server logs would show all connections as originating from 192.168.1.5.Â  Many web sites count on the true source IP address of the client showing up in the logs in order to munge the logs.</p>
<p style="text-align: left;">So you&#8217;re caught between a rock and a hard place.Â  On one had, you have the true source preserved with half-NAT, but you can&#8217;t connect to the VIP from the same subnet as the servers.Â  On the other hand, you can connect to the VIP from the same subnet, but the true source is hidden.</p>
<p style="text-align: left;">There is a third option if you&#8217;re using HTTP or HTTPS.Â  When you SNAT you can also insert the real source IP address as an HTTP header in the request.Â  The server, if configured, can then record the HTTP header in its log instead of the Layer 3 source address.Â  However, this requires configuring both the load balancer and all the servers.Â  For Apache, it&#8217;s a one line config change.Â  For IIS, it requires an ISAPI filter (such as<a href="http://devcentral.f5.com/weblogs/joe/archive/2005/09/23/1492.aspx"> this one from F5</a>).</p>
<h2 style="text-align: left;">Selective SNAT</h2>
<p style="text-align: left;">Instead of deciding between SNAT and half-NAT, some vendors have the ability to use both on a VIP, choosing which based on the incoming source IP address.Â  A couple of vendors offer this option, but since I happen to have an <a href="http://lbdigest.com/2009/03/09/a10-networks-20-release/">A10 Networks AX2200 from a recent review</a>, so I&#8217;ll use that as an example.</p>
<p style="text-align: left;">The first step is to build an access list that matches the network that you want to be SNAT&#8217;d. This would normally be the subnet that your servers reside on, although there are situations where it would make sense to add in a few more subnets.</p>
<p style="text-align: left;"><img class="alignnone size-full wp-image-298" title="acl" src="http://lbdigest.com/wp-content/uploads/2009/03/acl.png" alt="acl" width="448" height="95" /></p>
<p style="text-align: left;">A10 uses the standard Cisco IOS-style ACL (including inverse bitmask: 0.0.0.255)Â  We&#8217;re just using it to match the server&#8217;s network, 192.168.1.0/24.</p>
<p style="text-align: left;">Then, in the configuration for the TCP/UDP port of the Virtual Server, we associate ACL 1 with an SNAT pool.</p>
<p style="text-align: left;"><img class="alignnone size-full wp-image-299" title="snat-acl" src="http://lbdigest.com/wp-content/uploads/2009/03/snat-acl.png" alt="snat-acl" width="465" height="146" /></p>
<p style="text-align: left;">Now, any connection to the VIP originating from the server subnet gets SNAT&#8217;d, while everyone else gets half-NAT&#8217;d.Â  Allowing the same subnet to connect while preserving the source IP address for everyone else.Â  It&#8217;s the best of both worlds.</p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2009/03/11/best-of-both-worlds-selective-source-nat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick and Dirty Performance Testing With Apache Bench</title>
		<link>http://lbdigest.com/2009/02/05/quick-and-dirty-performance-testing-with-apache-bench/</link>
		<comments>http://lbdigest.com/2009/02/05/quick-and-dirty-performance-testing-with-apache-bench/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 10:40:43 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[From The Mailing list]]></category>
		<category><![CDATA[In the Wild]]></category>
		<category><![CDATA[Load Balancing 101]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Quick Guide]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://lbdigest.com/?p=249</guid>
		<description><![CDATA[If you need a quick and dirty way to throw some load onto a load balancer/ADC or web server, Apache comes with a great tool called Apache Bench.Â  Since it&#8217;s an HTTP client, it will of course work with any server, not just Apache-based servers....]]></description>
			<content:encoded><![CDATA[<p>If you need a quick and dirty way to throw some load onto a load balancer/ADC or web server, Apache comes with a great tool called <a href="http://httpd.apache.org/docs/2.2/programs/ab.html">Apache Bench</a>.Â  Since it&#8217;s an HTTP client, it will of course work with any server, not just Apache-based servers.</p>
<p>Typically, Apache Bench (ab) is installed with the base Apache install, from at least Apache 1.3 on.Â  This includes when Apache is <a href="http://httpd.apache.org/download.cgi">installed on Windows</a>.</p>
<p>You can check all of the available options on the ab <a href="http://httpd.apache.org/docs/2.2/programs/ab.html">documentation page</a>, but here&#8217;s a (very) quick reference to using it.</p>
<p>Two of the most important options are &#8220;-n&#8221; for the number of total connections, and &#8220;-c&#8221; for how many concurrent connections are done at the same time.</p>
<p>For instance, using the option &#8220;-n 1000&#8243; will do 1,000 requests, one at a time, to a target URL.</p>
<pre>ab -n 1000 http://website.com/</pre>
<p>One at a time is rarely an effective test, so it&#8217;s best to use the &#8220;-c&#8221; option to specify a high number of concurrent connections, such as 100.</p>
<pre>ab -n 1000 -c 100 http://website.com/</pre>
<p>If you use concurrency, ab will split the total number of requests up amongst the concurrent settings.Â  For instance, using the option &#8220;-n 1000&#8243; will do 1,000 connections, but &#8220;-n 2000 -c 100&#8243; will only do 20 requests from 100 different connections (2,000 / 100 = 20).Â  So it&#8217;s best to use a much larger number of total connections if you&#8217;re doing concurrency.</p>
<pre>ab -n 100000 -c 100 http://website.com/</pre>
<p>When ab is finished running, it will spit out a performance report, including such info as the time taken for tests, requests per second, wait time, etc.</p>
<pre>Finished 1000 requests

Server Software:        Apache/2.2.9
Server Hostname:        localhost
Server Port:            80

Document Path:          /
Document Length:        45 bytes

Concurrency Level:      10
Time taken for tests:   0.427 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      320640 bytes
HTML transferred:       45090 bytes
Requests per second:    2341.45 [#/sec] (mean)
Time per request:       4.271 [ms] (mean)
Time per request:       0.427 [ms] (mean, across all concurrent requests)
Transfer rate:          733.17 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    2   0.4      2       3
Processing:     0    2   0.5      2       7
Waiting:        0    2   0.5      2       6
Total:          0    4   0.7      4       8

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      5
  80%      5
  90%      5
  95%      5
  98%      5
  99%      5
 100%      8 (longest request)</pre>
<p>The ab utility defaults to one request per TCP connection (KeepAlive turned off).Â  If you want to use KeepAlive, where multiple requests are made through a TCP connection, use the &#8220;-K&#8221; option, open up as many TCP connections as you specify in concurrency (&#8220;-c&#8221;) and make the total number of quests through those few open TCP connections.</p>
<p>The utility is a simple but power tool for testing load balancers and web servers.Â  It doesn&#8217;t tend to reflect real-world usage, but it can be useful for baseline testing and troubleshooting.Â  I&#8217;ve found it quite useful over the years.</p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2009/02/05/quick-and-dirty-performance-testing-with-apache-bench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mega Proxy Not So Mega, Akshually</title>
		<link>http://lbdigest.com/2008/09/15/mega-proxy-not-so-mega-akshually/</link>
		<comments>http://lbdigest.com/2008/09/15/mega-proxy-not-so-mega-akshually/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 16:53:33 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[Ask Tony]]></category>
		<category><![CDATA[Feature Articles]]></category>
		<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://lbdigest.com/?p=177</guid>
		<description><![CDATA[Apologies for the LOLcatspeak.Â  I&#8217;m incapable of helping myself. The driving force behind Layer 7 persistence (keeping an individual user tied to a specific server in a server group based on HTTP headers instead of IP address) was the dreaded AOL Megaproxy issue.Â  AOL had...]]></description>
			<content:encoded><![CDATA[<p>Apologies for the LOLcatspeak.Â  I&#8217;m incapable of helping myself.</p>
<p>The driving force behind Layer 7 persistence (keeping an individual user tied to a specific server in a server group based on HTTP headers instead of IP address) was the dreaded AOL Megaproxy issue.Â  AOL had the nasty little tendancy of routing all web traffic through a couple of mega proxies located throughout the US and Canada.</p>
<p>This caused a problem with the previous method of persistence, which was to base it on source IP address. Typically, one IP address equaled a single user.Â  However, with AOL, you could have 20,000 users coming from a single IP address.Â  The load balancer would think it&#8217;s a single user, and if you had 300 servers ready to take orders, all 20,000 users would go to one.Â  That situation has happened a few times, and it&#8217;s hillarious, so long as you aren&#8217;t the company with the 300 servers.</p>
<p>I still teach that mega proxy problem, mostly out of muscle memory.Â  But I stopped to think about it, do we really have a problem with megaproxies anymore?Â  Does AOL even do this practice, and even if they did, is AOL represent a significant amount of traffic?</p>
<p>The answer to the later question is almost certainly no.Â  AOL has seen a dramatic drop in subscribers, and most people connect directly to the Internet through their cable modem or DSL provider.Â  And I don&#8217;t know of any major Internet provider that utilizes proxies for their users Internet requests.</p>
<p>Layer 7 persistence is still applicable to situations where you may have multiple users coming from a single IP address (such as a small client base coming from a handful of offices, with each office using on public IP address), but I wonder what doing Layer 4 persistence would do to a major site these days.Â  I&#8217;m thinking, not much.</p>
<p>What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2008/09/15/mega-proxy-not-so-mega-akshually/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Linux.com Article: Load Testing</title>
		<link>http://lbdigest.com/2008/08/13/linuxcom-article-load-testing/</link>
		<comments>http://lbdigest.com/2008/08/13/linuxcom-article-load-testing/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 14:12:31 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://lbdigest.com/?p=174</guid>
		<description><![CDATA[I was doing my obessive-compulsive reloading of Digg&#8217;s main page, and came accross this article on load testing with open source tools.Â  Good read.]]></description>
			<content:encoded><![CDATA[<p>I was doing my obessive-compulsive reloading of Digg&#8217;s main page, and came accross this article on load <a href="http://www.linux.com/feature/143896">testing with open source tools</a>.Â  Good read.</p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2008/08/13/linuxcom-article-load-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part-Time Regex&#8217;r? Regex Coach</title>
		<link>http://lbdigest.com/2008/04/21/part-time-regexr-regex-coach/</link>
		<comments>http://lbdigest.com/2008/04/21/part-time-regexr-regex-coach/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 14:07:21 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[Quick Guide]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://lbdigest.com/?p=120</guid>
		<description><![CDATA[I deal with regex enough to need to know a beginning to intermediate level of knowledge, but I don&#8217;t use it enough to be able to form regex statements without thinking. Or in load balancing terms, it&#8217;s not burned into my brain ASIC. Every time...]]></description>
			<content:encoded><![CDATA[<p>I deal with regex enough to need to know a beginning to intermediate level of knowledge, but I don&#8217;t use it enough to be able to form regex statements without thinking. Or in load balancing terms, it&#8217;s not burned into my brain ASIC.  Every time I do regex, I&#8217;m doing it purely in software.</p>
<p>So what&#8217;s a part-time regex&#8217;r to do?  Like any good professional, I cheat.  I use a great little tool called <a href="http://weitz.de/regex-coach/">Regex Coach</a>.</p>
<p>It&#8217;s great little graphical tool that lets you take an example string and test (in real time) your regex statement.</p>
<p style="text-align: center;"><a href="http://lbdigest.com/wp-content/uploads/2008/04/regexcoach1.png"><img class="alignnone size-medium wp-image-122" title="regexcoach1" src="http://lbdigest.com/wp-content/uploads/2008/04/regexcoach1-279x300.png" alt="" width="279" height="300" /></a></p>
<p>It handles splits, fields, and all of the other regex madness that you might need help with.</p>
<p>Update: Reader Jason Williams pointed out another great little Regex tool <a href="http://kodos.sourceforge.net/">called Kodos</a>.Â  Similar in function, it&#8217;s got some neat features like automatic code generation.</p>
<p style="text-align: center;"><a href="http://lbdigest.com/wp-content/uploads/2008/04/kodos.png"><img class="alignnone size-medium wp-image-126" title="kodos" src="http://lbdigest.com/wp-content/uploads/2008/04/kodos-242x300.png" alt="" width="242" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2008/04/21/part-time-regexr-regex-coach/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>4 Things You Can Do To Improve Your Load Balancing Infrastructure for 2008</title>
		<link>http://lbdigest.com/2008/01/21/4-things-you-can-do-to-improve-your-load-balancing-infrastructure-for-2008/</link>
		<comments>http://lbdigest.com/2008/01/21/4-things-you-can-do-to-improve-your-load-balancing-infrastructure-for-2008/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 23:11:02 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[Feature Articles]]></category>
		<category><![CDATA[Load Balancing 101]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://lbdigest.com/2008/01/21/4-things-you-can-do-to-improve-your-load-balancing-infrastructure-for-2008/</guid>
		<description><![CDATA[It&#8217;s a new year, and time for resolutions and all that. In that spirit, I&#8217;ve put together a list of 4 things you can do to improve your load balancing infrastructure. Some are quick, some are more involved, but they&#8217;ll all pay huge dividends. &#160;...]]></description>
			<content:encoded><![CDATA[<p align="left">It&#8217;s a new year, and time for resolutions and all that.  In that spirit, I&#8217;ve put together a list of 4 things you can do to improve your load balancing infrastructure.  Some are quick, some are more involved, but they&#8217;ll all pay huge dividends.</p>
<p style="text-align: center" align="left">&nbsp;</p>
<p style="text-align: center" align="left"><img src="http://lbdigest.com/wp-content/uploads/2008/01/926182_new_year_graphics.jpg" alt="Happy New Year 2008" align="right" /></p>
<p style="text-align: center" align="left">&nbsp;</p>
<p style="text-align: center" align="left">&nbsp;</p>
<p><em><strong>Number 1: Get Your Sniffing In Order</strong></em></p>
<p>Take some time to prepare your infrastructure to make sure you can sniff the points where traffic enters and leaves your load balancing infrastructure.  If you&#8217;re lucky, your load balancer has the <a href="http://www.tcpdump.org/">tcpdump</a> utility built in.  If that&#8217;s the case, you&#8217;re done.  If not, you&#8217;ll need a way to sniff traffic on all LANs that your load balancer operates on.</p>
<p>Without TCPDump on your load balancer, you&#8217;ll need to setup some type of span/mirror port on your switching infrastructure, or put a hub near the ingress/egress point.    This can be somewhat of a pain to setup, which is why it&#8217;s best to do it when there isn&#8217;t a problem that needs diagnosing.</p>
<p>What works great is some type of Unix or Windows box that you can log into remotely with a spare Gigabit Ethernet port.  Have a couple of ports on you Layer 2 infrastructure switches ready to be turned into span/mirror ports, and all you need to do is plug the spare Ethernet port to do the sniffing.  You can of course move the cable around to different span ports as needed.</p>
<p>If you&#8217;re really in a pinch, you can plug a hub in between the load balancer and the servers or the load balancer and the Internet and sniff traffic that way, although you&#8217;ll probably degrade network performance some with the hub (and thus, collisionable) network.</p>
<p><strong><em>Number 2: Run MRTG/RRDTool</em></strong></p>
<p>Management guru <a href="http://en.wikipedia.org/wiki/Peter_Drucker">Peter Drucker</a> said &#8220;What gets measured, gets managed&#8221;, and that&#8217;s certainly true for networks.  Installing <a href="http://oss.oetiker.ch/mrtg/">MRTG</a>/<a href="http://oss.oetiker.ch/rrdtool/">RRDTool</a> on your network (if you haven&#8217;t already) and pulling stats from your load balancer will definitely help you manage your infrastructure.</p>
<p>Getting Interface bandwidth stats is trivial with any load balancer.  Most support <a href="http://vegan.net/MRTG">extended objects</a>, which will get you even more detailed metrics on your load balancing infrastructure.</p>
<p><strong><em>Number 3: Check For Ethernet Errors</em></strong></p>
<p>It&#8217;s always a good idea to check your Ethernet interfaces for errors.  If you&#8217;ve got a managed switch, such as a Cisco Catalyst, the command is something along the lines of &#8220;show port counters [port]&#8220;.</p>
<p><span class="content"></span></p>
<pre>Port  Align-Err  FCS-Err    Xmit-Err   Rcv-Err    UnderSize

----- ---------- ---------- ---------- ---------- ---------
  3/2       1511        213          0          0         0</pre>
<pre>Port  Single-Col Multi-Coll Late-Coll  Excess-Col Carri-Sen Runts     Giants</pre>
<pre>----- ---------- ---------- ---------- ---------- --------- --------- ---------</pre>
<pre> 3/2           0          0          0          0         0      5511         0</pre>
<p>On a Linux, FreeBSD, or other Unix-type system, &#8220;ifconfig -a&#8221; usually does it.</p>
<p><span class="content"></span></p>
<pre>RX packets:157721935 errors:5869 dropped:6008 overruns:5869 frame:0
TX packets:172114172 errors:0 dropped:0 overruns:15 carrier:0
collisions:0 txqueuelen:1000</pre>
<p>In both cases, there are errors on the interface.  These types of errors can be caused by a couple of things, (including faulty wiring), but the usual suspect is a duplex mismatch.</p>
<p>Duplex mismatches are insidious because when they occur, <em>you can still pass traffic.  </em>With light traffic, you won&#8217;t even notice a difference.  With moderate to heavy traffic, things will get slow, connections dropped, but you&#8217;ll still pass traffic.  Other failures completely block traffic, but a duplex mis-match isn&#8217;t always obvious, and it&#8217;ll make traffic crawl.</p>
<p>100 Mbps duplex autodetect doesn&#8217;t really work that well.  With Gigabit, the protocol is much more refined, and I&#8217;ve yet to see a duplex mismatch even on auto when Gigabit is used.  But with 100 Mbps, you can&#8217;t really trust auto-detect.</p>
<p>The solution:  Always hard-code 100 Mbps links, and check your interfaces occasionally for errors.</p>
<p><strong><em>Number 4:</em></strong>  <em><strong>Check For Software Updates</strong></em></p>
<p>Even if there&#8217;s no immediate need to update your code, it&#8217;s a good idea to keep current.  It&#8217;s a lot easier to schedule and update code in regular intervals than it is to find yourself in a situation where you need to be on the latest code, and you&#8217;re several major versions back.  So it&#8217;s a good idea to schedule code updates on a regular basis.</p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2008/01/21/4-things-you-can-do-to-improve-your-load-balancing-infrastructure-for-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Importance of Diagnostic Tools</title>
		<link>http://lbdigest.com/2007/08/08/the-importance-of-diagnostic-tools/</link>
		<comments>http://lbdigest.com/2007/08/08/the-importance-of-diagnostic-tools/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 02:44:33 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://lbdigest.com/2007/08/08/the-importance-of-diagnostic-tools/</guid>
		<description><![CDATA[Diagnostic tools are critically important.Â  It&#8217;s something that often gets forgotten in product development, but it can make or break a product, especially in a product&#8217;s formative years (or during big code updates) while the kinks are being worked out. The swiss army knife of...]]></description>
			<content:encoded><![CDATA[<p>Diagnostic tools are critically important.Â  It&#8217;s something that often gets forgotten in product development, but it can make or break a product, especially in a product&#8217;s formative years (or during big code updates) while the kinks are being worked out.</p>
<p>The swiss army knife of diagnostic tools, and the one most essential in the entire networking realm, is <a href="http://tcpdump.org">tcpdump</a>. Most load balancers these days have this installed, from the big-budget F5 BIG-IP to the value boxes, tcpdump is included.</p>
<p>It&#8217;s one of the benefits of the proliferation of x86-based load balancers, and an advantage they have over some of their switch/ASIC-based counterparts.Â  While it&#8217;s possible for the switch-based system to just set up a mirror/span port and use a sniffer (or Linux box with tcpdump installed), it&#8217;s far more convenient when tcpdump is installed on the device itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2007/08/08/the-importance-of-diagnostic-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Same Sunbet Problem</title>
		<link>http://lbdigest.com/2007/05/08/same-sunbet-problem/</link>
		<comments>http://lbdigest.com/2007/05/08/same-sunbet-problem/#comments</comments>
		<pubDate>Tue, 08 May 2007 20:38:28 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[From The Mailing list]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://lbdigest.com/2007/05/08/same-sunbet-problem/</guid>
		<description><![CDATA[One of the most common problems that afflict load balancing situations is the &#8220;same subnet&#8221; problem. This is when a client tries to browse a Virtual Service/VIP from the same subnet as the real servers. Lately, I&#8217;ve seen this come up on the mailing list....]]></description>
			<content:encoded><![CDATA[<p>One of the most common problems that afflict load balancing situations is the &#8220;same subnet&#8221; problem.  This is when a client tries to browse a Virtual Service/VIP from the same subnet as the real servers.    Lately, I&#8217;ve seen this come up on the mailing list.  See <a href="http://vegan.net/lb/archive/05-2007/0009.html">here</a> (and <a href="http://vegan.net/lb/archive/05-2007/0010.html">my response</a>) and <a href="http://vegan.net/lb/archive/04-2007/0064.html">here</a>.</p>
<p>If the virtual server is setup as &#8220;transparent&#8221;, where the client IP address is preserved (i.e., the load balancer doesn&#8217;t act like proxy), then the clients cannot respond correctly.</p>
<p>The load balancer performs network address translation on the way in, and on the way out.  This is necessary for the connection to work correctly.  However, if the client is on the same subnet as the real server, the server will respond to the client directly, without hitting the load balancer on the way out.  The source IP address will appear to be the server, and not the virtual service.  Because the client sent the connection to the virtual service, it will drop all incoming packets from the server.</p>
<p>The client can be on the same subnet as the virtual service and browsing will work, provided that the virtual service is on a separate subnet from the real servers.</p>
<p>There are a few solutions for this:</p>
<p>The first is to disable transparency, and have the load balancer act like a proxy.  The downside to this is that you lose the source IP address for your server logs (all connections appear to be coming from the load balancer).</p>
<p>Another solution is to use DSR (Direct Server Return).   The downside to this is that you cannot do cookie persistence, or any other fancy Layer 7 features.</p>
<p>Depending on your situation, a compromise might be to setup two virtual IPs, each with identical real servers sitting behind them.Â  One would be for the public, which would preserve the IP address, and the other would be for client systems that sit on the same subnet, and that one would be set for non-transparent/proxy mode.</p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2007/05/08/same-sunbet-problem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Daylight Savings Time fix for older F5 BIG-IPs</title>
		<link>http://lbdigest.com/2007/03/07/daylight-savings-time-fix-for-older-big-ip/</link>
		<comments>http://lbdigest.com/2007/03/07/daylight-savings-time-fix-for-older-big-ip/#comments</comments>
		<pubDate>Wed, 07 Mar 2007 14:07:29 +0000</pubDate>
		<dc:creator>tony</dc:creator>
				<category><![CDATA[From The Mailing list]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://lbdigest.com/2007/03/07/daylight-savings-time-fix-for-older-big-ip/</guid>
		<description><![CDATA[On March 1st, a user asked the asked a question about what they might do to fix the DST problem (Daylight Savings Time), since it&#8217;s changing this year, for older F5 BIG-IP systems that were out of contract and ineligible for code fixes. Steve Lothspeich...]]></description>
			<content:encoded><![CDATA[<p>On March 1st, a user asked the <a href="http://vegan.net/lb/archive/03-2007/">asked a question</a> about what they might do to fix the DST problem (Daylight Savings Time), since it&#8217;s changing this year, for older F5 BIG-IP systems that were out of contract and ineligible for code fixes.</p>
<p><span id="from">Steve Lothspeich was kind enough to </span><a href="http://vegan.net/lb/archive/03-2007/0005.html">post a fix</a> <span id="from"></span>for the DST problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://lbdigest.com/2007/03/07/daylight-savings-time-fix-for-older-big-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
