<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V2/AnnotatedMaps.xsd">

<channel>
	<title>The Codebelay Blog &#187; scalability hacking</title>
	<atom:link href="http://www.codebelay.com/blog/category/scalability-hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codebelay.com/blog</link>
	<description>Safely Reach New Tech Heights Through Our Startup Insights</description>
	<lastBuildDate>Wed, 25 Jan 2012 19:12:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Coders Who Don&#8217;t Job Interview: Zed Shaw</title>
		<link>http://www.codebelay.com/blog/2011/07/12/coders-who-dont-job-interview-zed-shaw/</link>
		<comments>http://www.codebelay.com/blog/2011/07/12/coders-who-dont-job-interview-zed-shaw/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 22:11:50 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Questions]]></category>
		<category><![CDATA[Recruiting]]></category>
		<category><![CDATA[scalability hacking]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[TechBiz]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=1076</guid>
		<description><![CDATA[I wrote a piece about the current state of job recruiting from a coder looking for work. I wondered: What would it be like if you didn&#8217;t have to do a job interview? (The non-tl;dr summary is below.) By &#8220;job interview,&#8221; I just mean the normal process where I job candidate replies to an ad, [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I wrote a piece about <a href="http://www.codebelay.com/blog/2011/06/08/whats-it-like-to-be-recruited/">the current state of job recruiting from a coder looking for work</a>. I wondered:</p>
<p>What would it be like if you didn&#8217;t have to do a job interview?</p>
<p>(The non-tl;dr summary is below.)</p>
<p>By &#8220;job interview,&#8221; I just mean the normal process where I job candidate replies to an ad, contacts an employer directly, or works with a recruiter, and gets a job through that process. High-profile experts are courted, or work out a mutually beneficial deal where it doesn&#8217;t feel like an interview.</p>
<p>I asked around for folks that didn&#8217;t have to interview. One name that consistently came to the top was <a href="http://zedshaw.com/">Zed Shaw</a>.</p>
<p><a href="http://www.codebelay.com/blog/wp-content/uploads/2011/07/zed.jpeg"><img src="http://www.codebelay.com/blog/wp-content/uploads/2011/07/zed.jpeg" alt="" title="zed" width="232" height="209" class="aligncenter size-full wp-image-1088" /></a></p>
<p>Zed is the creator of the <a href="http://mongrel2.org/">Mongrel Web Server</a>, and a really great framework that is powered by Mongrel, <a href="http://tir.mongrel2.org/">Tir</a>. Personally, I first heard of him from <a href="http://blog.leahculver.com/2009/01/cusec-2009.html">a video Leah Culver linked</a> to on a talk that Zed gave, &#8220;<a href="Zed Shaw - The ACL is Dead on Vimeo">The ACL is dead</a>.&#8221; A careful viewing of that talk is always rewarded, especially if you are a coder freelancing for a corporation.</p>
<p>Here&#8217;s my interview with him (conducted over email). Thanks Zed!</p>
<p>Barce: What&#8217;s your own process for choosing the projects you want to work on?</p>
<p>Zed: Within my profession I try to just work on whatever is needed to get the<br />
project or job done.  Sometimes that ends up being a lot of crap work so<br />
other people can do more important stuff.  Professionally I don&#8217;t mind<br />
this kind of work as it&#8217;s low investment and removes the pressure off<br />
other folks who would rather do interesting things.  I think I also tend<br />
to pick off the lower level work because most of my original ideas are<br />
usually too weird for a professional setting.</p>
<p>Personally, I tend to work on projects that match ideas I might have,<br />
and usually they have a secondary motive that&#8217;s outside of programming.<br />
Many times these ideas come from combining a couple of concepts, or<br />
they&#8217;re based on a problem I&#8217;ve noticed, or they are just a kind of<br />
funny joke or cool hack I thought up.</p>
<p>I think the most important thing is I don&#8217;t try to plan my inspiration<br />
in my personal projects, but instead go with it when it comes.  I don&#8217;t<br />
have a &#8220;process&#8221;, and in fact I think &#8220;process&#8221; kills creativity.<br />
Proess definitely helps make creative ideas a reality, but it doesn&#8217;t<br />
create the initial concepts very well.</p>
<p>Professionally though, inspiration is for amateurs and I just do my<br />
work.</p>
<p>Barce: What advice can you give someone who feels trapped by their job or surrounded by recruiters?</p>
<p>Zed: Well, if you&#8217;re trapped by your job then I&#8217;d say start working on<br />
getting a new one.  Nobody is every really *trapped*, but maybe you<br />
can&#8217;t just quit right away.  Instead, work on projects at home,<br />
constantly look for new work, and move to where the work is.  Even if<br />
it&#8217;s temporary, moving to say San Francisco during the boom times could<br />
be a major boost to your career.</p>
<p>I&#8217;d also say that going back to school is a good way to update your life<br />
and change your profession.  I&#8217;m a firm believer in getting government<br />
student loans and using them to go to school.  They&#8217;re cheap, low<br />
interest, and the US government is usually very nice about letting you<br />
pay them back.  I&#8217;m not so sure about other places around the world<br />
though.</p>
<p>Barcee: What&#8217;s the most disruptive technology you know about right now?</p>
<p>Zed: If I were to be honest, I&#8217;d have to say Facebook, even though I<br />
absolutely hate it.  It&#8217;s probably the one technology in recent history,<br />
maybe after HTTP and the Browser, that is changing the way governments,<br />
societies, and regular people work.  It&#8217;s also sort of irritating that<br />
the most important thing to hit most people&#8217;s lives is also one of the<br />
most privacy invading companies in the world.</p>
<p>After that I&#8217;d have to say the rise of automated operations and<br />
virtualized machines.  Things like <a href="http://xen.org/">Xen</a>, <a href="http://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine">kvm</a>, and even <a href="http://llvm.org/">llvm</a> as compiler<br />
infrastructure are changing how systems are managed and deployed, which<br />
then leads to bigger automation for large hetergenous networks.  I&#8217;m<br />
sort of waiting for operating systems to catch up and realize that their<br />
configuration systems are getting in the way of real automation.</p>
<p>Barce: Thanks again, Zed, for the interview. The take aways that I hope readers get from this are:</p>
<ul>
<li>Zed has open source projects that free him from the normal interviewing process. Building your own open source project is one way to free yourself.</li>
<li>&#8220;Professionally though, inspiration is for amateurs and I just do my work.&#8221;</li>
<li>&#8220;[W]ork on projects at home,<br />
constantly look for new work, and move to where the work is.&#8221;</li>
<li>Facebook is the most disruptive technology that&#8217;s changing governments&#8230; Virtualization / Cloud technologies are a 2nd.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2011/07/12/coders-who-dont-job-interview-zed-shaw/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Why is Foursquare Down? 3 Educated Guesses</title>
		<link>http://www.codebelay.com/blog/2010/10/04/why-is-foursquare-down-3-educated-guesses/</link>
		<comments>http://www.codebelay.com/blog/2010/10/04/why-is-foursquare-down-3-educated-guesses/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 01:38:51 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[scalability hacking]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[TechBiz]]></category>
		<category><![CDATA[WebApps]]></category>
		<category><![CDATA[amazon ec2]]></category>
		<category><![CDATA[foursquare]]></category>
		<category><![CDATA[scalability]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=979</guid>
		<description><![CDATA[Why is Foursquare down? Update (5 October 2010 at 5:36 pm PDT) : The folks at Foursquare tell us why in a post-mortem. There are autosharding issues with MongoDB. Yup, my guesses were wrong, unless you consider MongoDB a kind of cache. I used to work for a few sites that required high scalability expertise. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Why is <a href="http://foursquare.com/">Foursquare</a> down?</p>
<p><strong><em>Update (5 October 2010 at 5:36 pm PDT) :</em> The folks at Foursquare tell us <a href="http://blog.foursquare.com/2010/10/05/so-that-was-a-bummer/">why in a post-mortem</a>. There are autosharding issues with <a href="http://www.mongodb.org/">MongoDB</a>. Yup, my guesses were wrong, unless you consider MongoDB a kind of cache. <img src='http://www.codebelay.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </strong></p>
<p>I used to work for a few sites that required high scalability expertise. Now that we&#8217;re over 5 hours into the outage I&#8217;ll share some of my thoughts.</p>
<p>But before I do, I&#8217;d just like to say, I really hope that it&#8217;s nothing bad and I really like the Foursquare peeps. I&#8217;m not putting out this article to harsh on anybody, but just to share some knowledge I have. Outages happen to everybody!</p>
<p><a href="http://www.codebelay.com/blog/wp-content/uploads/2010/10/foursquaredown.png"><img src="http://www.codebelay.com/blog/wp-content/uploads/2010/10/foursquaredown-300x137.png" alt="" title="foursquaredown" width="300" height="137" class="aligncenter size-medium wp-image-980" /></a></p>
<p><b>Also, I do not feel that this meltdown is in any way indicative of <a href="http://aws.amazon.com/">Amazon&#8217;s EC2</a></b>. I have a <a href="http://www.mychamberapp.com/">site</a> that shares the same IP space and facility as Foursquare and we have had no outages today.</p>
<ul>
<li>The worst case scenario is a full scale<a href="http://www.wired.com/epicenter/2009/01/magnolia-suffer/"> Magnolia meltdown</a>. This is where because of a backup process that was off, they cannot restore ever from backup. Odds: unlikely.</li>
<li>Someone turned off caching. I&#8217;m not sure how cache dependent the architecture is at Foursquare. If someone turned off the cache and the cache is just plain gone, then the caches have to be re-built. Rebuilding caches, depending on the time and complexity of each query can take up to 100x more time that it takes to retrieve the cache. If there&#8217;s some cached item that takes 100 seconds per user, the site will be down for a long time. They can only put a user back on foursquare at a rate of 100 per second if that&#8217;s the case, unless they can concurrently run the re-building of the cache.</li>
<li>There&#8217;s an issue with a hacker who has broken through security and is wreaking havoc on Foursquare. It&#8217;s happened to the best sites, e.g. Google in the 90s, and it&#8217;s pretty tough to recover from. Sometimes you let the criminals in and do their worst while keeping the site up. Sometimes you have 0 tolerance.</li>
<p>I wish Foursquare the best of luck. I am more than happy to lend a hand to their issues, if they need another pair of eyes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2010/10/04/why-is-foursquare-down-3-educated-guesses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes on adding more MySQL databases</title>
		<link>http://www.codebelay.com/blog/2009/11/10/notes-on-adding-more-mysql-databases/</link>
		<comments>http://www.codebelay.com/blog/2009/11/10/notes-on-adding-more-mysql-databases/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 23:56:04 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[scalability hacking]]></category>
		<category><![CDATA[WebApps]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=665</guid>
		<description><![CDATA[Just notes for myself on adding more MySQL databases without shutting down the master database. on existing slave: /etc/init.d/mysqld stop copy data dir from /var/lib/mysql and data from /var/run/mysqld to new slave database: cd /var/lib tar cvf Mysql_slave.tar mysql/* scp Mysql_slave.tar root@new-db.com:/var/lib/. cd /var/run tar cvf Mysqld_slave.tar mysqld/* scp Mysqld_slave.tar mysqld/* scp Mysqld_slave.tar root@new-db.com:/var/run/. copy [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Just notes for myself on adding more MySQL databases without shutting down the master database.</p>
<p>on existing slave:</p>
<div style="border: 1px solid #fff; background: #000; color: #fff; padding: 5px 5px 5px 5px;">
/etc/init.d/mysqld stop
</div>
<p>copy data dir from /var/lib/mysql and data from /var/run/mysqld to new slave database:</p>
<div style="border: 1px solid #fff; background: #000; color: #fff; padding: 5px 5px 5px 5px;">
cd /var/lib<br />
tar cvf Mysql_slave.tar mysql/*<br />
scp Mysql_slave.tar root@new-db.com:/var/lib/.<br />
cd /var/run<br />
tar cvf Mysqld_slave.tar mysqld/*<br />
scp Mysqld_slave.tar mysqld/*<br />
scp Mysqld_slave.tar root@new-db.com:/var/run/.
</div>
<p>copy /etc/my.cnf from old slave to new slave<br />
add entry for new server-id</p>
<p>start existing slave:</p>
<div style="border: 1px solid #fff; background: #000; color: #fff; padding: 5px 5px 5px 5px;">
cd /var/lib<br />
tar xvf Mysql_slave.tar<br />
cd /var/run<br />
tar xvf Mysqld_slave.tar<br />
/etc/init.d/mysqld start
</div>
<p>start new slave:</p>
<div style="border: 1px solid #fff; background: #000; color: #fff; padding: 5px 5px 5px 5px;">
/etc/init.d/mysqld start<br />
mysql<br />
start slave;
</div>
<p>on masterdb:<br />
e.g.:</p>
<div style="border: 1px solid #fff; background: #000; color: #fff; padding: 5px 5px 5px 5px;">
grant replication slave on *.* to &#8216;repl&#8217;@&#8217;192.168.107.33&#8242; identified by &#8216;password&#8217;;
</div>
<p>test on master:<br />
create database repl;</p>
<p>check on slave:<br />
show databases; /* should show new database */</p>
<p>test on master:<br />
drop database repl;</p>
<p>check on slave:<br />
show databases; /* new database should be dropped */</p>
<p>Now it&#8217;s time to turn this into an automated shell script with <a href="http://expect.nist.gov/">Expect</a> in there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2009/11/10/notes-on-adding-more-mysql-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part II: Getting to 600 Concurrent Users</title>
		<link>http://www.codebelay.com/blog/2009/11/08/part-ii-getting-to-600-concurrent-users/</link>
		<comments>http://www.codebelay.com/blog/2009/11/08/part-ii-getting-to-600-concurrent-users/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 18:42:57 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[scalability hacking]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=658</guid>
		<description><![CDATA[I couldn&#8217;t sleep last night. I&#8217;m worried we&#8217;ll lose this client. So just to be clear. I wasn&#8217;t part of the crew responsible for scaling this site. I had already set up a scalable architecture for the site, that would automatically and horizontally scale at Amazon. That idea got shot down for legal reasons that [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I couldn&#8217;t sleep last night. I&#8217;m worried we&#8217;ll lose this client.</p>
<p>So just to be clear. I wasn&#8217;t part of the crew responsible for scaling this site. I had already set up a scalable architecture for the site, that would <a href="http://aws.amazon.com/autoscaling/">automatically and horizontally scale at Amazon</a>. That idea got shot down for legal reasons that to my surprise haven&#8217;t been in play for awhile. Can we say, &#8220;Office politics?&#8221;</p>
<p>I totally recommend Amazon&#8217;s Autoscaling to anybody that&#8217;s new to this.</p>
<p>Instead of auto-scaling, the site was architected by a local San Francisco firm who I won&#8217;t mention here.</p>
<p>Let&#8217;s just hope enough people read this so that they won&#8217;t even have to know the name of the company and will just know the smell of an un-scaleable architecture.</p>
<p>Scalability requirement: 100,000 concurrent users</p>
<p>This is how they set it up:</p>
<ul>
<li>two web servers
<li>one database
<li>four video transcoders that hits the master database
<li>one more app server that hits the master database
<li>no slave db <img src='http://www.codebelay.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' />
</ul>
<p>If they had even <a href="http://www.google.com/search?hl=en&#038;client=safari&#038;rls=en&#038;q=building+scalabe+websites&#038;aq=f&#038;oq=&#038;aqi=">googled &#8216;building scalable websites&#8217;</a> they would have come across a book that would have avoided all of this, <a href="http://www.amazon.com/Building-Scalable-Web-Sites-applications/dp/0596102356">Cal Henderson&#8217;s Building Scalable Websites</a>. It should be mandatory reading for anybody working on a large website, and it just scratches the surface.</p>
<p>So, how did we get to 600 concurrent users?</p>
<p>We tweaked mysql by putting this in /etc/m.cnf:</p>
<div style="color: #fff; background: #000; border: 1px solid #000; padding 5px 5px 5px 5px">
[mysqld]<br />
max_connections=10000<br />
query_cache_size=50000000<br />
thread_cache_size=16<br />
thread_concurrency=16 # only works on Solaris and is ignored on other OSes
</div>
<p>We ran siege and were able to get to about 300 concurrent users without breaking a sweat, but now apache was dying.</p>
<p>So we tweaked apache. We started out with this:</p>
<p>StartServers       8<br />
MinSpareServers    5<br />
MaxSpareServers   20<br />
ServerLimit      256<br />
MaxClients       256<br />
MaxRequestsPerChild  4000</p>
<p>And ended up with this:</p>
<div style="color: #fff; background: #000; border: 1px solid #000; padding 5px 5px 5px 5px">
StartServers       150<br />
MinSpareServers    50<br />
MaxSpareServers   200<br />
ServerLimit      256<br />
MaxClients       256<br />
MaxRequestsPerChild  4000
</div>
<p>RAM and CPU were doubled.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2009/11/08/part-ii-getting-to-600-concurrent-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scaling from 100 to 100000 concurrent users in a day?</title>
		<link>http://www.codebelay.com/blog/2009/11/06/scaling-from-100-to-100000-concurrent-users-in-a-day/</link>
		<comments>http://www.codebelay.com/blog/2009/11/06/scaling-from-100-to-100000-concurrent-users-in-a-day/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 18:21:44 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[scalability hacking]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=655</guid>
		<description><![CDATA[Well, it looks pretty bad right now. A vendor just ceded control for web application architecture. Initial tests say that the site won&#8217;t do no more 100 users concurrently. Who the hell makes a web app without a slave database and calls themselves website architects? Apparently these guys did. Please start following if you want [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Well, it looks pretty bad right now. A vendor just ceded control for web application architecture. Initial tests say that the site won&#8217;t do no more 100 users concurrently.</p>
<p>Who the hell makes a web app without a slave database and calls themselves website architects? Apparently these guys did.</p>
<p>Please start following if you want to see if this web app can make it to launch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2009/11/06/scaling-from-100-to-100000-concurrent-users-in-a-day/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Benchmarking Inserts on Drizzle and MySQL</title>
		<link>http://www.codebelay.com/blog/2009/09/08/benchmarking-insert-on-drizzle-and-mysql/</link>
		<comments>http://www.codebelay.com/blog/2009/09/08/benchmarking-insert-on-drizzle-and-mysql/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 17:00:40 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[scalability hacking]]></category>
		<category><![CDATA[WebApps]]></category>
		<category><![CDATA[mysql drizzle benchmarking]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=630</guid>
		<description><![CDATA[I&#8217;m not comparing apples to apples yet&#8230; but out of the box, drizzle does inserts faster than MySQL using the same table type, InnoDB. Here&#8217;s what I&#8217;m comparing: drizzle r1126 configured with defaults, and MySQL 5.1.38 configured with ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \ --enable-thread-safe-client --enable-local-infile --enable-shared \ --with-plugins=partition,innobase which is really nothing complicated. SQL query caching [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;m not comparing apples to apples yet&#8230; but out of the box, <a href="https://launchpad.net/drizzle">drizzle</a> does inserts faster than <a href="http://www.mysql.com/">MySQL</a> using the same table type, <a href="http://en.wikipedia.org/wiki/Innodb">InnoDB</a>.</p>
<p>Here&#8217;s what I&#8217;m comparing:<br />
drizzle r1126 configured with defaults, and<br />
MySQL 5.1.38 configured with </p>
<div style="color: #fff; background: #000; padding: 5px 5px 5px 5px">
<pre>
./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \
--enable-thread-safe-client --enable-local-infile --enable-shared \
--with-plugins=partition,innobase
</pre>
</div>
<p>which is really nothing complicated.</p>
<p>SQL query caching is turned off on both database servers. Both are using the InnoDB engine plug-in.</p>
<p>I&#8217;m running these benchmarks on a MacBook Pro 2.4 GHz Intel Core 2 Duo with 2GB 1067 MHz DDR3 RAM.</p>
<p>I wrote <a href="http://www.codebelay.com/blog/2007/04/19/more-mysql-51-benchmarks-my-code-is-faster-and-slower-wtf/">benchmarking software about 2 years ago to test partitions</a> but I&#8217;ve since abstracted the code to be database agnostic.</p>
<p>You can get <a href="http://github.com/barce/partition_benchmarks/tree/master">the benchmarking code at Github</a>.</p>
<p>At the command-line, you type:</p>
<div style="color: #fff; background: #000; padding: 5px 5px 5px 5px">
php build_tables.php 10000 4 drizzle
</div>
<p>where 10000 is the number of rows allocated total, and 4 is the number of partitions for those rows.</p>
<p>You can type the same thing for mysql:</p>
<div style="color: #fff; background: #000; padding: 5px 5px 5px 5px">
php build_tables.php 10000 4 mysql
</div>
<p>and get interesting results.</p>
<p>Here&#8217;s what I got:</p>
<h3>MySQL</h3>
<pre>
bash-3.2$ php build_tables.php 10000 4 mysql
Elapsed time between Start and Test_Code_Partition: 13.856538
last table for php partition: users_03
Elapsed time between No_Partition and Code_Partition: 14.740206
-------------------------------------------------------------
marker           time index            ex time         perct
-------------------------------------------------------------
Start            1252376759.26094100   -                0.00%
-------------------------------------------------------------
No_Partition     1252376773.11747900   13.856538       48.45%
-------------------------------------------------------------
Code_Partition   1252376787.85768500   14.740206       51.54%
-------------------------------------------------------------
Stop             1252376787.85815000   0.000465         0.00%
-------------------------------------------------------------
total            -                     28.597209      100.00%
-------------------------------------------------------------
20000 rows inserted...
</pre>
<h3>drizzle</h3>
<pre>
bash-3.2$ php build_tables.php 10000 4 drizzle
Elapsed time between Start and Test_Code_Partition: 7.502141
last table for php partition: users_03
Elapsed time between No_Partition and Code_Partition: 7.072367
-------------------------------------------------------------
marker           time index            ex time         perct
-------------------------------------------------------------
Start            1252376733.68141500   -                0.00%
-------------------------------------------------------------
No_Partition     1252376741.18355600   7.502141        51.47%
-------------------------------------------------------------
Code_Partition   1252376748.25592300   7.072367        48.52%
-------------------------------------------------------------
Stop             1252376748.25627400   0.000351         0.00%
-------------------------------------------------------------
total            -                     14.574859      100.00%
-------------------------------------------------------------
20000 rows inserted...
</pre>
<p>MySQL: 699 inserts per second<br />
drizzle: 1372 inserts per second<br />
As far as inserts go, drizzle is about 2 times faster out of the box than MySQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2009/09/08/benchmarking-insert-on-drizzle-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Load Balance and Auto Scale with Amazon&#8217;s EC2</title>
		<link>http://www.codebelay.com/blog/2009/08/02/how-to-load-balance-and-auto-scale-with-amazons-ec2/</link>
		<comments>http://www.codebelay.com/blog/2009/08/02/how-to-load-balance-and-auto-scale-with-amazons-ec2/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 07:28:25 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[scalability hacking]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[TechBiz]]></category>
		<category><![CDATA[WebApps]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=615</guid>
		<description><![CDATA[This blog post is a quick introduction to load balancing and auto scaling on with Amazon&#8217;s EC2. I was kinda amazed about how easy it was. Prelims: Download the load balancer API software, auto scaling software, and cloud watch software. You can get all three at a download page on Amazon. Let&#8217;s load balancer two [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>This blog post is a quick introduction to load balancing and auto scaling on with Amazon&#8217;s EC2.</p>
<p>I was kinda amazed about how easy it was.</p>
<p>Prelims: Download the load balancer API software, auto scaling software, and cloud watch software. You can <a href="http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=88">get all three at a download page</a> on Amazon.</p>
<p>Let&#8217;s load balancer two servers.</p>
<pre>elb-create-lb lb-example --headers \
--listener "lb-port=80,instance-port=80,protocol=http" \
--availability-zones us-east-1a</pre>
<p>The above creates a load balancer called &#8220;lb-example,&#8221; and will load balance traffic on port 80, i.e. the web pages that you serve.</p>
<p>To attach specific servers to the load balancer you just type:</p>
<pre>elb-register-instances-with-lb lb-example --headers \
--instances i-example,i-example2</pre>
<p>where i-example and i-example2 are the instance id&#8217;s of the servers you want added to the load balancer.</p>
<p>You&#8217;ll also want to monitor the health of the load balanced servers, so please add a health check:</p>
<pre>elb-configure-healthcheck lb-example --headers \
--target "HTTP:80/index.html" --interval 30 --timeout 3 \
--unhealthy-threshold 2 --healthy-threshold 2</pre>
<p>Now let&#8217;s set up autoscaling:</p>
<pre>as-create-launch-config example3autoscale --image-id ami-mydefaultami \
--instance-type m1.small</pre>
<pre>as-create-auto-scaling-group example3autoscalegroup  \
--launch-configuration example3autoscale \
--availability-zones us-east-1a \
--min-size 2 --max-size 20 \
--load-balancers lb-example</pre>
<pre>as-create-or-update-trigger example3trigger \
--auto-scaling-group example3autoscalegroup --namespace "AWS/EC2" \
--measure CPUUtlization --statistic Average \
--dimensions "AutoScalingGroupName=example3autoscalegroup" \
--period 60 --lower-threshold 20 --upper-threshold 40 \
--lower-breach-increment=-1 --upper-breach-increment 1 \
--breach-duration 120</pre>
<p>With the 3 commands above I&#8217;ve created an auto-scaling scenario where a new server is spawned and added to the load balancer every two minutes if the CPU Utilization is above 20% for more than 1 minute.</p>
<p>Ideally you want to set &#8211;lower-threshold to something high like 70 and &#8211;upper-threshold to 90, but I set both to 20 and 40 respectively just to be able to test.</p>
<p>I tested using siege.</p>
<p>Caveats: the auto-termination part is buggy, or simply didn&#8217;t work. As the load went down, the number of the server on-line remained the same. Anybody have thoughts on this?</p>
<p>What does auto-scaling and load balancing in the cloud mean? Well, the total cost of ownership for scalable, enterprise infrastructure just went down by lots. It also means that IT departments can just hire a cloud expert and deploy solutions from a single laptop instead of having to figure out the cost for hardware load balancers and physical servers.</p>
<p>The age of Just-In-Time IT just got ushered in with auto-scaling and load balancing in the cloud.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2009/08/02/how-to-load-balance-and-auto-scale-with-amazons-ec2/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Oddments: A Great Blog For Keeping Up With Drizzle and Gearman</title>
		<link>http://www.codebelay.com/blog/2009/02/26/oddments-a-great-blog-for-keeping-up-with-drizzle-and-gearman/</link>
		<comments>http://www.codebelay.com/blog/2009/02/26/oddments-a-great-blog-for-keeping-up-with-drizzle-and-gearman/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 06:39:58 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[command-line]]></category>
		<category><![CDATA[scalability hacking]]></category>
		<category><![CDATA[alan kasindorf]]></category>
		<category><![CDATA[drizzle]]></category>
		<category><![CDATA[eric day]]></category>
		<category><![CDATA[gearman]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=521</guid>
		<description><![CDATA[Alan Kasindorf just introduced me to a great blog by Eric Day, Oddments. If you are into learning about alternatives to MySQL like Drizzle, or how to scale writes to a database using Gearman, then I wholeheartedly recommend his blog. I really like the samples of code he puts up that acts as a very [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://dormando.livejournal.com/">Alan Kasindorf</a> just introduced me to a great blog by Eric Day, <a href="http://www.oddments.org/">Oddments</a>.</p>
<p>If you are into learning about alternatives to MySQL like <a href="http://en.wikipedia.org/wiki/Drizzle_(database_server)">Drizzle</a>, or how to scale writes to a database using <a href="http://www.danga.com/gearman/">Gearman</a>, then I wholeheartedly recommend his blog.</p>
<p>I really like the samples of code he puts up that acts as a very useful, and direct tutorial to new technologies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2009/02/26/oddments-a-great-blog-for-keeping-up-with-drizzle-and-gearman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.094 seconds -->

