<?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>FewBar.com - Make it good &#187; linux</title>
	<atom:link href="http://fewbar.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://fewbar.com</link>
	<description>Technology, life, and mischief, not in that order</description>
	<lastBuildDate>Wed, 18 Apr 2012 00:55:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Ubuntu 10.04.1 LTS released &#124; The Fridge</title>
		<link>http://fewbar.com/2010/08/ubuntu-10-04-1-lts-released-the-fridge/</link>
		<comments>http://fewbar.com/2010/08/ubuntu-10-04-1-lts-released-the-fridge/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 05:17:13 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[10.04.1]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=261</guid>
		<description><![CDATA[<a href="http://fewbar.com/2010/08/ubuntu-10-04-1-lts-released-the-fridge/" title="Ubuntu 10.04.1 LTS released | The Fridge"></a>Ubuntu 10.04.1 LTS released &#124; The Fridge. This is pretty cool. I know as a system administrator, I never wanted to run .0 anything. So 10.04 is really like 10.04.0, and means &#8220;let somebodye lse find the bugs.&#8221;. Well 10.04.1 &#8230;<p class="read-more"><a href="http://fewbar.com/2010/08/ubuntu-10-04-1-lts-released-the-fridge/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://fewbar.com/2010/08/ubuntu-10-04-1-lts-released-the-fridge/" title="Ubuntu 10.04.1 LTS released | The Fridge"></a><p><a href="http://fridge.ubuntu.com/node/2106">Ubuntu 10.04.1 LTS released | The Fridge</a>.</p>
<p>This is pretty cool. I know as a system administrator, I never wanted to run .0 anything. So 10.04 is really like 10.04.0, and means &#8220;let somebodye lse find the bugs.&#8221;.</p>
<p>Well 10.04.1 means that the more conservative administrators can at least have a reasonable expectation that it will be even more stable than it was on release day in April.</p>
<p>If you&#8217;re already running Ubuntu servers, btw, check this out:</p>
<p><a href="http://maps.ubuntu.com">http://maps.ubuntu.com</a></p>
<p>Hit it and be counted as a server user. Pretty amazing how many little orange circles there are all over the world.</p>
<p>For those of you who&#8217;ve been telling me that my blog posts sound like &#8220;gleep ork boog florg&#8221;, a quick primer:</p>
<p><a href="http://www.ubuntu.com">Ubuntu</a> is an operating system, like Mac OS X or Windows (except more awesomer).</p>
<p>10.04 was their April, 2010 release (10 == 2010 04 == april).</p>
<p>LTS means Long Term Support. This means that the people who maintain Ubuntu will support this release for 3 &#8211; 5 years (depending on the context.. 3 for desktops, 5 for servers).</p>
<p>10.04.1 is a fixed up release, mainly marking the release of updated CD images for installing. If you install 10.04 and choose automatic updates, you&#8217;re already on 10.04.1 before the release.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2010/08/ubuntu-10-04-1-lts-released-the-fridge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The lost joy of LEDs</title>
		<link>http://fewbar.com/2010/08/the-lost-joy-of-leds/</link>
		<comments>http://fewbar.com/2010/08/the-lost-joy-of-leds/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 21:33:53 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tleds]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=248</guid>
		<description><![CDATA[<a href="http://fewbar.com/2010/08/the-lost-joy-of-leds/" title="The lost joy of LEDs"></a>Today I realized that a quest I set out on long ago was achieved, and I don&#8217;t know how happy I am about it. As I look around my house, I see but one laptop running. The wife has a &#8230;<p class="read-more"><a href="http://fewbar.com/2010/08/the-lost-joy-of-leds/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://fewbar.com/2010/08/the-lost-joy-of-leds/" title="The lost joy of LEDs"></a><p>Today I realized that a quest I set out on long ago was achieved, and I don&#8217;t know how happy I am about it. As I look around my house, I see but one laptop running. The wife has a little Netbook, and you might count the Wii or evne the AT&amp;T U-Verse cable boxes as computers, but when it comes down to it, the only thing I need is my 15&#8243; laptop.</p>
<p>Back when I got into computers, I was cobbling together every little piece of funky hardware I could to build a pseudo-production network inside my house. I had an old AMD 5&#215;86-133 based box that served as my firewall and router. I had a little AMD 900 with redundant cheap IDE disks that was my server. I ran <a href="http://www.debian.org">Debian GNU/Linux </a>on them because thats what all the smartest people I knew recommended, and it was incredible because it let me do everything I wanted to do my way, without making me do anything to get it working. Even though I had just a 56kbit modem connection, I used squid and heavy tuning to make it the best web browsing experience possible.. for.. me.</p>
<p>Oh sure, at work I had servers to play with and I definitely enjoyed work. But the autonomy of doing this my way, and learning new things, was what really made it a passion.</p>
<p>One of the most amazing things that came out of that exercise was the realization that while I had the most amazing modem based home network ever, I wasn&#8217;t always aware of what was going on. Sometimes I&#8217;d wonder, what the heck is going on?<span id="more-248"></span></p>
<p>Then I moved the little 5 port switch from behind the desk, to on top of the desk. Instantly, I felt better. I enjoyed watching the two little ports that my server and workstation were on blink themselves silly, almost solid, when I was copying a file over the network. And the constant little twinkles just made me feel good that my network was busy, useful, and active.</p>
<p>But what about the internet connection? What was it doing? I found the answer to this one in one of those great hacks that just makes you smile. <a title="tleds" href="http://packages.debian.org/squeeze/tleds">tleds</a>. This little program simply hooked into Linux&#8217;s networking stack and made the TX and RX functions on my modem force the keyboard LED&#8217;s on my server to blink. Now, my server actually didn&#8217;t have a keyboard before this, but I grabbed an old one from the closet, plugged it in, and concealed all but the keyboard LED&#8217;s so that it just blinked.</p>
<p>Why do these blinking lights make us feel better? I don&#8217;t know. But thats one thing lost in the cloud. No blinking lights. No feedback that its doing something.</p>
<p>Maybe somebody should make a &#8216;cloudleds&#8217; command that blinks your keybaord when your cloud instances send and receive.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2010/08/the-lost-joy-of-leds/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Your code must suck</title>
		<link>http://fewbar.com/2009/07/your-code-must-suck/</link>
		<comments>http://fewbar.com/2009/07/your-code-must-suck/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 21:19:24 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=103</guid>
		<description><![CDATA[<a href="http://fewbar.com/2009/07/your-code-must-suck/" title="Your code must suck"></a>While attending OSCON 2009 w/ my faithful sidekick fluffy, we constantly kept finding instances of a common theme. The leading companies and projects seem to share one attribute that might shock you. They all have at least *some* crappy code. &#8230;<p class="read-more"><a href="http://fewbar.com/2009/07/your-code-must-suck/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://fewbar.com/2009/07/your-code-must-suck/" title="Your code must suck"></a><p>While attending <a href="http://en.oreilly.com/oscon2009">OSCON 2009</a> w/ my faithful sidekick <a href="http://poorlycoded.com/">fluffy</a>, we constantly kept finding instances of a common theme. The leading companies and projects seem to share one attribute that might shock you.</p>
<p>They all have at least *some* crappy code. At some point, all of them<span id="more-103"></span> have set aside their principles and thrown in a hack to get things working. This is reinforced by those projects that have their dignity, but no market share. FreeBSD users are famous for saying that Linux is coded by 10,000 monkeys. FreeBSD is an awesome project, that has powered some <a href="http://yahoo.com">huge websites</a>. However, the primary Free OS is Linux. Even further along that line is Windows, which is pretty much a hack on a hack on a hack, but somehow, everybody ends up running it.</p>
<p>This isn&#8217;t to say that all of the code in popular projects sucks. Just that some of it does. I&#8217;m still waiting for the example of an organization that has produced pure, beautiful code with no compromises, and then gone on to garner a large market share and/or massive profits.</p>
<p>The site <a href="http://www.thedailywtf.com/">TheDailyWTF</a> exists primarily because of this fact. I hit that site at least twice a week to have a good laugh. Many times it causes me to reminisce about some of the things I saw early in my career. Just as often, I&#8217;m reminded of something more recent. The trend doesn&#8217;t seem to stop, despite advances in computing and human understanding, it goes back decades. I imagine Ogg, the first guy who designed a wheel, snarked about how Thag&#8217;s wheels weren&#8217;t perfectly round. But ultimately, Thag was able to produce wheels that weren&#8217;t perfectly round, but rolled pretty well. He probably got them out in half the time, and ended up trading more wheels for Mammoth pelts than Ogg by a factor of five. No doubt Thag was able to attract more mates with his Mammoth Pelt fortune, so maybe its just in our nature. </p>
<p>Really though, this flies in the face of code purity, which we all want. Code sucking == profit? Hacks == market share? This doesn&#8217;t sit well with those of us who pride ourselves on brace placement discipline, and knowing at least 5 design patterns without looking them up in a book. But there it is, that pile of dung you knocked out at 3am the day before release to QA&#8230; 3 years ago. Still powering the site despite being closer to Alpaca bile than beautiful code.</p>
<p>This doesn&#8217;t mean projects fail without hacks. What it means though, is that projects that obsess over doing things &#8220;the right way&#8221; tend to languish, and rarely achieve success on a massive scale. For some that is ok, they&#8217;re happy to have produced something great that a few people like and that works right for them. In fact, this is largely the  (healthy) attitude I see from the PostgreSQL project. </p>
<p>The PostgreSQL developers and users tend to feel strongly that their database is far superior to the likes of say, MySQL. They&#8217;ll tell you that they have always had full ACID compliance, that their bug counts are low, and performance continues to rise with every release.</p>
<p>I know a lot of people are successfully running PostgreSQL, but really, by contrast, seems like everybody&#8217;s running MySQL. MySQL is not bad code either. It just has hacks. Ok, having dug into it a bit now, it has <strong>a lot</strong> of hacks. But, why is MySQL the leader, and PostgreSQL the follower.</p>
<p>I think the answer is right there in that last sentence. As Cesar Milan will tell you, &#8220;choo gotta be da pack leader&#8221;. PostgreSQL probably would have continued on as a fine, but obscure, database engine had MySQL not revolutionized data storage in the same way Apache revolutionized web serving. MySQL has managed to carve out a huge market with Free software, while PostgreSQL&#8217;s market is only now beginning to grow. Really PostgreSQL has refused to follow in MySQL&#8217;s footsteps for a long time, and because of that, they&#8217;ve avoided many of the pitfalls MySQL has fallen in to as their scope creeps larger and larger like an amoeba slowly devouring the edges of the enterprise market that used to seem so far from its original targets.</p>
<p>However, even the Postgres guys know that hacks may be necessary. <a href="http://archives.postgresql.org/pgsql-hackers/2008-05/msg00913.php">As of May, 2008 they have given in</a> and will produce a general purpose master/slave replication system. The message to the &#8220;pgsql-hackers&#8221; list has an air of reluctance to it..</p>
<blockquote><p>Users who might consider<br />
PostgreSQL are choosing other database systems because our existing<br />
replication options are too complex to install and use for simple cases.<br />
In practice, simple asynchronous single-master-multiple-slave<br />
replication covers a respectable fraction of use cases, so we have<br />
concluded that we should allow such a feature to be included in the core<br />
project.</p></blockquote>
<p>Its like they&#8217;re finally saying &#8220;ok we want more users, so we&#8217;ll include this thing that goes against our principles.&#8221; Personally I think this is great, as PostgreSQL <strong>is</strong> a nice RDBMS, and to be able to use it for small-medium scaleout just like MySQL is really quite exciting.</p>
<p>So, the moral of the story is, if you want your project to be successful, throw in some crap code. Otherwise your developers will be up on their high horses too long, and not down in the trenches getting things done.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2009/07/your-code-must-suck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MemcacheDB fault tolerance procedures</title>
		<link>http://fewbar.com/2009/03/memcachedb-fault-tolerance-procedures/</link>
		<comments>http://fewbar.com/2009/03/memcachedb-fault-tolerance-procedures/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 18:07:24 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fault tolerance]]></category>
		<category><![CDATA[heartbeat]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memcachedb]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[reliability]]></category>
		<category><![CDATA[Scalability]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=46</guid>
		<description><![CDATA[<a href="http://fewbar.com/2009/03/memcachedb-fault-tolerance-procedures/" title="MemcacheDB fault tolerance procedures"></a>It semeed so simple, just setup two memcachedb instances and point them at eachother. Instant fault tolerance, Right? If only it were so simple! Its not entirely clear from the documentation how to setup memcachedb for fault tolerance. Here&#8217;s the &#8230;<p class="read-more"><a href="http://fewbar.com/2009/03/memcachedb-fault-tolerance-procedures/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://fewbar.com/2009/03/memcachedb-fault-tolerance-procedures/" title="MemcacheDB fault tolerance procedures"></a><p>It semeed so simple, just setup two memcachedb instances and point them at eachother. Instant fault tolerance, Right? If only it were so simple!</p>
<p>Its not entirely clear from the documentation how to setup memcachedb for fault tolerance. Here&#8217;s the procedures I&#8217;ve found useful.<br />
<span id="more-46"></span></p>
<ul>
<li><strong>Set up replication right</strong>. With all due respect to Steve Chu, The docs aren&#8217;t really clear on how to setup replication. Its much simpler than it looks. Just run MemcacheDB as you would if it were standalone, but then add a combination of these 3 options:
<ul>
<li>You must have a -R line if you want to participate in replication. This is your hostname and port that listens for connections from other machines for replication. It is the same value that should be listed in every other machine&#8217;s -O.</li>
<li>a -O for *every* other machine that may want to replicate to/from this machine. I am sure there are situations where you won&#8217;t need these, but it makes re-syncing and elections more predictable. You won&#8217;t be able to re-sync &#8220;live&#8221; after a failure without -O options.</li>
<li>-M/-S are not required. If you start n machines without -M or -S, but with appropriate -R and -O lines, they will arbitrarily elect a master. If you run them with -M and -S, then the -M box will just be pushy and always elect itself the master, and the -S boxes will, likewise, always try to defer to slave status.</li>
<li>Lets say we wanted to listen for memcache protocol on port 45000 on host &#8216;node1&#8242; and replicate to &#8216;node2&#8242;</li>
<li>Standalone: <code>memcachedb -p 45000 -H /home/memdb/data -u memdb -N</code></li>
<li>Replication w/ elected master: <code>memcachedb -p 45000 -H /home/memdb/data -u memdb -N -R node1:46000 -O node2:46000</code></li>
<li>Replication Master: <code>memcachedb -p 45000 -H /home/memdb/data -u memdb -N -R node1:46000 -O node2:46000 -M</code></li>
</ul>
</li>
<li><strong>Only the current master can accept writes</strong>. You can see which machine is the master with the &#8216;stats rep&#8217; command. In v1.2.1 its shown as an environment id. Below st_env_id and st_master are the same, so this is the master:<br />
<code><br />
stats rep<br />
STAT st_bulk_fills 0<br />
STAT st_bulk_overflows 0<br />
STAT st_bulk_records 11<br />
STAT st_bulk_transfers 3<br />
STAT st_client_rerequests 0<br />
STAT st_client_svc_miss 0<br />
STAT st_client_svc_req 0<br />
STAT st_dupmasters 0<br />
STAT st_egen 3<br />
STAT st_election_cur_winner 2147483647<br />
STAT st_election_gen 0<br />
STAT st_election_lsn 1/28<br />
STAT st_election_nsites 0<br />
STAT st_election_nvotes 1<br />
STAT st_election_priority 100<br />
STAT st_election_sec 5<br />
STAT st_election_status 0<br />
STAT st_election_tiebreaker 3676766282<br />
STAT st_election_usec 69747<br />
STAT st_election_votes 0<br />
STAT st_elections 1<br />
STAT st_elections_won 1<br />
STAT st_env_id 2147483647<br />
STAT st_env_priority 100<br />
STAT st_gen 2<br />
STAT st_log_duplicated 0<br />
STAT st_log_queued 0<br />
STAT st_log_queued_max 0<br />
STAT st_log_queued_total 0<br />
STAT st_log_records 0<br />
STAT st_log_requested 0<br />
STAT st_master 2147483647<br />
STAT st_master_changes 0<br />
STAT st_max_lease_sec 0<br />
STAT st_max_lease_usec 0<br />
STAT st_max_perm_lsn 0/0<br />
STAT st_msgs_badgen 0<br />
STAT st_msgs_processed 5<br />
STAT st_msgs_recover 0<br />
STAT st_msgs_send_failures 2<br />
STAT st_msgs_sent 10<br />
STAT st_newsites 0<br />
STAT st_next_lsn 1/8916<br />
STAT st_next_pg 0<br />
STAT st_nsites 2<br />
STAT st_nthrottles 0<br />
STAT st_outdated 0<br />
STAT st_pg_duplicated 0<br />
STAT st_pg_records 0<br />
STAT st_pg_requested 0<br />
STAT st_startsync_delayed 0<br />
STAT st_startup_complete 0<br />
STAT st_status 2<br />
STAT st_txns_applied 0<br />
STAT st_waiting_lsn 0/0<br />
STAT st_waiting_pg 0<br />
END<br />
</code><br />
However, its much simpler, I think, to just try and store a value on an instance. If you get &#8220;STORED&#8221; back, then this is the master. If you get NOT_STORED back, this is a slave. If it blocks (timeouts are hard in simple scripts, I know.. perldoc -f alarm), you are in a &#8220;DOWN&#8221; state. The danger here is one of split brain where both nodes thing they&#8217;re the master.. but.. if they&#8217;re not talking, you have bigger problems!</li>
<li><strong>Out of sync slaves can&#8217;t READ either!</strong> This one bit us just the other day. Something ocurred where our slave wasn&#8217;t able to retrieve the latest log entries from the master. Because of this, it was reporting errors in replication. During this time, *all* commands blocked. We were relying on basic round-robin DNS for failover, thinking that memcachedb was simple enough, it was either &#8220;up&#8221; or &#8220;down&#8221;. Unfortunately, it was stalled on one box, so everything that hit that box blocked and timed out until we firewalled the port so connections wouldn&#8217;t succeed. We eventually had to stop the instance, copy a db_hotbackup from the master, then start it again. This still had to catch up from the point at which the db_hotbackup copies logs were checkpointed, which was (because we&#8217;re on v1.0.3) many hours before. While it was catching up, all commands (even stats commands.. which is disappointing..) blocked.
</li>
<li><strong>Use a load balancer, not round robin</strong>. With that said, a load balancer is a far better solution then round robin. In this case, because the box was &#8220;up&#8221;, but failing to respond, we were at the mercy of the pecl memcache module&#8217;s definition of what was &#8220;up&#8221; or &#8220;down&#8221; for reads. A load balancer separates this logic out into monitors so the code can just connect to a virtual IP, or use some list of servers it is given.</li>
<li><strong>Even better.. just use a floating IP</strong>. MemcacheDB seems to scale to ridiculous levels with reads. Like, 400:1 read:write performance. Do you really need lots of slaves? Just having an IP that follows the master will give you fault tolerance. Its easy to determine if a box is the master. You can even do a &#8216;rep_set_priority 500&#8242; to make sure a box stays the master as long as it has the IP. If you&#8217;re running on Linux, Good old <a href="http://www.linux-ha.org/">Heartbeat</a> is perfect for this. If you need to scale past the write capabilities of one box, then partitioning by using a stable hash algorithm on the keys is a far better solution than master/slave replication, and is already built in to pretty much every memcache client.</li>
<li><strong>Be careful with db_archive/db_checkpoint</strong>. This is mostly regarding v1.0.3, as I don&#8217;t know the impact of these commands on v1.1 or 1.2. However, it would seem that even with a replication policy of &#8220;ACK_ONE&#8221;, its still possible to purge logs that the slave needs. This may or may not be true (something else could have gone wrong) but it seems that running db_checkpoint/db_archive too aggressively seems to have broken our replication. There&#8217;s no reason to purge logs too often, so be wary when doing so.</li>
</ul>
<p>Hopefully this will help other users who are starting to setup MemcacheDB and need fault tolerance.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2009/03/memcachedb-fault-tolerance-procedures/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Query Cache defeats Serverzilla</title>
		<link>http://fewbar.com/2008/07/mysql-query-cache-scales-like-a-286-with-turbo-off/</link>
		<comments>http://fewbar.com/2008/07/mysql-query-cache-scales-like-a-286-with-turbo-off/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 20:47:55 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=11</guid>
		<description><![CDATA[<a href="http://fewbar.com/2008/07/mysql-query-cache-scales-like-a-286-with-turbo-off/" title="Query Cache defeats Serverzilla"></a>So a few days ago, my big mean MySQL server started having problems that were very hard to explain. It was slowing down, taking a minute to run queries that usually take a few seconds, and Linux load averages were &#8230;<p class="read-more"><a href="http://fewbar.com/2008/07/mysql-query-cache-scales-like-a-286-with-turbo-off/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://fewbar.com/2008/07/mysql-query-cache-scales-like-a-286-with-turbo-off/" title="Query Cache defeats Serverzilla"></a><p>So a few days ago, my big mean MySQL server started having problems that were very hard to explain. It was slowing down, taking a minute to run queries that usually take a few seconds, and Linux load averages were in the teens, despite having quiet disks (less than 0.1% cpu IO wait time) and plenty of RAM (128G for about 200G of data total&#8230;).</p>
<p>The developers were stumped. The other systems guys were stumped. So was I. But it still seemed ok. We found all sorts of things to point fingers at, but nothing made sense.<br />
<span id="more-11"></span><br />
Then this Monday, everything came to a screeching halt. 3 second queries were taking 15 minutes. 30 second queries were never completing. The CPU&#8217;s were only a little busy. What gives?! This box has 8 CPU cores and 128G of RAM.. nothing can take it down, right?!</p>
<p>We threw our hands in the air and failed over to the active standby (the other side of our master&lt;-&gt;master replication pair). Suddenly all was well. But something smelled wrong. We blamed some kind of bug in MySQL.</p>
<p>I spent all day trying to make Memcached more efficient, and trying to explain why suddenly this beast was felled by such tiny arrows as instantaneous queries that should have been cached anyway.</p>
<p>Oh wait, did somebody say cached? As in the MySQL query cache? I mentioned this in the #mysql channel on <a href="http://freenode.net">Freenode</a>, and Mr. Eric Bergen (ebergen) from <a href="http://www.provenscaling.com/">Proven Scaling</a> immediately said something like &#8220;well duh, turn off the cache, moron&#8221;. I was dumbfounded. Shouldn&#8217;t it be helping us with all those tiny queries?</p>
<p>Well apparently not. <a href="http://lists.mysql.com/internals/35777">This recent thread on the MySQL internals list</a> talks about mutex contention in the query cache while it is *searched*, not just while it is updated. This is disasterous for an environment where thousands and thousands of tiny queries are being run constantly. Even with query_cache_type set to 2, or &#8220;cache on demand&#8221; mode, every query in the system must run through this mutex.</p>
<p>So, this morning when the standby box again cried for mercy, hitting max_connections and spinning all queries around in circles, I ran &#8216;SET GLOBAL query_cache_type=2&#8242;. Instantly the server became more healthy. I half expected to trade one problem for another.. with the server being consumed by tiny queries. But instead, these tiny queries did as expected, and took very little time to complete. And large queries against tables that change every second or 2 didn&#8217;t have to contend for the query cache, they just ran through like nothing.</p>
<p>So, it would appear that for any sort of multi-core installations of MySQL, the query cache is not only a waste, but a hazard!</p>
<p>Thanks again to Mr. Bergen. I would not have thought about that until he said it.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2008/07/mysql-query-cache-scales-like-a-286-with-turbo-off/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenOffice&#8217;s achilles heel</title>
		<link>http://fewbar.com/2008/06/openoffices-achilles-heel/</link>
		<comments>http://fewbar.com/2008/06/openoffices-achilles-heel/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 15:43:56 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[openoffice]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=7</guid>
		<description><![CDATA[<a href="http://fewbar.com/2008/06/openoffices-achilles-heel/" title="OpenOffice&#039;s achilles heel"></a>Anybody who is in IT in America, has probably experienced that sinking feeling when somebody somehow introduces the latest version of Microsoft Office into their organization. It usually comes in like some corporate ninja while you&#8217;re not looking. Whether its &#8230;<p class="read-more"><a href="http://fewbar.com/2008/06/openoffices-achilles-heel/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://fewbar.com/2008/06/openoffices-achilles-heel/" title="OpenOffice&#039;s achilles heel"></a><p>Anybody who is in IT in America, has probably experienced that sinking feeling when somebody somehow introduces the latest version of Microsoft Office into their organization. It usually comes in like some corporate ninja while you&#8217;re not looking. Whether its an application that your accounting department writes with the new version of Access, or that Outlook plugin that somebody locked in to, you have to deal with it.</p>
<p>The most frustrating part of this for me is never that people are going to use Office. Its not a bad product. Whats frustrating, is that every 3 or 4 years, Microsoft somehow gets people to pay $300-$400 per user. <span id="more-7"></span>As somebody who has used <a href="http://www.openoffice.org/">OpenOffice</a> since it was called &#8220;StarOffice&#8221;, this is perplexing. There&#8217;s even a high quality mac version called <a href="http://www.neooffice.org">NeoOffice</a>, in case anybody still thinks you have to have X11 installed to run OpenOffice on Mac. The file format problem isn&#8217;t even an issue anymore. Microsoft has has priced office so high, people stay on very old versions as long as they can, ensuring that even office to office incompatibilities are common.</p>
<p>So why not use it? OpenOffice is totally free, and has all the features that most users care to use in Office.</p>
<p>Oh wait.. except one. The email client. OpenOffice has no Outlook competitor. Calc is like Excel. Writer is like Word. There&#8217;s a powerpoint equivilent too. But no Outlook. StarOffice was written before email was really on the radar. But they&#8217;ve had enough time by now, why haven&#8217;t they solved this?</p>
<p>I&#8217;m sure some OpenOffice users are happy with <a href="http://www.mozilla.com/en-US/thunderbird/">Thunderbird</a>. I&#8217;m not. It just doesn&#8217;t work very well. I&#8217;ve been using Linux with Gnome/Ximian/SuSE/Novell&#8217;s <a href="http://www.gnome.org/projects/evolution/">Evolution</a> for years, and it just keeps getting better. Even for users of MS Exchange, IMAP access works, and Evolution actually implements the shared calendaring and address book of Exchange. On my mac, I use Apple&#8217;s excellent mail application. But on Windows, people are kind of stuck.</p>
<p>I recently had a friend who tried 4 or 5 email clients on Windows, trying to get away from constantly dealing with his &#8220;pst&#8221; files crashing or just going slow. He gave up in defeat. There&#8217;s just nothing. Another friend has all his email forwarded to his Gmail account. I&#8217;m not a big fan, but he is. I think this is just crazy that people woudl choose a webmail-only client for email.</p>
<p>Maybe I&#8217;m just being too hard on Thunderbird. I got all excited when I saw a blog entry <a href="http://cybernetnews.com/2007/10/13/openoffice-30-wants-to-compete-with-outlook/">that said OpenOffice 3.0 would compete with Outlook</a>. But its just Thunderbird, with <a href="http://www.mozilla.org/projects/calendar/lightning/">Lightning</a>. At first I was deflated by this. But with Lightning, maybe Thunderbird will work well. I still think Outlook is lightyears ahead of it in terms of usability.</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2008/06/openoffices-achilles-heel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Thread_Concurrency myth</title>
		<link>http://fewbar.com/2008/06/the-thread_concurrency-myth/</link>
		<comments>http://fewbar.com/2008/06/the-thread_concurrency-myth/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 17:20:16 +0000</pubDate>
		<dc:creator>clint</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[threads]]></category>

		<guid isPermaLink="false">http://fewbar.com/?p=6</guid>
		<description><![CDATA[<a href="http://fewbar.com/2008/06/the-thread_concurrency-myth/" title="The Thread_Concurrency myth"></a>Just a few weeks ago, I found out that thread_concurrency&#8217;s purported magical effects at correcting MySQL&#8217;s concurrency limitations (especially in 4.1) were something of a myth. It was a post on mysql&#8217;s lists that alerted me to this. Apparently it &#8230;<p class="read-more"><a href="http://fewbar.com/2008/06/the-thread_concurrency-myth/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://fewbar.com/2008/06/the-thread_concurrency-myth/" title="The Thread_Concurrency myth"></a><p>Just a few weeks ago, I found out that thread_concurrency&#8217;s purported magical effects at correcting <a href="http://bugs.mysql.com/bug.php?id=15815">MySQL&#8217;s concurrency limitations</a> (especially in 4.1) were something of a myth. It was <a href="http://lists.mysql.com/mysql/208874">a post on mysql&#8217;s lists</a> that alerted me to this. Apparently it only works on Solaris, Linux&#8217;s threading library ignores this parameter completely. This is not to be confused with innodb_thread_concurrency, which is quite useful in controlling the flow of transactions through InnoDB. I think the problem really lies in the fact that the default my.cnf example configs tell us to set thread_concurrency to the number of CPU&#8217;s*2. They fail to mention that this only matters on Solaris, though <a href="http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html#option_mysqld_thread_concurrency">the manual is quite clear</a>.<br />
<span id="more-6"></span><br />
I think I set this parameter to 1, 4, and 8 trying to see if it would affect things positively or negatively on quite a few 4.1 boxes. I always just sort of assumed it was going to help prevent any sort of snowballing of server load if it ever got hit hard.</p>
<p>Yet another example where its important to RTFM!</p>
]]></content:encoded>
			<wfw:commentRss>http://fewbar.com/2008/06/the-thread_concurrency-myth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

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

