<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Random Thoughts</title>
	<atom:link href="http://alexlurthu.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexlurthu.wordpress.com</link>
	<description>Straight from the heart!</description>
	<lastBuildDate>Mon, 29 Dec 2008 06:05:43 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='alexlurthu.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/2e18259658cdc132622f409f5fd659ca?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Random Thoughts</title>
		<link>http://alexlurthu.wordpress.com</link>
	</image>
			<item>
		<title>mysql and disk space anomoloy</title>
		<link>http://alexlurthu.wordpress.com/2008/12/29/mysql-and-disk-space-anomoloy/</link>
		<comments>http://alexlurthu.wordpress.com/2008/12/29/mysql-and-disk-space-anomoloy/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 06:05:43 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[disk]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=56</guid>
		<description><![CDATA[Every hour, we saw the diskspace on our root partition go up from 45 %  to 90 % and come back to 45 %. Initially thought mysql was processing some temp tables and in the next hour we kept watching the temp location. In terms of files / diskspace usage using &#8220;du / ls&#8221; nothing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=56&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Every hour, we saw the diskspace on our root partition go up from 45 %  to 90 % and come back to 45 %. Initially thought mysql was processing some temp tables and in the next hour we kept watching the temp location. In terms of files / diskspace usage using &#8220;du / ls&#8221; nothing changed. But lsof provided an interesting output.</p>
<p>Output 1 :</p>
<p>mysqld    31719   mysql    6u   REG                8,1          0   149240 /var/tmp/ibOLLuRa (deleted)<br />
mysqld    31719   mysql    7u   REG                8,1        102   149243 /var/tmp/ibNuSvI9 (deleted)<br />
mysqld    31719   mysql    8u   REG                8,1          0   149245 /var/tmp/ibqq2wz8 (deleted)<br />
mysqld    31719   mysql    9u   REG                8,1          0   149255 /var/tmp/ibVN66Rh (deleted)<br />
mysqld    31719   mysql   13u   REG                8,1          0   149256 /var/tmp/ibslSJJA (deleted)<br />
mysqld    31719   mysql   15u  unix 0&#215;000001085e445680            19044143 /tmp/mysql.sock<br />
mysqld    31719   mysql   18u   REG                8,1 1128267776   146656 /var/tmp/MLHbDVOq (deleted)</p>
<p>Output 2 :</p>
<p>mysqld    31719   mysql    6u   REG                8,1          0   149240 /var/tmp/ibOLLuRa (deleted)<br />
mysqld    31719   mysql    7u   REG                8,1        102   149243 /var/tmp/ibNuSvI9 (deleted)<br />
mysqld    31719   mysql    8u   REG                8,1          0   149245 /var/tmp/ibqq2wz8 (deleted)<br />
mysqld    31719   mysql    9u   REG                8,1          0   149255 /var/tmp/ibVN66Rh (deleted)<br />
mysqld    31719   mysql   13u   REG                8,1          0   149256 /var/tmp/ibslSJJA (deleted)<br />
mysqld    31719   mysql   15u  unix 0&#215;000001085e445680            19044143 /tmp/mysql.sock<br />
mysqld    31719   mysql   18u   REG                8,1 1396703232   146656 /var/tmp/MLHbDVOq (deleted)</p>
<p>The size occupied by a file marked deleted kept increasing <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Strange but it seems to be happening on every dataload. The size change in this file corroborates perfectly with the space usage reported by &#8220;df&#8221; but not with &#8220;du&#8221;.</p>
<p>We are setting up the tmp location to a filesystem with more space for now before we investigate further.</p>
 Tagged: disk, mysql <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=56&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/12/29/mysql-and-disk-space-anomoloy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>
	</item>
		<item>
		<title>A Beautiful Song !</title>
		<link>http://alexlurthu.wordpress.com/2008/09/15/a-beautiful-song/</link>
		<comments>http://alexlurthu.wordpress.com/2008/09/15/a-beautiful-song/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 06:13:56 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=53</guid>
		<description><![CDATA[
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=53&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="text-align:center; display: block;"><a href="http://alexlurthu.wordpress.com/2008/09/15/a-beautiful-song/"><img src="http://img.youtube.com/vi/vZAEBUTRZPo/2.jpg" alt="" /></a></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/53/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/53/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=53&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/09/15/a-beautiful-song/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/vZAEBUTRZPo/2.jpg" medium="image" />
	</item>
		<item>
		<title>moving from mysql 5.0 to 5.1</title>
		<link>http://alexlurthu.wordpress.com/2008/08/12/moving-from-mysql-50-to-51/</link>
		<comments>http://alexlurthu.wordpress.com/2008/08/12/moving-from-mysql-50-to-51/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 04:46:01 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=51</guid>
		<description><![CDATA[Problem Statement : 386 GB of MySQL 5.0 Compressed MyISAM tables (Merge engine used)  need to be migrated to MySQL 5.1 Compressed/Partitioned tables. Also we had to add a few new columns and change the datatype of few existing columns.
Initial plan : Setup the MySQL 5.1 database with the schema with partitioning to which the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=51&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Problem Statement :</strong> 386 GB of MySQL 5.0 Compressed MyISAM tables (Merge engine used)  need to be migrated to MySQL 5.1 Compressed/Partitioned tables. Also we had to add a few new columns and change the datatype of few existing columns.</p>
<p><strong>Initial plan :</strong> Setup the MySQL 5.1 database with the schema with partitioning to which the data needs to be migrated and then run scripts to copy the .MYD ,.MYI and .frm files to the 5.1 database. Disable the keys using &#8220;<em>Alter table &lt;&gt; disable keys</em>&#8220;. Then migrate the data using the insert into newtable select * from old table. Then to compress the tables run myisampack and myisamchk.</p>
<p>As per plan we started the migration process. The plan worked perfectly though a bit on the slower side for most of the tables. For few of the tables, the import process kept dragging on and on. It was well past a week since the import was started and the system was writing at a speed of 1 &#8211; 1.5 Gig per hour on to disk. There was heavy contention on the key buffer and the behavior was seen on tables which had keys greater than the available buffer and those with where clause in the &#8220;<em>insert into &lt;&gt; select from</em>&#8221; statments. Then we started getting constrained on time, was looking for avenues to optimize this whole process.</p>
<p>After quite a number of tests and trials , we found the following 2 methods to be faster.</p>
<p><strong>Method 1:</strong></p>
<p>1. Dump the data using <em>select into outfile</em> in the <strong>primary key order</strong> in <strong>small chunks</strong> if the table is huge.</p>
<p>2. <em>Alter table &lt;&gt; disable keys.</em></p>
<p>3. Load the data using load data infile statment.</p>
<p>4. Run <em>myisampack</em> and <em>myisamchk </em>to compress the data and rebuild the indexes respectively.</p>
<p>Method 1, was faster than the original plan.</p>
<p><strong>Method 2 :</strong></p>
<p>Method 2 would be a slight variation of method 1. Instead of &#8220;<em>Alter table &lt;&gt; disable keys</em>&#8220;, do the following :</p>
<p>For each partition on the  table run <em><strong>myisamchk  &#8211;keys-used=0 -rq &lt;tablename&gt;</strong></em>. This would disable all keys on the table. Now proceed from step 3.</p>
<p>With the second approach we, got a throughput of 1GB data written to disk in 1 minute approx. Will follow up this post with more detailed commands and steps. Whew ! What a week it has been so far !</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=51&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/08/12/moving-from-mysql-50-to-51/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>
	</item>
		<item>
		<title>Monkeys in Bannerghetta zoo</title>
		<link>http://alexlurthu.wordpress.com/2008/05/14/monkeys-in-bannerghetta-zoo/</link>
		<comments>http://alexlurthu.wordpress.com/2008/05/14/monkeys-in-bannerghetta-zoo/#comments</comments>
		<pubDate>Wed, 14 May 2008 15:27:39 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[friends]]></category>
		<category><![CDATA[monkeys]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=50</guid>
		<description><![CDATA[
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=50&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="text-align:center; display: block;"><a href="http://alexlurthu.wordpress.com/2008/05/14/monkeys-in-bannerghetta-zoo/"><img src="http://img.youtube.com/vi/VBT-Z1K3GvA/2.jpg" alt="" /></a></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/50/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/50/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=50&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/05/14/monkeys-in-bannerghetta-zoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/VBT-Z1K3GvA/2.jpg" medium="image" />
	</item>
		<item>
		<title>Victor&#8217;s B&#8217;Day</title>
		<link>http://alexlurthu.wordpress.com/2008/05/13/victors-bday/</link>
		<comments>http://alexlurthu.wordpress.com/2008/05/13/victors-bday/#comments</comments>
		<pubDate>Tue, 13 May 2008 16:57:16 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[friends]]></category>
		<category><![CDATA[b'day]]></category>
		<category><![CDATA[victor]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=47</guid>
		<description><![CDATA[
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=47&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="text-align:center; display: block;"><a href="http://alexlurthu.wordpress.com/2008/05/13/victors-bday/"><img src="http://img.youtube.com/vi/QVq6rjr81LQ/2.jpg" alt="" /></a></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/47/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/47/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=47&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/05/13/victors-bday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/QVq6rjr81LQ/2.jpg" medium="image" />
	</item>
		<item>
		<title>Me @ ma desk</title>
		<link>http://alexlurthu.wordpress.com/2008/05/13/me-ma-desk/</link>
		<comments>http://alexlurthu.wordpress.com/2008/05/13/me-ma-desk/#comments</comments>
		<pubDate>Tue, 13 May 2008 16:09:13 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[yahoo]]></category>
		<category><![CDATA[desk]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=46</guid>
		<description><![CDATA[
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=46&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img style="vertical-align:middle;" src="http://farm3.static.flickr.com/2413/2489049115_ca83cbc9cd.jpg?v=0" alt="" width="500" height="375" /></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/46/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/46/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=46&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/05/13/me-ma-desk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2413/2489049115_ca83cbc9cd.jpg?v=0" medium="image" />
	</item>
		<item>
		<title>Data inconsistency issues &#8211; binlog to rescue</title>
		<link>http://alexlurthu.wordpress.com/2008/05/13/data-inconsistency-issues-binlog-to-rescue/</link>
		<comments>http://alexlurthu.wordpress.com/2008/05/13/data-inconsistency-issues-binlog-to-rescue/#comments</comments>
		<pubDate>Tue, 13 May 2008 16:04:49 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[binlog]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=45</guid>
		<description><![CDATA[One of our peer group developers contacted me today stating that they were inserting a value of 10 in one of the columns in their tables. But after the insert, when they query the table they were getting the value as 0.
Logged into the box to check what was happening. Luckily binlog was turned on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=45&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One of our peer group developers contacted me today stating that they were inserting a value of 10 in one of the columns in their tables. But after the insert, when they query the table they were getting the value as 0.</p>
<p>Logged into the box to check what was happening. Luckily binlog was turned on that mysql instance. Ran the mysqlbinlog utility on the current binlog and greped for the particular primary key value.</p>
<p>It listed an insert statement and an update statement. There was the culprit, the value of 10 was getting inserted but soon the application was following it up with an update to value 0. Yeah it is always not the database <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=45&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/05/13/data-inconsistency-issues-binlog-to-rescue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>
	</item>
		<item>
		<title>Relay binlog corrupt</title>
		<link>http://alexlurthu.wordpress.com/2008/04/25/relay-binlog-corrupt/</link>
		<comments>http://alexlurthu.wordpress.com/2008/04/25/relay-binlog-corrupt/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 17:13:26 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[corruption]]></category>
		<category><![CDATA[relay log]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[slave]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=43</guid>
		<description><![CDATA[The slave failed with the error that the relay binlog is corrupt. It had copied close to 12 binlogs from the master and they were yet to be applied. Unfortunately those binlogs have been purged on the master. Now to sync up cleanly we might have to refresh data from the master which can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=43&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">The slave failed with the error that the relay binlog is corrupt. It had copied close to 12 binlogs from the master and they were yet to be applied. Unfortunately those binlogs have been purged on the master. Now to sync up cleanly we might have to refresh data from the master which can be costly since it was a 290 GB database. We had the option of shutting down the server. We thought we can try our luck with a crazy hack. We shutdown the server. Tried reading the binlog using mysqlbinlog utility from the corrupt position. It failed as expected. Then we tried reading from the next immediate position and it went through fine. Now we had a proof that our hack might work. We opened the relay-log.info and incremented the second row by a value of one. Then we started the server. Boom, the slave started running and we were saved from a great pain of resyncing the slave.</p>
<p>PS : We might have missed one transaction in this hack, but that was ok for our use case.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=43&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/04/25/relay-binlog-corrupt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>
	</item>
		<item>
		<title>Script to obtain the count of archive logs applied during recovery</title>
		<link>http://alexlurthu.wordpress.com/2008/04/10/script-to-obtain-the-count-of-archive-logs-applied-during-recovery/</link>
		<comments>http://alexlurthu.wordpress.com/2008/04/10/script-to-obtain-the-count-of-archive-logs-applied-during-recovery/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 07:02:22 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[oracle]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=42</guid>
		<description><![CDATA[Pass the start date + time and end date + time to the following script. It looks at the alert log file and obtains the no of archive logs that have been applied during media recovery in that time interval.
#!/usr/bin/perl -w

BEGIN { push @INC,"/home/user/TimeDate-1.16/lib/" }
use Date::Parse;
$start=str2time(@ARGV[0]);
chomp(@ARGV[1]);
$end=str2time(@ARGV[1]);

$log='path to the log file';
open(ALERTLOGFILE,$log) or die "Not able to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=42&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Pass the start date + time and end date + time to the following script. It looks at the alert log file and obtains the no of archive logs that have been applied during media recovery in that time interval.</p>
<pre>#!/usr/bin/perl -w

BEGIN { push @INC,"/home/user/TimeDate-1.16/lib/" }
use Date::Parse;
$start=str2time(@ARGV[0]);
chomp(@ARGV[1]);
$end=str2time(@ARGV[1]);

$log='path to the log file';
open(ALERTLOGFILE,$log) or die "Not able to open ".$log;
$progress=-1;
$count=0;
while(&lt;ALERTLOGFILE&gt;){

if(/^[A-Z][a-z]{2}\s[A-Z][a-z]{2}/){
  $time=str2time($_);

  if(($time &gt;= $start) &amp;&amp; ($time &lt;= $end)){
   $progress=1;
   }else{
     $progress=-1;
   }
}
if(/^Media Recovery Log/){
  if($progress == 1){
    $count+=1;
  }
}
}
print $count ."\n";</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=42&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/04/10/script-to-obtain-the-count-of-archive-logs-applied-during-recovery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding dynamic swap file</title>
		<link>http://alexlurthu.wordpress.com/2008/04/07/adding-dynamic-swap-file/</link>
		<comments>http://alexlurthu.wordpress.com/2008/04/07/adding-dynamic-swap-file/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 17:08:44 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OOM]]></category>
		<category><![CDATA[swap]]></category>

		<guid isPermaLink="false">http://alexlurthu.wordpress.com/?p=41</guid>
		<description><![CDATA[All production servers are normally installed using kickstart files. Unfortunately, the ks file had a bug that it didnt add a swap partition if there was only one logical or physical disk.
Once the database was setup without swap, the configuration was sized such that all processes fit into memory. But we started seeing OOM killing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=41&subd=alexlurthu&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">All production servers are normally installed using kickstart files. Unfortunately, the ks file had a bug that it didnt add a swap partition if there was only one logical or physical disk.</p>
<p style="text-align:justify;">Once the database was setup without swap, the configuration was sized such that all processes fit into memory. But we started seeing OOM killing processes due to lack of memory. Though under normal conditions we had 1-2 GB of free memory.</p>
<p style="text-align:justify;">Unfortunately, OOM at times picked to kill mysql. We were running 500GB+ database having myisam tables. We ended up having to repair the tables every time OOM felt like killing mysqld <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . Adding a swap device might help us fix the issue, but for that we might have to resize the logical/physical partitions, which wasn&#8217;t cool. Then this following idea popped up, create a file, format it as swap and add it as swap device dynamically and also add it /etc/fstab to survive reboot.</p>
<p style="text-align:justify;"><span style="color:#333399;">dd if=/dev/zero of=/swapfile bs=1024 count=16777216 # creates a 16GB file<br />
mkswap /var/swap/swapfile  # create swap fs on the file<br />
swapon /var/swap/swapfile   # add the swap file as swap device<br />
/var/swap/swapfile              swap                    swap    defaults        0 0 #add this entry in /etc/fstab</span></p>
<p style="text-align:justify;">You are all set for swapping. No more process kills by OOM. But of course adding swap device doesn&#8217;t save you from leaking process which also eat up the swap space and die with the swap allocation failed error. Any better ideas are welcome. I can try it and post an update.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexlurthu.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexlurthu.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexlurthu.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexlurthu.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexlurthu.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexlurthu.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexlurthu.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexlurthu.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexlurthu.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexlurthu.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexlurthu.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexlurthu.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexlurthu.wordpress.com&blog=1310241&post=41&subd=alexlurthu&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexlurthu.wordpress.com/2008/04/07/adding-dynamic-swap-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9200ed713840b8e3b58d6c565a85e946?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Alex</media:title>
		</media:content>
	</item>
	</channel>
</rss>