<?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>iWeb Blog &#187; load-balancing</title>
	<atom:link href="http://blog.iweb.com/en/tag/load-balancing/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.iweb.com/en</link>
	<description>iWeb&#039;s News, Updates and Notifications</description>
	<lastBuildDate>Fri, 10 Feb 2012 01:22:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Website Latency Tips and the Path to Faster and Scalable websites</title>
		<link>http://blog.iweb.com/en/2009/04/website-latency-tips-and-the-path-to-faster-and-scalable-websites/2395.html</link>
		<comments>http://blog.iweb.com/en/2009/04/website-latency-tips-and-the-path-to-faster-and-scalable-websites/2395.html#comments</comments>
		<pubDate>Thu, 16 Apr 2009 12:30:36 +0000</pubDate>
		<dc:creator>heri</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[haproxy]]></category>
		<category><![CDATA[iWeb]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[latency]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[load-balancing]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[RabbitMQ]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.iweb.com/en/?p=2395</guid>
		<description><![CDATA[If you go through guides and blog posts published on the iWeb blog for the past three months, you can see many articles on how to setup a website, how to choose a dedicated server, how to transfer your website to a new host, etc. 
So far, there weren&#8217;t any advanced articles mentioning advanced setups [...]]]></description>
			<content:encoded><![CDATA[<p>If you go <a href="http://blog.iweb.com/en/category/web-development">through guides</a> <a href="http://blog.iweb.com/en/category/web-hosting">and blog posts</a> published on the iWeb blog for the past three months, you can see many articles <a href="http://blog.iweb.com/en/2009/03/install-guide-setting-up-a-new-dedicated-server/2221.html">on how to setup a website</a>, <a href="http://blog.iweb.com/en/2009/01/hosting-guide-how-to-choose-a-dedicated-server/1798.html">how to choose a dedicated server</a>, <a href="http://blog.iweb.com/en/2009/01/guide-how-to-switch-web-hosting-providers/1728.html">how to transfer your website to a new host</a>, etc. </p>
<p>So far, there weren&#8217;t any advanced articles mentioning advanced setups or tips on how to scale efficiently a website. The reason is very simple: from experience, it&#8217;s better to just launch a website, and then optimize only when bottlenecks and performance problems occur. Most development teams follow this principle; otherwise, they will be optimizing prematurely their setup, and also due to the fact that every website has different needs and thus different problems to solve.</p>
<p>You can see below for instance the graph when <a href="http://delicious.com">delicious</a>&#8217;s homepage is loaded</p>
<p><img src="http://blog.iweb.com/en/wp-content/uploads/2009/04/inspector.png" alt="delicious inspector" title="delicious inspector" class="alignnone size-full wp-image-2398" /></p>
<p>It took about 1.85 sec to render the website, knowing that other websites such flickr.com target 250ms total loading times. The graphic above shows that the server response took 1.3 sec, which is almost 2/3rd of the total time. This means the bottleneck is either in the DNS server, or maybe because the delicious servers were handling too much traffic, and were queuing user requests. </p>
<p>Here&#8217;s a graph for another website (<a href="http://techentreprise.com">TechEntreprise</a>):<br />
<img src="http://blog.iweb.com/en/wp-content/uploads/2009/04/techentreprise.png" alt="techentreprise inspector" title="techentreprise inspector" class="alignnone size-full wp-image-2399" /><br />
Response time is similar to delicious, in 1.83sec, however, the responses are very different in nature: it&#8217;s loaded in less than 100ms, but static files such as pictures, css, or javascript take the remaining. Assets delivery should then be optimized on this website, using compression, trying to use less static files, or using special hosting solutions to make the response faster. </p>
<p>During the lifetime of a website, a development team must then track those metrics; and optimize iteratively, each time on a different bottleneck. The problems can occur:</p>
<ol>
<li>DNS Servers</li>
<li>Front-End Servers Capacity</li>
<li>Application Servers speed and capacity</li>
<li>Back-end and database servers speed</li>
<li>Static files servers</li>
</ol>
<h3>1. DNS Servers</h3>
<p>When a new user wants to visit a website that wasn&#8217;t visited recently, there must be first a DNS query. The DNS queries can be noticeable if the visitor is another continent or if you have slow DNS servers. Learnhub, a website made by a company from Toronto, saw for instance <a href="http://dns.learnhub.com/lesson/11620-how-to-compare-hosted-dns-providers-with-data">that DNS response time took up to 500ms, and switched to Dynect</a> for ultra-fast DNS Hosting. The graphic below shows the improvements when they made the switch:<br />
<img src="http://asset2.learnhub.com/lesson/pages/11620/photos/25547-large.jpg" alt="dns dynect" /><br />
The response time is now 3 times less for learnhub, a noticeable improvement for its massive user base in India. </p>
<h3>2. Front-End Servers Capacity</h3>
<p>Front-End servers are the first servers to deal with your request, putting it into a queue, and then dispatching it to the appropriate server, such as an application server, the application cache (or memcache). Front-End servers can be specialized software (such as <a href="http://haproxy.1wt.eu/">haproxy</a> or <a href="http://nginx.net/">nginx</a>, which have built-in load-balancing features) or it can also be <a href="http://iweb.com/managed-hosting/load-balancing/">dedicated load-balancing hardware</a> such as the ones here. In more modest websites, Apache or the web server would be the front-end and the application server at the same time. </p>
<p>In most hosting architectures, the bottleneck is rarely the front-end servers. If it is, that&#8217;s because you didn&#8217;t choose the best routing algorithm, for instance chosing round-robin queuing instead of more intelligent load-based queuing. In most cases also, it&#8217;s because there are not enough application servers, and the front-end servers are just waiting for requests to be computed. Here is for instance how <a href="http://dev.lookery.com/post/56957930/haproxy">response times change when you add more connections</a> to app servers (with the same load-balancer in front)<br />
<img src="http://davidcancel.com/dropbox/haproxy-tracker.png" alt="haproxy tracker" /><br />
It&#8217;s a significant boost, so tweaking the website&#8217;s latency can just be configuration change. </p>
<h3>3. Application Servers speed and capacity</h3>
<p>The application server computes the request, for instance delivering a personalized page according to a user&#8217;s preferences. </p>
<p>This depends on technologies used by the website (php, python, java, ruby + any used frameworks)</p>
<p>If the bottlneck is the application server, there are two paths: either optimize the web app code, or scale it by using more and better hardware. </p>
<p>Optimizing the code is beyond the scope of this article; it involves testing, using patterns and best practices, benchmarking sections of your code, and then try to refactor the code for better response time. <a href="http://blog.iweb.com/en/2009/03/learning-about-complex-and-scalable-hosting-solutions/2288.html">Go to the resources relevant to your technology stack</a>, benchmark it, and get help from an experienced engineer or development team. </p>
<p>If you&#8217;ve hit the wall in code optimization, you can think about getting beefier servers, try to find the best mix of RAM and CPUs, and then use this &#8220;base server&#8221; to scale horizontally, in clusters. An easy solution for <a href="http://iweb.com/managed-hosting/web-cluster/">LAMP websites can be seen here</a>. </p>
<p>Many modern websites (put the &#8220;web2.0&#8243; keyword here) also have advanced features such as user emails and notifications, computations of social graphs, search, messenging, text messages, video transcoding, etc. If you have such functionality, a very quick way to decrease response time is &#8220;outsource&#8221; those features to dedicated servers. You can use messenging servers such as <a href="http://activemq.apache.org/">ActiveMQ</a>, <a href="http://www.rabbitmq.com/">RabbitMQ</a> (an Apache project) or even kestrel (which Twitter uses) to offload long-running tasks to specialized servers.  Doing asynchronous requests would allow in theory instantaneous response times, so that&#8217;s something you would want to look at as soon as you have more than a couple of dedicated servers. </p>
<p>Caching is also an efficient way to process requests, to prevent requests hitting app servers. As for web application code, this depends on technologies used for your website. </p>
<h3>4. Back-end and database servers speed</h3>
<p>Fortunately, optimizing database servers is easier than the above points. </p>
<p>There are known and &#8220;battle-tested&#8221; solutions for instance on scaling MySQL, from replication to master-slaves setups, and balancing the loads. Like application servers, you can <a href="http://iweb.com/dedicated/power-servers/">search for the best hardware for the server</a>, using power servers, and with very low access time hard drives. You can see for instance in the following graph how MySQL behaves for different hardware on different loads, and then plan accordingly:<br />
<img src="http://tweakers.net/ext/i.dsp/1152946667.png" alt="mysql cores server" width="360" height="428" /></p>
<p>Many web companies also use heavily <a href="http://www.danga.com/memcached/">memcached</a> in front of the SQL Servers, in order to retrieve frequently-accessed objects from memory.</p>
<h3>5. Assets Servers</h3>
<p>Assets servers delivers static files, such as pictures, videos, javascript files, and other static elements such as flash animations. </p>
<p>You can tweak your web application to serve less files (for instance get all javascript files into just one file), compress files (and then gzip when serving the request). </p>
<p>Optimizing static file servers is probably the easiest when scaling and lowering response times. </p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.iweb.com/en/2009/04/website-latency-tips-and-the-path-to-faster-and-scalable-websites/2395.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Web Cluster : Don&#8217;t Try This at Home</title>
		<link>http://blog.iweb.com/en/2008/05/web-cluster-dont-try-this-at-home/725.html</link>
		<comments>http://blog.iweb.com/en/2008/05/web-cluster-dont-try-this-at-home/725.html#comments</comments>
		<pubDate>Thu, 29 May 2008 17:45:01 +0000</pubDate>
		<dc:creator>iWeb-Olivier</dc:creator>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[iWeb]]></category>
		<category><![CDATA[load-balancing]]></category>

		<guid isPermaLink="false">http://blog.iweb.ca/en/2008/05/web-cluster-dont-try-this-at-home/725.html</guid>
		<description><![CDATA[A Swedish working in the movie industry has built is own cluster in order to improve the rendering speed of its videos. To do so, he had to use a typically Swedish product : an IKEA cabinet.
Of course, it is an interesting experiment, but it has nothing to do with web clusters as offered by [...]]]></description>
			<content:encoded><![CDATA[<p>A Swedish working in the movie industry <a href="http://helmer.sfe.se/">has built is own cluster</a> in order to improve the rendering speed of its videos. To do so, he had to use a typically Swedish product : an IKEA cabinet.</p>
<p>Of course, it is an interesting experiment, but it has nothing to do with <a href="http://iweb.com/managed-hosting/web-cluster/">web clusters as offered by iWeb</a>. A cluster to execute tasks such as video rendering needs a smaller system.</p>
<p>A web cluster uses at least two servers and load balancers to ensure high disponibity of your web services. A little drawing ?</p>
<div align="center"><img src="http://iweb.com/media/images/webClusterGraph.png" alt="Cluster" /></div>
<p>The web cluster uses load balancing to send your visitors? requests to available servers. If a server fails, it is automatically removed from the available servers pool and your visitors are sent to servers capable of serving your web site&#8217;s functionalities.</p>
<p>Note that we don&#8217;t have any IKEA cabinets in our datacenters.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.iweb.com/en/2008/05/web-cluster-dont-try-this-at-home/725.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RAID illustrated</title>
		<link>http://blog.iweb.com/en/2008/05/raid-illustrated/713.html</link>
		<comments>http://blog.iweb.com/en/2008/05/raid-illustrated/713.html#comments</comments>
		<pubDate>Fri, 09 May 2008 14:15:34 +0000</pubDate>
		<dc:creator>iWeb-Olivier</dc:creator>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[load-balancing]]></category>
		<category><![CDATA[RAID]]></category>

		<guid isPermaLink="false">http://blog.iweb.ca/en/2008/05/raid-illustrated/713.html</guid>
		<description><![CDATA[For many people, RAID is an obscure concept. Fortunatly, somebody with to much time on their hands (not on company time, we hope) decided to shine some light on the confusing world of RAID with? bottles of water : 

(click to enlarge)
We&#8217;ll give them an &#8216;A&#8217; for effort&#8230;
In fact, RAID means &#8220;Redundant Arrays of Independent [...]]]></description>
			<content:encoded><![CDATA[<p>For many people, RAID is an obscure concept. Fortunatly, somebody with to much time on their hands (not on company time, we hope) decided to shine some light on the confusing world of RAID with? bottles of water : </p>
<div align="center"><a href="http://www.ghen.be/raid.jpg" target="_blank" rel="lightbox[713]" title="RAID illustrated"><img src='http://blog.iweb.ca/fr/wp-content/uploads/2008/05/raid2.jpg' alt='raid2.jpg' /></a></div>
<div align="center">(click to enlarge)</div>
<p>We&#8217;ll give them an &#8216;A&#8217; for effort&#8230;</p>
<p>In fact, RAID means &#8220;Redundant Arrays of Independent Disks&#8221; and &#8220;<em>is a technology that employs the simultaneous use of two or more hard disk drives to achieve greater levels of performance, reliability, and/or larger data volume sizes.</em>&#8221; More details can be found on <a href="http://en.wikipedia.org/wiki/RAID">Wikipedia</a>.</p>
<p>RAID controllers are available on all of iWeb?s dedicated servers and, among other things, can be used to run a <a href="http://iweb.com/managed-hosting/backup-storage/">backup server</a>.</p>
<p><script type="text/javascript">
digg_url = 'http://digg.com/hardware/Raid_Explained_with_Bottles_of_Water';
</script><br />
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.iweb.com/en/2008/05/raid-illustrated/713.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

