<?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>mrz&#039;s noise &#187; load balancing</title>
	<atom:link href="http://blog.mozilla.com/mrz/category/load-balancing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mozilla.com/mrz</link>
	<description>noise from a mozilla IT/Operations wrangler</description>
	<lastBuildDate>Mon, 30 Jan 2012 17:07:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Geolocation &amp; Zeus ZXTM 6.0</title>
		<link>http://blog.mozilla.com/mrz/2009/10/22/geolocation-zeus-zxtm-6-0/</link>
		<comments>http://blog.mozilla.com/mrz/2009/10/22/geolocation-zeus-zxtm-6-0/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 23:07:29 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[zeus zxtm geo]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/?p=629</guid>
		<description><![CDATA[Mozilla&#8217;s North American store has been down in maintenance mode (you can read about the why) but not the International Store. The old store used to redirect non-North American users to the International Store, but unfortunately that redirect wasn&#8217;t carried over when we took the store offline. I was inspired Sunday night to put together&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2009/10/22/geolocation-zeus-zxtm-6-0/" title="Read the rest of &#8220;Geolocation &#38; Zeus ZXTM 6.0&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>Mozilla&#8217;s <a href="http://store.mozilla.org/">North American store</a> has been down in maintenance mode (you can read about the <a href="http://blog.mozilla.com/blog/2009/08/04/mozilla-store-vendor-security-breach/">why</a>) but not the <a href="http://intlstore.mozilla.org/">International Store</a>.  </p>
<p>The old store used to redirect non-North American users to the <a href="http://intlstore.mozilla.org/">International Store</a>, but unfortunately that redirect wasn&#8217;t carried over when we took the store offline.  </p>
<p>I was inspired Sunday night to put together a ZXTM TrafficScript rule based off the <a href="http://knowledgehub.zeus.com/articles/2007/09/18/geolocation">code sample</a> on Zeus&#8217;s knowledgehub (and because of bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=521914">521914</a>).</p>
<p>And then on Wednesday Zeus finally released <a href="http://knowledgehub.zeus.com/news/2009/10/20/zeus_traffic_manager_6_0_released">ZXTM 6.0</a> <i>with</i> geolocation support!</p>
<p>What was 40 some lines of code is now like 5.</p>
<p><b>Before:</b></p>
<blockquote>
<pre>
$ipaddr = request.getRemoteIP();

# Integer representation of $ipaddr >> 1
string.regexmatch( $ipaddr, "(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)" );
$ip = ((($1*256+$2)*256+$3)*128+$4/2);

$arr = resource.get( "geoip.dat" );

# initialize indices
$i = 0; $j = string.len( $arr )/6-1;

# $arr[$i] <= $ip < $arr[$j]
# iteratively halve the distance between $i and $j until they are adjacent

while( $j-$i > 1 ) {
   # midpoint between $i and $j
   $k = ($i+$j)/2;

   # compare $ip with $arr[$k]
   if( string.bytesToInt( string.subString( $arr, $k*6, $k*6+3 ) ) > $ip ) {
      $j = $k;
   } else {
      $i = $k;
   }
}

# Now, $arr[$i] <= $ip < $arr[$j] and $j == $i+1
# Look up the 2-character country code (returns '??' if unknown)
$ccode = string.subString( $arr, $i*6+4, $i*6+5 );

if ( ($ccode != "US") &#038;&#038; ($ccode != "CA") ) {
}
else {
   http.redirect("https://intlstore.mozilla.org/");
}
</pre>
</blockquote>
<p><b>After:</b></p>
<blockquote>
<pre>
$ipaddr = request.getRemoteIP();

$country = geo.getCountryCode( $ipaddr );

if ( ($country != "US") &#038;&#038; ($country != "CA") ) {
      http.redirect("https://intlstore.mozilla.org/");
}
​</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2009/10/22/geolocation-zeus-zxtm-6-0/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Where in the world is AMO? (Part VI: We did it again!)</title>
		<link>http://blog.mozilla.com/mrz/2009/09/25/where-in-the-world-is-amo-part-vi-we-did-it-again/</link>
		<comments>http://blog.mozilla.com/mrz/2009/09/25/where-in-the-world-is-amo-part-vi-we-did-it-again/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 16:08:28 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/?p=567</guid>
		<description><![CDATA[(See Part V.) I have a confession.  We secretly did something last night (we only barely announced it to Metrics). No, we didn&#8217;t secretly replace the fine coffee at some four-star restaurant but pretty close. Hot off our 2 second gain in average page load times for addons.mozilla.org, we shaved another 2 seconds off by&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2009/09/25/where-in-the-world-is-amo-part-vi-we-did-it-again/" title="Read the rest of &#8220;Where in the world is AMO? (Part VI: We did it again!)&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>(See <a href="http://blog.mozilla.com/mrz/2007/06/13/where-in-the-world-is-amo-part-v-it%E2%80%99s-live-again/">Part V</a>.)</p>
<p>I have a confession.  We secretly did something last night (we only barely announced it to Metrics).</p>
<p>No, we didn&#8217;t secretly replace the <a href="http://en.wikipedia.org/wiki/Folgers#Advertising_the_brand">fine coffee at some four-star restaurant</a> but pretty close.</p>
<p>Hot off our <a href="http://blog.mozilla.com/mrz/2009/09/18/2-seconds/">2 second</a> gain in average page load times for <a href="https://addons.mozilla.org/"><code>addons.mozilla.org</code></a>, we shaved <span style="text-decoration: underline;"><i>another 2 seconds</i></span> off by duplicating <a href="http://blog.mozilla.com/mrz/2009/08/24/the-amsterdam-reboot/">The Amsterdam Reboot</a> platform in Singapore (<i>as a proof-of-concept</i>).  Don&#8217;t take my word for it &#8211; take Gomez&#8217;s word:</p>
<p style="text-align: center;"><a href="http://blog.mozilla.com/mrz/files/2009/09/amo-sg-gomez.png"><img class="aligncenter size-full wp-image-569" title="AMO page load times (Gomez)" src="http://blog.mozilla.com/mrz/files/2009/09/amo-sg-gomez.png" alt="AMO page load times (Gomez)" width="845" height="311" /></a></p>
<h3><b>A little background</b></h3>
<p><a href="http://blog.mozilla.com/mrz/files/2009/09/amo-glb.png"><img src="http://blog.mozilla.com/mrz/files/2009/09/amo-glb-300x142.png" alt="Zeus GLB" title="Zeus GLB" width="300" height="142" class="alignright size-medium wp-image-568" /></a>For what seems like ages I&#8217;ve been trying to figure out how to best serve Asia-Pacific users.  It&#8217;s a tough case to make because I didn&#8217;t have a method to easily measure how much bandwidth traffic I&#8217;d need or how it would change page load times or user perceptions.</p>
<p>But I&#8217;m a network guy and I&#8217;ve had this feeling that we need something in this region.  We certainly have a growing population in the area &#8211; 5 of the top 9 countries we&#8217;ve seen > 20% growth in the last five months have been in Asia.  I&#8217;ve only been lacking operational data.</p>
<p><img src="http://blog.mozilla.com/mrz/files/2009/09/amo-sg-bw2-300x199.png" alt="AMO .sg bandwidth" title="AMO .sg bandwidth" width="300" height="199" class="alignleft size-medium wp-image-603" />Over the summer I&#8217;ve been playing and testing <a href="http://voxel.net/">Voxel&#8217;s</a> Silverlining Technology Preview, their global cloud computer platform.  On October 1, it&#8217;s going to move out of Preview and their cloud platform would be generally available in all their POPs, including Singapore.</p>
<p>Seemed like a good way to get data&#8230;</p>
<p>In a matter of hours I had spun up two Zeus <a href="http://www.zeus.com/products/zxtm/index.html">ZXTM</a> and one <a href="http://www.zeus.com/products/zxtmglb/index.html">GLB</a> cloud servers with Voxel in Singapore.  I waited till our normal Thursday night window before turning it live.</p>
<h3><b>A couple take away notes on this</b></h3>
<ol>
<li>We did it right.  We built a proxy/caching platform as part of The Amsterdam Reboot that can easily be replicated anywhere and instantly provide real quantifiable performance benefits.</li>
<li>Clouds make perfect sense to do proof-of-concepts.</li>
<li>IT can move really fast.  We had these three servers ready to go Wednesday morning in a couple hours..</li>
<li>Mozilla&#8217;s webdev crew does an awesome job writing extremely cachable webapps.  I&#8217;m seeing a 91% cache hit rate (350,000 objects, 1.5GB).</li>
<li>If this is a sustainable location, pushing user-focused sites like <a href="http://support.mozilla.com/"><code>support.mozilla.com</code></a> to Singapore are next on my list.
<li>I&#8217;d love to run this concept in other geographies like South America.  Who does clouds down there?
</ol>
<p>What I most like about this platform is that it&#8217;ll allow us to strategically get content closer to users where it most makes sense.  </p>
<p><i>This is right now just a proof-of-concept.  It lets me experiment and get real metrics. I&#8217;m very interested in hearing from people who actually live in the area &#8211; does this make you happier?</i></p>
<h3><b>One more thing</b></h3>
<p>I was lucky to have two providers who stepped in and provided resources to let me run this POC.  Both deserve a special thanks.</p>
<ol>
<li><a href="http://www.zeus.com/"><b>Zeus</b>.</a>  These  guys are great and quickly issued temporary licenses for both ZXTM and GLB.</li>
<li><a href="http://voxel.net/"><b>Voxel</b></a>.  You  guys have a nice platform in the right part of the world.  I like working with you.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2009/09/25/where-in-the-world-is-amo-part-vi-we-did-it-again/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Load Balancer performance issues, fxfeeds.mozilla.org &amp; versioncheck</title>
		<link>http://blog.mozilla.com/mrz/2008/12/04/load-balancer-performance-issues-fxfeedsmozillaorg-versioncheck/</link>
		<comments>http://blog.mozilla.com/mrz/2008/12/04/load-balancer-performance-issues-fxfeedsmozillaorg-versioncheck/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 07:08:36 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[citrix]]></category>
		<category><![CDATA[netscaler]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/?p=178</guid>
		<description><![CDATA[I mentioned briefly in Monday&#8217;s meeting the performance issues we&#8217;re having with our load balancers.  Since then, we&#8217;ve been hustling to turn up something in the short term to handle Thursday&#8217;s Major Update and Firefox 3.0.5/2.0.0.19 release (see here). For a number of months we&#8217;ve been looking at Zeus and their ZXTM product.  It has&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2008/12/04/load-balancer-performance-issues-fxfeedsmozillaorg-versioncheck/" title="Read the rest of &#8220;Load Balancer performance issues, fxfeeds.mozilla.org &#38; versioncheck&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>I mentioned briefly in <a href="https://wiki.mozilla.org/WeeklyUpdates/2008-12-01#IT">Monday&#8217;s meeting</a> the performance issues we&#8217;re having with our load balancers.  Since then, we&#8217;ve been hustling to turn up <em>something</em> in the short term to handle Thursday&#8217;s Major Update and Firefox 3.0.5/2.0.0.19 release (see <a href="https://wiki.mozilla.org/Releases">here</a>).</p>
<p>For a number of months we&#8217;ve been looking at <a href="http://www.zeus.com/">Zeus</a> and their <a href="http://www.zeus.com/products/zxtm/index.html">ZXTM</a> product.  It has some advantages (and some disadvantages) and one of the biggest is that it&#8217;s all software and I can quickly deploy it on any available hardware we have.  <a href="http://www.zeus.com/">Zeus</a> has been extremely helpful in quickly issuing unlimited node eval license keys on short notice (so thanks Jasper/Chris) and providing the level of supported I&#8217;d more likely expect to be given to a paying customer.</p>
<p>We&#8217;ve shifted two of the highest traffic back-end infrastructure services for Firefox over to a Zeus ZXTM cluster:</p>
<ol>
<li><tt>fxfeeds.mozilla.org</tt> &#8211; Live Bookmarks feed URL in a default Firefox install.</li>
<li><tt>versioncheck.addons.mozilla.org</tt> &#8211; URL Firefox uses to check for Add-On updates.</li>
</ol>
<p><tt>fxfeeds.mozilla.org</tt> is nothing more than an RSS feed.  The site itself has no real content &#8211; there isn&#8217;t even a DocumentRoot defined in Apache.  In fact, the config is nothing but 40 HTTP redirects:</p>
<pre style="padding-left: 30px;">[root@mradm02 domains]# egrep 'Redirect|Rewrite' fxfeeds.mozilla.org.conf  | wc -l
40</pre>
<p><tt>versioncheck.addons.mozilla.org</tt> is my one Firefox 3 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=416416">claim-to-fame</a>.  Without that change, a lot of the scalability work we&#8217;re doing would be extremely difficult and require a lot more QA time.</p>
<p>Since Firefox checks for Add-On updates after updating itself (and periodically on its own), <tt>versioncheck.addons.mozilla.org</tt> is one of the sites that sees a large spike in traffic around release time.  It&#8217;s also highly cachable content and easy to scale with CPU (for SSL) and memory (for cache).</p>
<p>I moved <tt>fxfeeds.mozilla.org </tt>over yesterday and was astonished to see what sort of traffic that site alone generated &#8211; staggering might be a better way to say it.  Nearly 40Mbps of basically 302 redirects and upwards of 400,000 connections/second (and incidentally, moving that site off the Netscalers significantly dropped its resources issues).</p>
<p><tt>versioncheck.addons.mozilla.org </tt>was moved Monday morning onto a test ZXTM cluster and again later this afternoon on a more production capable ZXTM cluster.  It&#8217;ll push 30Mbps on its own during non-release periods and 2-3x that during a full release.</p>
<p>Since no post is good without pictures, I grabbed two graphs from the ZXTM cluster.  The first shows connections/second and the other shows bandwidth (bits per second).</p>
<p style="text-align: center;"><a href="http://blog.mozilla.com/mrz/files/2008/12/zxtm-fxfeeds-vamo-hits.png"><img class="size-full wp-image-181 aligncenter" title="Connections/second, fxfeeds &amp; versioncheck" src="http://blog.mozilla.com/mrz/files/2008/12/zxtm-fxfeeds-vamo-hits.png" alt="" width="500" height="396" /></a><a href="http://blog.mozilla.com/mrz/files/2008/12/zxtm-fxfeeds-vamo-bw.png"><img class="alignnone size-full wp-image-180" title="Bandwidth, fxfeeds &amp; versioncheck" src="http://blog.mozilla.com/mrz/files/2008/12/zxtm-fxfeeds-vamo-bw.png" alt="" width="500" height="388" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2008/12/04/load-balancer-performance-issues-fxfeedsmozillaorg-versioncheck/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Christmas Load Balancers</title>
		<link>http://blog.mozilla.com/mrz/2008/12/01/christmas-load-balancers/</link>
		<comments>http://blog.mozilla.com/mrz/2008/12/01/christmas-load-balancers/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 04:22:14 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/?p=173</guid>
		<description><![CDATA[Dear Santa, All I want for Christmas is a load balancer that does not suck.  It should do the following: Terminate and offload SSL sessions at a rate of no less than 20,000/sec Provide in-memory content caching Support web logging, Apache-style (and despite what some hardware vendors thing, web logging is really important) Have some&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2008/12/01/christmas-load-balancers/" title="Read the rest of &#8220;Christmas Load Balancers&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>Dear Santa,</p>
<p>All I want for Christmas is a load balancer that does not suck.  It should do the following:</p>
<ol>
<li>Terminate and offload SSL sessions at a rate of no less than 20,000/sec</li>
<li>Provide in-memory content caching</li>
<li>Support web logging, Apache-style (and despite what some hardware vendors thing, web logging is really important)</li>
<li>Have some method of scaling capacity (particularly at the SSL layer)</li>
</ol>
<p>I know this is a lot to ask for but I&#8217;ve been good this past year.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2008/12/01/christmas-load-balancers/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>geodns, one week later</title>
		<link>http://blog.mozilla.com/mrz/2008/06/11/geodns-one-week-later/</link>
		<comments>http://blog.mozilla.com/mrz/2008/06/11/geodns-one-week-later/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 17:43:12 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/?p=93</guid>
		<description><![CDATA[Finally got our home-grown GeoDNS deployed last week, one week later than I wanted.  A couple deployment issues and bug 435134 got in the way. We&#8217;re finding all sorts of uses for this now and have moved several websites over to this and have a couple more websites/services (like IRC) scheduled for this. Purely out&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2008/06/11/geodns-one-week-later/" title="Read the rest of &#8220;geodns, one week later&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>Finally got our <a href="http://blog.mozilla.com/mrz/2008/05/26/geo-dns-or-getting-the-bits-closer-to-you/">home-grown GeoDNS</a> deployed last week, one week later than I wanted.  A couple deployment issues and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=435134">bug 435134</a> got in the way.</p>
<p>We&#8217;re finding all sorts of uses for this now and have moved several websites over to this and have a couple more websites/services (like IRC) scheduled for this.</p>
<p>Purely out of interest I graphed the number of queries per hour through geodns from the two nameservers (one in San Jose, another in Amsterdam) and got:</p>
<p><span style="color: #551a8b;text-decoration: underline"><a href="http://blog.mozilla.com/mrz/files/2008/06/gloablqueries.png"></a><a href="http://blog.mozilla.com/mrz/files/2008/06/gloablqueries.png"><img class="aligncenter size-full wp-image-94" src="http://blog.mozilla.com/mrz/files/2008/06/gloablqueries.png" alt="Worldwide GeoDNS Queries" width="500" height="263" /></a><br />
</span></p>
<p>I was concerned that two VMs wouldn&#8217;t work and I&#8217;d be looking at needing physical hardware but that hasn&#8217;t turned out to be the case yet (barely pushes more than 100Kbps with very little CPU load).  Although, since I&#8217;ve recently become a <a href="http://www.vmware.com/products/vi/vc/drs.html">VMware DRS</a> fan (like this <a href="http://blog.mozilla.com/justin/2008/05/21/virtual-utility-computing-finally-a-reality-mostly/">guy</a>) we&#8217;ve already cloned the San Jose nameserver and will be adding that as a third nameserver.  Since adding another nameserver/VM splits the load I also think this will scale nicely.</p>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2008/06/11/geodns-one-week-later/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Geo DNS or getting the bits closer to you.</title>
		<link>http://blog.mozilla.com/mrz/2008/05/26/geo-dns-or-getting-the-bits-closer-to-you/</link>
		<comments>http://blog.mozilla.com/mrz/2008/05/26/geo-dns-or-getting-the-bits-closer-to-you/#comments</comments>
		<pubDate>Mon, 26 May 2008 15:14:12 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[citrix]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[netscaler]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/?p=81</guid>
		<description><![CDATA[The Mozilla community is blessed with a lot of freely donated bandwidth through our mirror network.  This network handles product downloads through bouncer and a subset of this handles releases.mozilla.org, which carries contains Firefox, Thunderbird, Camino, Seamonkey, and Sunbird releases and Add-ons (and is huge, clocking in around 100-130G). releases.mozilla.org is handled through round-robin DNS. &#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2008/05/26/geo-dns-or-getting-the-bits-closer-to-you/" title="Read the rest of &#8220;Geo DNS or getting the bits closer to you.&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>The Mozilla community is blessed with a lot of freely donated bandwidth through our mirror network.  This network handles product downloads through bouncer and a subset of this handles <a href="http://releases.mozilla.org/pub/mozilla.org/">releases.mozilla.org</a>, which carries contains Firefox, Thunderbird, Camino, Seamonkey, and Sunbird releases and <a href="https://addons.mozilla.org/">Add-ons</a> (and is <em>huge</em>, clocking in around 100-130G).</p>
<p><a href="http://releases.mozilla.org/pub/mozilla.org/">releases.mozilla.org</a> is handled through round-robin DNS.  Regardless where you are in the world, you&#8217;ll get a &#8220;random&#8221; release mirror that may or may not be anywhere close to you and because of various <a href="http://en.wikipedia.org/wiki/Speed_of_light">physical</a> reasons might induce a lot of latency and may or may not take a long time to download (admittedly, non-interactive transfers are less worried about latency but sitting in New York and downloading from China is going to take a long time).</p>
<p>As a network guy, I like to get my content as close to users as possible.  I know from my <a href="http://blog.mozilla.com/mrz/2007/08/26/china-day-one/">two</a> <a href="http://blog.mozilla.com/mrz/2007/12/12/china-datacenter-by-the-wall-clock-numbers/">visits</a> to China that getting <a href="https://addons.mozilla.org/">Add-ons</a> updates from European mirror blow especially when I&#8217;m mere miles from <a href="http://releases.mozillaonline.com//pub/mozilla.org/">our China release mirror</a>!</p>
<p>After looking at a couple commercial solutions we decided to build our own geodns solution using the latest version of <a href="http://www.isc.org/sw/bind/">BIND</a> and two patches to add <a href="http://www.caraytech.com/geodns/">Maxmind&#8217;s GeoIP</a> functionality and to replace the <a href="http://mysql-bind.sourceforge.net/docs.php">backend zonefiles with MySQL</a>.  That last patch lets us do all sorts of interesting thinks like nailing off <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=406267">bug 406267</a> (easily anyways, without having to munge text files).</p>
<p><a href="http://blog.mozilla.com/mark/">Mark&#8217;s</a> been working on all of the CLI management end to enable us to add or disable mirrors.  Hopefully I can get him to blog about the technical details but I&#8217;ll just add that prior to this I didn&#8217;t know anything about SQL views.</p>
<p>So when are we going deploy this?  Glad you asked.</p>
<p>On Tuesday, May 27 we&#8217;ll flip the switch and change <a href="http://releases.mozilla.org/pub/mozilla.org/">releases.mozilla.org</a> to a CNAME to releases.geo.mozilla.com, which, until Tuesday, will be in various states of testing but should work should be so inclined to try.</p>
<p>Currently, of the 15 release mirrors, 9 are in the US and 2 are in China.  The initial rollout will only directly benefit our Chinese users by directing them to the two <a href="http://www.mozillaonline.com/">Mozilla Online</a> release mirrors in China.  Later we&#8217;ll try to do something on a geo-regional basis (but first, we&#8217;d want more than 3 mirrors in EU- <a href="http://blog.mozilla.com/justin/2008/02/19/call-out-for-mirrors/">anyone?</a>)</p>
<p>This is just the tip of the iceberg.  Globally we use <a href="http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/">Netscaler-based GSLB</a> to load balance and direct users to the network-wise closest site.  However, not all Mozilla properties are behind the Netscaler (or need to be) and we haven&#8217;t had a good way to serve users from different data centers unless they were.</p>
<p>Down the road we planning on adding some sort of weighting (not all mirrors or sites are equal), query statistics (where are lookups coming from?) and some sort of Nagios integration to automatically disable/enable a record.</p>
<p>And hopefully users will rejoice!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2008/05/26/geo-dns-or-getting-the-bits-closer-to-you/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hello China, part III.</title>
		<link>http://blog.mozilla.com/mrz/2008/03/10/hello-china-part-iii/</link>
		<comments>http://blog.mozilla.com/mrz/2008/03/10/hello-china-part-iii/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 17:27:16 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[citrix]]></category>
		<category><![CDATA[netscaler]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/2008/03/10/hello-china-part-iii./</guid>
		<description><![CDATA[We&#8217;ve been pushing production traffic out of our China colo for about a month now.  One of my concerns was how well this site would serve our global user base and how well the Netscaler&#8217;s dynamic GSLB would work.  I didn&#8217;t want users being sent to this data center who should really goto San Jose&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2008/03/10/hello-china-part-iii/" title="Read the rest of &#8220;Hello China, part III.&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been <a href="http://blog.mozilla.com/mrz/2008/02/13/hello-china-part-ii./">pushing production traffic</a> out of our China colo for about a month now.  One of my concerns was how well this site would serve our global user base and how well the Netscaler&#8217;s dynamic GSLB would work.  I didn&#8217;t want users being sent to this data center who should really goto San Jose or Amsterdam.</p>
<p>To check this I ran two weeks&#8217; worth of web server logs through <a href="http://awstats.sourceforge.net/">awstats</a> with the geoip plugin.  From this, I&#8217;ve learned the following:</p>
<ol>
<li>I was wrong.  In <a href="http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/">this post</a> I said that &#8220;connectivity to mainland China can often be congested and can induce a lot of latency.&#8221;  Round-trip times between San Jose and China are only 30ms more than they are to Amsterdam (195ms vs. 166ms).  I don&#8217;t see any of the congestion that I saw from either of the two hotels I stayed or at that I see from the China office.</li>
<li>We&#8217;re serving a large portion of the Asia-Pacific region out of our Beijing, China colo. Far more than I think any of us had thought and we&#8217;re doing it remarkably well (even <a href="http://www.gomez.com/">Gomez</a> says so)!  I&#8217;ve even received emails from folks in that region wondering why <a href="http://www.mozilla.com/">www.mozilla.com</a> is so much quicker/closer than any of Mozilla&#8217;s other web properties.</li>
</ol>
<p>Looking at those log hits through <a href="http://awstats.sourceforge.net/">awstats</a> and pushing those results into <a href="http://www.apple.com/iwork/numbers/">Numbers</a> gets me this:</p>
<p align="center"><img src="http://blog.mozilla.com/mrz/files/2008/03/china-gslb-pie.png" alt="China Traffic Distribution" /></p>
<p align="left"><span>(The 5% USA appears to be a combination of errors in the allocation database (IP is registered to a US entity but traceroute shows otherwise) and a few US-based ISPs that, for whatever reason, keep hitting China.  Other is a lot of smaller hits to Asia-Pacific countries and some IP addresses that didn&#8217;t automatically resolve to a country.)</span></p>
<p>Since the color seperation might be hard to read, the raw numbers are here.</p>
<table border="1" cellspacing="0" align="center">
<tbody>
<tr>
<th align="center">Country</th>
<th>Hits</th>
</tr>
<tr>
<td>China</td>
<td align="right">48,224,530</td>
</tr>
<tr>
<td>Other</td>
<td align="right">25,899,447</td>
</tr>
<tr>
<td>Japan</td>
<td align="right">10,733,590</td>
</tr>
<tr>
<td>Malaysia</td>
<td align="right">8,623,076</td>
</tr>
<tr>
<td>USA</td>
<td align="right">6,457,133</td>
</tr>
<tr>
<td>India</td>
<td align="right">6,259,568</td>
</tr>
<tr>
<td>Taiwan</td>
<td align="right">5,546,381</td>
</tr>
<tr>
<td>Vietnam</td>
<td align="right">5,504,547</td>
</tr>
<tr>
<td>Philippines</td>
<td align="right">4,613,708</td>
</tr>
<tr>
<td>Hong Kong</td>
<td align="right">4,107,188</td>
</tr>
<tr>
<td>Austria</td>
<td align="right">2,664,964</td>
</tr>
</tbody>
</table>
<p>I&#8217;m generally very happy with these results.  In the next few weeks we should be adding <a href="http://addons.mozilla.org/">addons.mozilla.org</a> and spinning up our geo-dns setup to start pushing <a href="http://releases.mozilla.org/">releases.mozilla.org</a> out of China too.  Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2008/03/10/hello-china-part-iii/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Hello China.</title>
		<link>http://blog.mozilla.com/mrz/2008/02/11/hello-china/</link>
		<comments>http://blog.mozilla.com/mrz/2008/02/11/hello-china/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 19:55:34 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[china]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/2008/02/11/hello-china./</guid>
		<description><![CDATA[Over the past year we&#8217;ve talked about our market share in China (since last April anyways). Li Gong joined Mozilla and in June we had an office. In August I was in China with Justin to setup office infrastructure (phones, vpn) and shop for data center space. In December I was back in China to&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2008/02/11/hello-china/" title="Read the rest of &#8220;Hello China.&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>Over the past year we&#8217;ve talked about our <a href="http://john.jubjubs.net/2007/11/27/mozilla-firefox-market-share/">market share</a> in China  (since last <a href="http://weblogs.mozillazine.org/mitchell/archives/2007/04/ever_more_global.html">April</a> anyways).  <a href="http://blog.mozilla.com/ligong/">Li Gong</a> joined Mozilla and in June we had an <a href="http://blog.mozilla.com/ligong/2007/06/30/beijing-office-open-for-business/">office</a>.  In <a href="http://blog.mozilla.com/mrz/2007/08/26/china-day-one/">August </a>I was in China with Justin to setup office infrastructure (phones, vpn)  and shop for data center space.</p>
<p>In <a href="http://blog.mozilla.com/mrz/2007/12/12/china-datacenter-by-the-wall-clock-numbers/">December</a> I was back in China to install and deploy that data center and promised that &#8220;in the next several weeks  we’ll be pulling up Mozilla websites in China.&#8221;</p>
<p>This past week[<a href="http://blog.mozilla.com/mrz/2008/02/11/hello-china./#1">1</a>] we did two important things for our Chinese users -</p>
<ol>
<li>Integrated <a href="http://www.mozillaonline.com">www.mozillaonline.com</a> into our svn repo and pushed out its content to all static web clusters in Amsterdam, San Jose and China (it used to be hosted off a fileserver in the China office!).  This site&#8217;s currently served out of San Jose and China.</li>
<li>Setup a mirror of <a href="http://releases.mozilla.org">releases.mozilla.org</a> in China.  This is currently known as <a href="http://releases.mozillaonline.com">releases.mozillaonline.com</a> (until we get a more geo-aware DNS solution in place for <a href="http://releases.mozilla.org">releases.mozilla.org</a> you&#8217;ll have to use that address).</li>
</ol>
<p>This week we&#8217;ll  make another important change.</p>
<p>During Tuesday night&#8217;s maintenance window (02/12 @ 8pm Pacific) I&#8217;ll be adding the China datacenter into <a href="http://www.mozilla.com">www.mozilla.com</a>&#8216;s global load balancing (which I talked about <a href="http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/">here</a>).  As I mentioned in my last post, we&#8217;ll also be watching the server logs to make sure GSLB isn&#8217;t sending users outside of China to China when they&#8217;d be better served out of San Jose or Amsterdam.  If you find yourself in this category, please let me know (email or file a <a title="Bugzilla" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=mozilla.org&amp;format=itrequest" target="_blank">bug</a>).</p>
<p>All of this effort has been to get content as close as possible to users.  From my two trips to China I know getting to Mozilla content is often painfully slow, reminiscent of my pre-ISDN days.  Updating Minefield nightlies every morning was often a couple hour process!</p>
<p align="left"><a title="1" name="1"></a><span>[1] I started this post with the intention of posting it January 28th but got side tracked when the host that holds all web content (before pushing out to the web servers) and all of the <a href="http://releases.mozilla.org">releases.mozilla.org</a> mirror content lost it&#8217;s storage shelf, halting all of these plans. Because of <a href="http://www.msnbc.msn.com/id/22882150/">this storm</a> it took longer than usual to get resolved.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2008/02/11/hello-china/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>China, Amsterdam, San Jose and global load balancing</title>
		<link>http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/</link>
		<comments>http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 07:26:07 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[citrix]]></category>
		<category><![CDATA[netscaler]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/</guid>
		<description><![CDATA[Mozilla&#8217;s current GSLB (global server load balancing[1]) solution (Citrix Netscalers) is a mix of active proximity probes and static map assignments. The algorithm first checks to see if there&#8217;s a match in the static maps and then falls back to proximity metrics. If that&#8217;s missing, it&#8217;ll round-robin through all the GSLB sites (effectively three &#8211;&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/" title="Read the rest of &#8220;China, Amsterdam, San Jose and global load balancing&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>Mozilla&#8217;s current GSLB (global server load balancing[<a href="http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/#1">1</a>]) solution (<a href="http://citrix.com/English/ps2/products/product.asp?contentID=21679&amp;ntref=hp_nav_US">Citrix Netscalers</a>) is a mix of active proximity probes and static map assignments.</p>
<p>The algorithm first checks to see if there&#8217;s a match in the static maps and then falls back to proximity metrics.  If that&#8217;s missing, it&#8217;ll round-robin through all the GSLB sites (effectively three &#8211; San Jose, Amsterdam and China &#8211; though technically it&#8217;s six and actually it&#8217;ll only round-robin through sites that have that service/site defined).</p>
<p>In practice, this round-robin fallback hasn&#8217;t been terribly user impacting mostly.  You&#8217;d only ever hit the round-robin fallback if no one in your network (/16 in this case, but based on the source address of whatever name server you used) had ever accessed any of Mozilla&#8217;s web properties. And while that&#8217;s possible, the performance his is really minimal. But then up until now, we&#8217;ve only had two GSLB sites to send users to and San Jose and Amsterdam are well connected.</p>
<p align="left">China changes things. Connectivity to mainland China can often be congested and can induce a lot of latency (which matters less for downloads than it does for interactive sites).  If you&#8217;re in New York and fall through to round-robin, you very likely don&#8217;t want to end up taking 80ms to the west coast and another 300ms-400ms to China.  This is a bad user experience.</p>
<p align="left">If you don&#8217;t believe me, look at my trip times from San Jose to some Mozilla gear in China:</p>
<blockquote>
<p align="left"><tt>mrz@boris [~/] 15&gt; ping mozcn01<br />
PING mozcn01  (10.86.35.203) 56(84) bytes of data.<br />
64 bytes from mozcn01 (10.86.35.203): icmp_seq=6 ttl=237 time=389 ms<br />
64 bytes from mozcn01 (10.86.35.203): icmp_seq=9 ttl=237 time=439 ms</tt></p>
<p align="left"><tt>mrz@boris [~/] 17&gt; ping releases.mozillaonline.com<br />
PING releases-cn.glb.mozilla.com (59.151.50.34) 56(84) bytes of data.<br />
64 bytes from 59.151.50.34: icmp_seq=0 ttl=231 time=206 ms<br />
64 bytes from 59.151.50.34: icmp_seq=1 ttl=231 time=212 ms<br />
64 bytes from 59.151.50.34: icmp_seq=2 ttl=231 time=205 ms</tt></p></blockquote>
<p align="left">Since December I&#8217;ve been working on ways to exclude China from the fallback round-robin method while making sure our Chinese users don&#8217;t goto San Jose or Amsterdam.  The latter was easier &#8211; using <a href="http://www.maxmind.com/app/geolitecountry">MaxMind&#8217;s GeoLite</a> database I&#8217;ve built a static proximity location map assigning all IP addresses in China to the China datacenter.  The former, excluding China from round-robin, took longer to figure out.</p>
<p align="left">One of the GSLB methods the Netscalers have is a &#8220;weighted round-robin&#8221; and while it&#8217;s not documented, it turns out that weights apply even to the fallback round-robin method.  Weights range from 1 to 100.  So now I can do something like:</p>
<blockquote>
<p align="left"><tt>bind gslb vserver glb-mozcom -serviceName mozcom-80-sj -weight 100<br />
bind gslb vserver glb-mozcom -serviceName mozcom-80-cn01<br />
bind gslb vserver glb-mozcom -serviceName mozcom-80-cn02<br />
bind gslb vserver glb-mozcom -serviceName mozcom-80-nl01 -weight 50<br />
bind gslb vserver glb-mozcom -serviceName mozcom-80-nl02 -weight 50</tt></p></blockquote>
<p align="left">which will send 200 requests  to either San Jose or Amsterdam before sending -1- request to China.</p>
<p align="left">It&#8217;ll be interesting to see what the actual user impact of this is and if anyone not in mainland China ends up hitting China.  We&#8217;ll be testing this for a week, starting next Tuesday, with <a href="http://www.mozilla.com/">www.mozilla.com</a> and looking at the web server logs to see where users are coming from.</p>
<p align="left">I&#8217;d also be interested in feedback from you if you find yourself in China and you should be elsewhere or your find yourself in China and <a href="http://www.mozilla.com/">www.mozilla.com</a> is quicker for you!</p>
<p align="left"><a title="1" name="1"></a><font size="-2">[1]GSLB works by looking up the IP address of the host that made a DNS request to <em>somehost</em>.glb.mozilla.com and determining which data center is closest.   This is a fairly common method to do global load balancing.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2008/01/24/china-amsterdam-san-jose-and-global-load-balancing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where in the world is AMO? (Part V: It’s live, again!)</title>
		<link>http://blog.mozilla.com/mrz/2007/06/13/where-in-the-world-is-amo-part-v-it%e2%80%99s-live-again/</link>
		<comments>http://blog.mozilla.com/mrz/2007/06/13/where-in-the-world-is-amo-part-v-it%e2%80%99s-live-again/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 22:47:59 +0000</pubDate>
		<dc:creator>mrz</dc:creator>
				<category><![CDATA[load balancing]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/mrz/2007/06/13/where-in-the-world-is-amo-part-v-it%e2%80%99s-live-again/</guid>
		<description><![CDATA[With little fanfare, we flipped the switch last night and started serving addons.mozilla.org out of both Amsterdam and San Jose. Took two tries and a hardware swap, but we got it! This whole saga&#8217;s been detailed elsewhere (and here and here and here). The Good (and the graphs) Last time, I rolled back when Europe&#8230; <a class="more-link" href="http://blog.mozilla.com/mrz/2007/06/13/where-in-the-world-is-amo-part-v-it%e2%80%99s-live-again/" title="Read the rest of &#8220;Where in the world is AMO? (Part V: It’s live, again!)&#8221;">Read more</a>]]></description>
			<content:encoded><![CDATA[<p>With little fanfare, we flipped the switch last night and started serving <a href="https://addons.mozilla.org">addons.mozilla.org</a> out of both Amsterdam and San Jose.  Took two tries and a hardware swap, but we got it!</p>
<p>This whole saga&#8217;s been detailed <a href="http://blog.mozilla.com/mrz/2007/05/07/where-in-the-world-is-amo/">elsewhere</a> (and <a href="http://blog.mozilla.com/mrz/2007/05/08/where-in-the-world-is-amo-part-ii-its-live/">here</a> and <a href="http://blog.mozilla.com/mrz/2007/05/09/where-in-the-world-is-amo-part-iii-its-dead./">here</a> and <a href="http://blog.mozilla.com/mrz/2007/06/11/where-in-the-world-is-amo-part-iv-take-2/">here</a>).</p>
<p><strong>The Good (and the graphs)</strong><br />
<a href="http://blog.mozilla.com/mrz/2007/05/09/where-in-the-world-is-amo-part-iii-its-dead./">Last time</a>, I rolled back when Europe started waking up (~12:30am PDT).  The Netscalers hit close to 900 SSL transactions/second before failing.  As you can see, we more than doubled that rate!</p>
<p><img src="http://blog.mozilla.com/mrz/files/2007/06/amo-ssl.png" alt="AMO SSL Trans/sec" /></p>
<p><a href="https://addons.mozilla.org">addons.mozilla.org</a> is highly cache-friendly, which makes this whole solution work really well.  Don&#8217;t believe me?  Check out how the slope of cache request/second match nicely with SSL transactions/second:</p>
<p><img src="http://blog.mozilla.com/mrz/files/2007/06/ssl-cache.png" alt="SSL &amp; Cache Rates" /></p>
<p><strong>Where is everyone?</strong><br />
And finally, because everyone likes graphs and charts, here&#8217;s what <a href="https://addons.mozilla.org">AMO</a> traffic looks like out of Amsterdam (and bonus points to anyone who can tell me when we made the DNS change):</p>
<p><img src="http://blog.mozilla.com/mrz/files/2007/06/amo-traffic.png" alt="AMO Traffic" /></p>
<p>&#8230; and out of San Jose:</p>
<p><img src="http://blog.mozilla.com/mrz/files/2007/06/amo-sj-traffic.png" alt="AMO (SJC) Traffic" /></p>
<p><a href="http://john.jubjubs.net/2007/05/18/growth-around-the-world/">John Lilly blogged about Firefox growth</a> based on language (locale) version, and while the US probably accounts for the majority of the traffic out of San Jose, the US is not,  as John points out, the majority.  55% of AMO&#8217;s traffic is coming out of Amsterdam vs. 44% out of San Jose.</p>
<p>ps. To give credit where credit&#8217;s due, I should thank Citrix for aborting their normal release process to get me new code builds to get around two potential service impacting bugs.  Took them a mere few days vs. six weeks, so rock on Citrix.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/mrz/2007/06/13/where-in-the-world-is-amo-part-v-it%e2%80%99s-live-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

