<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:arjen_lentz</id>
  <title>Arjen's Journal</title>
  <subtitle>Moved to http://openquery.com/blog/</subtitle>
  <author>
    <name>Arjen Lentz</name>
  </author>
  <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom"/>
  <updated>2009-04-21T23:06:18Z</updated>
  <lj:journal userid="4747889" username="arjen_lentz" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://arjen-lentz.livejournal.com/data/atom" title="Arjen's Journal"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:154390</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/154390.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=154390"/>
    <title>Move to Open Query blog</title>
    <published>2009-04-21T23:06:18Z</published>
    <updated>2009-04-21T23:06:18Z</updated>
    <category term="lentz"/>
    <category term="mysql"/>
    <category term="openquery"/>
    <category term="livejournal"/>
    <category term="arjen"/>
    <category term="blog"/>
    <content type="html">I'm shifting away from LiveJournal. It lacks ability to search and otherwise peruse archived blog posts. And of course it's only me, while Open Query has more people.&lt;br /&gt;&lt;br /&gt;From now on the posts will be at &lt;a href="http://openquery.com/blog/"&gt;http://openquery.com/blog/&lt;/a&gt; and this is aggregated to Planet MySQL as a group blog. You may have already seen Walter posting from his seat at the MySQL Conf. All posts and comments from my LJ blog have been migrated to WordPress, thanks to magic performed by young &lt;a href="http://bitmeta.org/"&gt;Akash Mehta&lt;/a&gt;. Unfortunately the comment threading can't be exported.&lt;br /&gt;&lt;br /&gt;The full export means that my personal posts are now also present at Open Query, although I may move those elsewhere later. The existing blog entries on LJ will stay for a while at least, although I do have to pay for the LiveJournal subdomain to keep the URLs alive.&lt;br /&gt;&lt;br /&gt;A little sidenote on the export... it actually to considerable effort and script hacking and possibly even some screen scraping. Consider this is my own data... Remember, LJ &lt;em&gt;used to have&lt;/em&gt; a perfect export, which actually enticed one to stay put. Funny, isn't it. But that was in the Danga days, and we're two owners down the line from that (SixApart and then the spinoff-sale to the Russians). Lock-in makes people want to leave more.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:154209</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/154209.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=154209"/>
    <title>Oracle agrees to buy Sun</title>
    <published>2009-04-20T13:10:00Z</published>
    <updated>2009-04-20T13:10:00Z</updated>
    <category term="mysql"/>
    <category term="mysqlconf09"/>
    <category term="sun"/>
    <category term="oracle"/>
    <content type="html">See &lt;a href="http://www.nytimes.com/2009/04/21/technology/companies/21sun.html"&gt;Oracle Agrees to Acquire Sun Microsystems&lt;/a&gt; (NY Times, 20 April 2009). Wellwell, that's quite interesting, isn't it... as to what it means for MySQL, ZFS, OpenSolaris, OpenOffice.org, VirtualBox, Java, and numerous other tidbits, that remains to be seen.&lt;br /&gt;&lt;br /&gt;It must be a buzzy kind of day at the MySQL Users Conference 2009, with this news coming in just before the opening...  and it's only been a year since Sun bought MySQL and Jonathan Schwartz did a key note at the conference. I'm sure we'll hear a lot more from a lot of people, not necessarily content but definitely conjecture and pre-emptive opinions ;-)</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:154078</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/154078.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=154078"/>
    <title>Open Query at MySQL Users Conference 2009</title>
    <published>2009-04-20T05:02:55Z</published>
    <updated>2009-04-20T05:09:10Z</updated>
    <category term="mysql"/>
    <category term="mysqlconf09"/>
    <category term="openquery"/>
    <content type="html">I'm not personally there this year, but Walter Heck will be. In case you haven't met Walter yet, photo enclosed ;-)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://openquery.com/company/people"&gt;&lt;img title="Photo of Walter" src="http://openquery.com/files/walter-openquery-114x160.jpg" alt="Photo of Walter" width="114" height="160" style="margin: 5px;" align="left" border="0" /&gt;&lt;/a&gt;He's a techie, like you, and he'd love to meet you and hear how you're using MySQL and surrounding technologies and what things might make your life easier in terms of application architecture, development, deployment, maintenance, and so on.&lt;br /&gt;&lt;br /&gt;This may or may not fit with the services that &lt;a href="http://openquery.com/services/mysql"&gt;Open Query&lt;/a&gt; provides, but the key point is to listen, not sell. If there's a good match, of course that's fine too!&lt;br /&gt;&lt;br /&gt;As a sidenote, just to pre-empt the inevitable question of &lt;em&gt;"Arjen why are you not here?"&lt;/em&gt;: flying over to the US has always been fine, but coming back is a pile of grief every time taking multiple weeks to recover. I've never had that issue with for instance trips to Europe. That's not just grief in terms of personal discomfort or lost work time, but it means my daughter really loses out on her papa for about 3 weeks.&lt;br /&gt;&lt;br /&gt;Before I made the decision to note make the trip this year, I did enter various items into the session submission process months back - they didn't get accepted, but I'm not unique in that respect. Many well known speakers from previous years did not get a slot this year. No worries. There's plenty of things going on in the surroundings, including Sheeri's game day and community conference and Percona's performance sessions, as well as all the excellent encounters in the corridors and in the evenings.&lt;br /&gt;&lt;br /&gt;Having been absent in 2007 as well, I would like to add a little bit of outside perspective on the event... while for this week everything appears to be focused on the conference (at least when you look at Planet MySQL), most MySQL users around the world will of course not be at the conf, and have the same needs like the rest of the year. I believe it's really important to tell about insights and developments all year round, as well as being active in the various interaction media (such as forums, user groups and events).&lt;br /&gt;&lt;br /&gt;Anyway, have a great time at the conference, and do have a chat with Walter!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:153719</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/153719.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=153719"/>
    <title>InnoDB lock timeout before query execution</title>
    <published>2009-04-17T23:34:58Z</published>
    <updated>2009-04-17T23:34:58Z</updated>
    <category term="mysql"/>
    <category term="innodb"/>
    <content type="html">I found this yesterday while tracking down a locking issue for a client. They had a connection time out on a lock, but before it times out, SHOW PROCESSLIST had the status 'statistics' so it wasn't actually executing the query yet. So, what was it doing and why did it time out there?&lt;br /&gt;&lt;br /&gt;The answer actually was remarkably simple, but I did have to take a peek in the MySQL server source code (horay for Open Source!) The server sets the thd_proc_info to 'statistics' when calling the join optimiser, that's the part of the optimiser that works out the best join order.&lt;br /&gt;&lt;br /&gt;A lesser known feature of the join optimiser is that if it works out that only one row can match (lookup on primary or unique key field), it'll try to retrieve the row. If there's no match, there's an "impossible WHERE clause" and essentially the entire query is optimised away and 0 rows returned.&lt;br /&gt;&lt;br /&gt;If there is a match, all references to columns in that table can be replaced with the values that were just retrieved, turning them into constants. After all, there's only one row matching! This can optimise away tables, removing the need to execute some or all joins. You don't actually see this directly if you do EXPLAIN EXTENDED and then SHOW WARNINGS, because that output is from the parse tree which does not know about the join structure. But what you will see there is that the columns were replaced with constants, so from that you can deduce what's going on.&lt;br /&gt;&lt;br /&gt;For a query&lt;br /&gt;  &lt;code&gt;  EXPLAIN EXTENDED SELECT name from Country where code='AUS'&lt;/code&gt;&lt;br /&gt;you would see access &lt;em&gt;type&lt;/em&gt; &lt;strong&gt;const&lt;/strong&gt; in the explain (which is the indicator for this optimisation), and &lt;code&gt;SHOW WARNINGS&lt;/code&gt; brings up&lt;br /&gt;  &lt;code&gt;  select 'Australia' AS `name` from `world`.`country` where 1&lt;/code&gt;&lt;br /&gt;so you see the WHERE clause is gone completely and the &lt;em&gt;name&lt;/em&gt; column in the SELECT has been fed the value Australia so it's all constants.&lt;br /&gt;&lt;br /&gt;Back to the original issue... if another connection holds an exclusive (write) lock on that particular row, the join optimiser will be waiting for the lock to be released and that's how you can actually get a lock timeout at this stage. It's a perfectly normal thing to happen.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:153384</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/153384.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=153384"/>
    <title>What a Google data center really looks like</title>
    <published>2009-04-03T00:16:35Z</published>
    <updated>2009-04-03T00:16:35Z</updated>
    <content type="html">Google has fessed up: apparently it looks like a bunch of shipping containers, since 2005. And it does &lt;strong&gt;not&lt;/strong&gt; use the usual rack stuff or centralised backup power. See &lt;a href="http://news.cnet.com/8301-1001_3-10209580-92.html"&gt;Google uncloaks once-secret server&lt;/a&gt; for a decent overview, plus pictures.&lt;br /&gt;&lt;br /&gt;I think there's quite a lof of good information in there, with important lessons. Just a few:&lt;ul&gt;&lt;li&gt;It's not fancy-brand stuff, they're simple Gigabyte mainboards&lt;li&gt;An open frame rather than enclosures.&lt;li&gt;12V battery on the frame, rather than a centralised UPS. More energy efficient, and no single point of failure.&lt;li&gt;Heatsinks, not lots of fans (mechanical stuff fails). There'll be airflow-creating foo for the whole container, but since it's a single enclosed space there's neat separation between hot/cold already. Efficient!&lt;li&gt;Two regular SATA harddisks&lt;/li&gt;&lt;/ul&gt;So, it's mostly commodity stuff in a custom frame and and other minor tidbits. There's 1160 servers per container, and by the looks of it it should work out pretty cheap to buy, build and operate.&lt;br /&gt;&lt;br /&gt;The energy efficiency has more aspects... if you use less power, you're also generating less heat that then needs to be got rid of. Cool machines are more reliable and live longer, and even fractions of a degree can make a significant difference.&lt;br /&gt;&lt;br /&gt;You can see it all from a monetary perspective, but it also makes sense in terms of maintenance effort, waste/disposal and other environmental impact aspects. Of course these containers still eat a lot of electricity, but there's a lot in there and it will be way "greener" than most data centers.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:153111</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/153111.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=153111"/>
    <title>The problem with April Fools in the MySQL/web space...</title>
    <published>2009-04-01T23:52:33Z</published>
    <updated>2009-04-01T23:56:18Z</updated>
    <category term="mysql"/>
    <category term="openquery"/>
    <category term="ourdelta"/>
    <category term="aprilfools"/>
    <content type="html">...is that truth is stranger than fiction. Reality does not appear any more plausible than plain nonsense.&lt;br /&gt;&lt;br /&gt;We were discussing this yesterday on &lt;a href="irc://chat.freenode.net/ourdelta"&gt;#ourdelta&lt;/a&gt; (Freenode IRC) in the context of &lt;a href="http://www.xaprb.com/blog/2009/04/01/how-mysql-really-executes-a-query/"&gt;How MySQL really executes a query&lt;/a&gt; by Baron. &lt;a href="http://antbits.blogspot.com/"&gt;Antony Curtis&lt;/a&gt; noted that if he'd write a truthful post on that topic, people would think it was made-up regardless of the day of the year!&lt;br /&gt;&lt;br /&gt;Another proof of the premise: Baron has now put a giant banner above/below his post, explaining that it was a joke. Apparently that's necessary?&lt;br /&gt;&lt;br /&gt;I tend to come up with neat ideas for April Fools throughout the year, neglect to write them down, and come the day I have a blank. But, given the above, there's another option: you just write a truthful story, still leaving people wondering whether it's for real. I reckon the main issue is probably with the rest of the year, where lots of people still write nonsense, and the truth remains weird as usual. At least on April 1st you know to question. I hope.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:152949</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/152949.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=152949"/>
    <title>Predictive caching in a MySQL-backed infrastructure</title>
    <published>2009-04-01T02:07:49Z</published>
    <updated>2009-04-01T02:07:49Z</updated>
    <category term="mysql"/>
    <category term="predictive caching"/>
    <category term="openquery"/>
    <category term="scaling"/>
    <content type="html">Sounds a bit far fetched (pun intended ;-), but we're doing it. This is not inside of the MySQL server, but rather the overall application design. Let me run you through the logic...&lt;br /&gt;&lt;br /&gt;Some key aspects to scaling are: not doing unnecessary queries, and caching what you can. Just a quick baseline. The fastest query is the one you don't do, or the one you've already done before - the latter being caching.&lt;br /&gt;&lt;br /&gt;A simple yet brilliant example of this is the Youtube trick where a script reads the relay log, converting updates into appropriate selects and running them so that the InnoDB cache will have the blocks in memory when the slave SQL thread executes the actual update. Maatkit now has a tool for this, so it's publically available. It's not quite predictive, but it's a neat trick anyway that sometimes comes in handy. Search engines use similar tricks.&lt;br /&gt;&lt;br /&gt;Extending on this, with certain applications you actually tell what is likely to happen next, sometimes for a particular user and often for many users. Individual user behaviour may sometimes appear random, but as a group it can be highly predictable. The analysis needs to be done properly though, otherwise averaging will make certain interesting behavioural patterns disappear.&lt;br /&gt;&lt;br /&gt;Anyway, if you can identify these patterns you can take appropriate measures, such as do some queries so they get cached, and/or schedule other relevant actions (so it's more than just caching, but it's a reasonably suitable name anyway). This allows the app to deal with higher peak load, as well as improving response time for individual user.&lt;br /&gt;&lt;br /&gt;I might do a talk or article on the predictive caching concept some time, as I appreciate that the short description may appear a bit abstract or obscure. But I assure you it's entirely practical and real.&lt;br /&gt;&lt;br /&gt;It's one example of how &lt;a href="http://openquery.com/"&gt;Open Query&lt;/a&gt; helps its clients scale well, by design. We focus on preventing emergencies, which includes not just scenarios where stuff fails (and does a safe failover), but also the &lt;em&gt;"oh dear we suddenly have so many more users than a minute ago"&lt;/em&gt; type of happening, which should actually be &lt;strong&gt;an occasion to enjoy, not stress about&lt;/strong&gt;.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:152783</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/152783.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=152783"/>
    <title>Relax! A Failure is NOT an Emergency - a talk in Melbourne</title>
    <published>2009-03-27T01:31:01Z</published>
    <updated>2009-03-27T01:31:01Z</updated>
    <category term="training"/>
    <category term="mysql"/>
    <category term="openquery"/>
    <category term="melbourne"/>
    <category term="talk"/>
    <content type="html">While I'm in Melbourne in a few weeks for &lt;a href="http://openquery.com/training/melbourne"&gt;training&lt;/a&gt; I'm once again visiting my friends at Linux Users of Victoria (LUV). It's been a while since my schedule coincided with their meeting schedule!&lt;br /&gt;&lt;br /&gt;I've been invited to do one of the talks (Sandrine Balbo doing the other), and my topic is &lt;em&gt;"Relax! A Failure is NOT an Emergency."&lt;/em&gt; which is although somewhat MySQL-related not actually MySQL-specific.&lt;br /&gt;&lt;br /&gt;This will be on Tuesday April 7th. You can find more detailed description and location/time info in the &lt;a href="https://luv.asn.au/2009/04"&gt;LUV announcement&lt;/a&gt;.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:152544</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/152544.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=152544"/>
    <title>Arjen also on twitter &amp; identi.ca</title>
    <published>2009-03-19T11:46:09Z</published>
    <updated>2009-03-19T11:46:09Z</updated>
    <category term="twitter"/>
    <category term="mysql"/>
    <category term="bluehackers"/>
    <category term="openquery"/>
    <category term="ourdelta"/>
    <category term="arjen"/>
    <category term="identi.ca"/>
    <content type="html">If you'd like to follow shorter scribbles of what I get up to, like my work at &lt;a href="http://openquery.com/"&gt;Open Query&lt;/a&gt;, &lt;a href="http://ourdelta.org"&gt;OurDelta&lt;/a&gt; and of course the &lt;a href="http://bluehackers.org"&gt;BlueHackers&lt;/a&gt; initiative, I've got myself organised at &lt;a href="http://twitter.com/arjenlentz"&gt;http://twitter.com/arjenlentz&lt;/a&gt; or &lt;a href="http://identi.ca/arjenlentz"&gt;http://identi.ca/arjenlentz&lt;/a&gt; (you can pick one, they have the same feed).</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:152208</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/152208.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=152208"/>
    <title>Open Query is now a DotCom</title>
    <published>2009-03-16T11:02:58Z</published>
    <updated>2009-03-16T11:06:20Z</updated>
    <category term="mysql"/>
    <content type="html">Yes, Open Query is now a DotCom. In the sense of the domain name, that is (&lt;a href="http://openquery.com"&gt;openquery.com&lt;/a&gt;). It just took us quite a while to "catch" the domain off a hog that was somehow really attached to it!&lt;br /&gt;&lt;br /&gt;Other than that, we are&lt;ul&gt;&lt;li&gt;&lt;em&gt;not&lt;/em&gt; moving to Silicon Valley; the world is a big place with lots of beautiful places to live and work from. Different OQ people are in different such places.&lt;/li&gt;&lt;li&gt;&lt;em&gt;not&lt;/em&gt; seeking or accepting any venture capital; self-funded organic growth works well for us.&lt;/li&gt;&lt;li&gt;&lt;em&gt;not&lt;/em&gt; aiming to get bought, or float...&lt;/li&gt;&lt;/ul&gt;Just in case anybody was wondering! ;-)&lt;br /&gt;&lt;br /&gt;Email to either the .com or .com.au will work, and the website simply redirects so it's zero-fuss for everybody. If you experience any hassles, do let me know.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:152062</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/152062.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=152062"/>
    <title>What a school can look like, work better, and cheaper</title>
    <published>2009-03-13T11:58:22Z</published>
    <updated>2009-03-13T11:58:22Z</updated>
    <category term="learning"/>
    <category term="cost"/>
    <category term="schools"/>
    <category term="building"/>
    <content type="html">&lt;a href="http://www.youtube.com/watch?v=NLvoNrjryeg"&gt;Schools Designed for Learning&lt;/a&gt;: The Denver School of Science and Technology, presented by the American Architectural Foundation, KnowledgeWorks Foundation, and Target, this video features the innovative Denver School of Science and Technology.&lt;br /&gt;&lt;br /&gt;Building it was cheaper (per sq.ft) than a "regular" school, and the results are so much better. Fantastic. Take note everybody, and feel very embarassed if you dare to build any more "same old" school blocks!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:151747</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/151747.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=151747"/>
    <title>On Oracle (and MySQL), Enterprise, Suitability and Sense</title>
    <published>2009-03-13T11:02:11Z</published>
    <updated>2009-03-13T21:54:33Z</updated>
    <category term="enterprise"/>
    <category term="mysql"/>
    <category term="postgresql"/>
    <category term="san"/>
    <category term="open query"/>
    <category term="oracle"/>
    <category term="opengis"/>
    <content type="html">&lt;a href="http://www.xaprb.com/blog/2009/03/13/50-things-to-know-before-migrating-oracle-to-mysql/"&gt;50 things to know before migrating Oracle to MySQL&lt;/a&gt; by Baron Schwartz is an interesting read, it points out clearly that MySQL is not Oracle. However, Oracle is &lt;em&gt;not&lt;/em&gt; the benchmark by which all others are to be judged. So what do we compare with, or actually, why do we compare at all?&lt;br /&gt;&lt;br /&gt;Hmm, so we take three steps back, and get a much better view... Marten Mickos (MySQL CEO from 2001 until the Sun acquisition in 2008) said it all along &lt;em&gt;"MySQL does not compete with Oracle"&lt;/em&gt;. I don't think people actually appreciated what he was saying, or even believed that he meant precisely what he said. They might have thought "oh that's just positioning and protesting too much to make the opposite point". But he wasn't, it was the clear plain truth and it still is today (and so it should remain, I think).&lt;br /&gt;&lt;br /&gt;In my conference talks and community relations work at the time I described the same thing differently. The only way to compete with Oracle is to become Oracle, and why would you want to do that? Oracle is already very good at being Oracle, because they are Oracle. Seen on the business level, trying to compete head-on against an incumbent tends to not be a winning proposition, even if you're cheaper. It's not really smart business at all.&lt;br /&gt;&lt;br /&gt;You don't have to be Oracle to be a valid choice for many deployments, or "horses for courses" as the Australians love to say. MySQL does many things differently, which -in part by chance and in part by being in the right spot at the right time- has allowed it to become one of the core components of the modern web world. And it's doing very well there (and beyond), as we all know. And I'm judging this is on sites and business relying on it and doing well, not anyone in particular making money off MySQL as that in my opinion is not relevant for judging success (that said, there's plenty of profitable and sustainable business in the MySQL space).&lt;br /&gt;&lt;br /&gt;MySQL doesn't have to be suited to every possible need, and its not suiting certain needs is not a failure. &lt;em&gt;A knife and a screwdriver are both useful types of tools, but they are not interchangeable in terms of purpose. You can cut some things with a screwdriver, and you can try to turn a screw with a knife, and sometimes such uses even make sense - but it can also get rather awkward, break the tool, cut your hand, and so on. It's not necessarily pretty.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;MySQL has a different market from Oracle, and &lt;em&gt;that&lt;/em&gt; is why they are not in direct competition. It's not about low end and high end on a single scale, it's quite different in many aspects. You may try to simplify it if you want, but you won't capture the essence of it all. There is a bit of market overlap, and there are also historical deployments of Oracle where it might not have been the most suitable choice (using a knife where a screwdriver might have worked better). So, in some fairly rare cases (seen over the huge numbers of both Oracle and MySQL deployments) some people have a choice where both are suitable, and in some cases migration makes sense if the wrong tool was getting used in the first place. But again you don't want to generalise either.&lt;br /&gt;&lt;br /&gt;Presenting to government about migrating from Oracle to MySQL should really be seen in the context of the above two corner cases, and not as a general pitch of "MySQL can replace Oracle". 'cos that'd be ridiculous, right? I know that some sales people would love to close even more such big gigs, but you shouldn't sell something into an inappropriate space. Related communications have muddied the waters somewhat, and I really think that's unfortunate. It has set expectations and a focus in "the market" that is neither appropriate nor sensible, and in the 5.0 and 5.1 releases of MySQL we've also seen how that "reaching for enterprise" (whatever your definition of it is) has not been all that great.&lt;br /&gt;&lt;br /&gt;By the way, the term "Enterprise" is as polluted as the term "Cluster". They are both dreadful terms now to use for defining anything. You wouldn't convey a clear concept at all, your picture of it is not the same as the person you're talking with: you won't be on the same wavelength!&lt;br /&gt;&lt;br /&gt;The traditional Enterprise database market (defining it broadly as large corporations, government, defence) is a very small and limited space; lots of money there, but it's still limited. There's a much larger space out there, with very high demands in terms of rapid growth, larger numbers of concurrent users than any enterprise organisation has internally, and so on. "Enterprise features" and "Enterprise architecture" are not actually all that suited for those different needs, and in some cases they are hideously bad fits. This is why I bring up &lt;a href="http://arjen-lentz.livejournal.com/151413.html"&gt;issues like SAN deployments&lt;/a&gt;. SANs are very good, but in the MySQL space they are generally (not always) the wrong choice. But someone thinks on a linear scale, reaches for the top, and goes for an Enterprise solution... must be good and they won't get fired for it. Horay? Not.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Summary:&lt;br /&gt;MySQL is not Oracle. MySQL is not Enterprise. MySQL is MySQL, it's very very good at it, and the "usable market space" for its functionality is absolutely huge. If you're wondering whether MySQL is good for your needs, just ask. Ask the tough questions relevant to you. And then judge it on its suitability for the particular purpose, not by some arbitrary scale or feature set of another product, or even generic corporate policy. Those comparisons are "easy", but not relevant for your needs and they could cause you to pick the wrong tool for the job.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;At &lt;a href="http://openquery.com/"&gt;Open Query&lt;/a&gt; we do get asked about these things, and we explicitly recommend other products over MySQL when we feel it's most appropriate. We have an operational rule I've brought with me from long ago: &lt;em&gt;"I'd rather have a happy non-customer"&lt;/em&gt;. For instance, for serious GIS (geospatial) applications, PostGIS (PostgresSQL's GIS extensions) are far superior not just in the open source arena but also compared to the proprietary space. Horses for courses.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:151413</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/151413.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=151413"/>
    <title>Can I have your horror-stories, please? (SANs and VMs)</title>
    <published>2009-03-13T01:15:22Z</published>
    <updated>2009-03-13T01:18:02Z</updated>
    <category term="emergency"/>
    <category term="san"/>
    <category term="mysql"/>
    <category term="vm"/>
    <category term="failure"/>
    <category term="fail"/>
    <category term="disaster"/>
    <category term="spof"/>
    <content type="html">Please make it descriptive, graphic, and if anything burnt or exploded I'd love to have pictures.&lt;br /&gt;Include an approximate timeline of when things happened and when it was all working again (if ever).&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;This somewhat relates to the earlier post &lt;a href="http://arjen-lentz.livejournal.com/132978.html"&gt;A SAN is a single point-of-failure, too&lt;/a&gt;. Somehow people get into scenarios where highly virtualised environments with SANs get things like replication and everything, but it all runs on the same hardware and SAN backend. So if this admittedly very nice hardware fails (and it will!), the degree of "we're stuffed" is particularly high. The reliance in terms of business processes is possibly a key factor there, rather than purely technical issues.&lt;br /&gt;&lt;br /&gt;Anyway, if you have good stories of (distributed?) SAN and VM infra failure, please step up and tell all. It'll help prevent similar issues for others. Thanks. I'm not anti-SAN or anti-VM, but both need to be used when appropriate and in the proper context.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:151130</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/151130.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=151130"/>
    <title>ramtest86 hangs but it's not the RAM's fault!</title>
    <published>2009-03-12T05:16:35Z</published>
    <updated>2009-03-12T05:18:12Z</updated>
    <content type="html">I was using the ramtest86 from a Ubuntu Intrepid startup disk (32 and 64 bit CDs). It was a machine with RAM problems (IBM eServer x346), so I wasn't too surprised that ramtest86 hung during testing. Still, kinda annoying.&lt;br /&gt;I had another similar machine (I have them here for some MySQL related testing) that was known to be probably good (no things are certain ;-) and interestingly it hung there also.&lt;br /&gt;&lt;br /&gt;Using ramtest is just my "default" way of finding bad RAM, as it works on any box. But these IBM systems have a diagnostics mode which is essentially a flashrom-based PC-DOS with some basic drivers and a test tool. Cool!&lt;br /&gt;So I tried that, and it worked fine on the "good" box. And found problems in a specific DIMM on the "bad" box.&lt;br /&gt;Excellent. Progress!&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Oh and it's not realy that "cool" really since these boxes currently reside in my office, and apart form the noise from the hotswappable fans and disks, they are very good at heat generation. Let me remind you that it's currently summer in Australia, Brisbane is in the subtropics anyway, and my office does not have aircon. If it were winter, it could perhaps act as a decent heater! ;-)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Back to the story... it's now going through the other ram banks in the "bad" box, and then I can rip out the faulty ones. Nice. But the question is, why does ramtest86 hang?  These are dual Xeon 3 GHz boxes, in case you're not familiar with the x346. Anyone else familiar with this tool just hanging on certain boxes, or perhaps architectures?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:150929</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/150929.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=150929"/>
    <title>High Performance MySQL (2nd edition) book wins Jolt Productivity Award!</title>
    <published>2009-03-12T04:00:27Z</published>
    <updated>2009-03-12T04:00:27Z</updated>
    <content type="html">&lt;a href="http://news.prnewswire.com/DisplayReleaseContent.aspx?ACCT=104&amp;amp;STORY=/www/story/03-11-2009/0004987197&amp;amp;EDATE="&gt;TechWeb Announces Winners of the 19th Annual Jolt Product Excellence &amp; Productivity Awards&lt;/a&gt; - The 'Oscars' of Software Development Industry Honor Innovation and Technological Achievement. &lt;blockquote&gt;The winners of the 19th Jolt Product Excellence Awards and the recipients of the Jolt Productivity Awards are:&lt;br /&gt;[...]&lt;br /&gt;    2.  Technical Books&lt;br /&gt;[...]&lt;br /&gt;    Productivity Winners:&lt;br /&gt;          &lt;a href="http://www.amazon.com/gp/product/0596101716?ie=UTF8&amp;amp;tag=lentzinternet-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596101716"&gt;High Performance MySQL: Optimization, Backups, Replication, and More&lt;/a&gt;&lt;br /&gt;          by Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy Zawodny,&lt;br /&gt;          Arjen Lentz and Derek J. Balling (O'Reilly Media)&lt;br /&gt;[...]&lt;/blockquote&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:150770</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/150770.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=150770"/>
    <title>Migrating MySQL MyISAM apps to the InnoDB storage engine</title>
    <published>2009-03-12T01:47:45Z</published>
    <updated>2009-03-12T01:57:12Z</updated>
    <content type="html">Today, most of us professionally involved with MySQL deployments regard InnoDB as the default engine to use, although the server "default default" is still MyISAM and many (even new) deployments still end up on MyISAM. It used to be the case that InnoDB had advantages in terms of write-concurrency, crash recovery and consistency/durability as well as in some cases speed, however it uses more disk space and to perform adequately it requires at least more RAM. For deployments that didn't care for write-concurrency, MyISAM often remained the favourite. But most servers now have enough basic horsepower and sufficient RAM, and the disk-usage issue has also been addressed in the 5.1 InnoDB plugin with compressed pages. Disk use is often not the biggest issue though.&lt;br /&gt;&lt;br /&gt;So anyway, if you don't have &lt;code&gt;FULLTEXT&lt;/code&gt; indexes (use &lt;a href="http://sphinxsearch.com/"&gt;Sphinx&lt;/a&gt;!), can't you simple run &lt;code&gt;ALTER TABLE ... ENGINE=InnoDB&lt;/code&gt; on all your tables (or use the &lt;code&gt;mysql_convert_table_format&lt;/code&gt; script) and live on happily? Not quite...&lt;br /&gt;First of all you'll want to tune the InnoDB subsystem in terms of buffer pool, log file size, and some other aspects.&lt;br /&gt;But also, your application can encounter additional error situations when using InnoDB, which it must handle. In my previous post (&lt;a href="http://arjen-lentz.livejournal.com/150464.html"&gt;Error handling for MySQL applications&lt;/a&gt;) I already indicated that many apps just don't handle errors properly at all. Many errors are not fatal, and many are transient. That is, if you do the same command again, it'll generally succeed.&lt;br /&gt;&lt;br /&gt;InnoDB being transactional and using row-level locking, it's possible and entirely normal to encounter deadlocks. They are distinctly non-fatal, but do require appropriate handling. For a multi-statement transaction (i.e. more than one query, wrapped in a &lt;code&gt;BEGIN&lt;/code&gt; or &lt;code&gt;START TRANSACTION&lt;/code&gt; and &lt;code&gt;COMMIT&lt;/code&gt; construct), when you get one of the lock timeout errors or a deadlock error, you can simply &lt;code&gt;ROLLBACK&lt;/code&gt; and then re-run the whole transaction construct. This should not cause an endless loop, but re-running at least once is sensible.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;If you're not (yet) using InnoDB but just MyISAM, you're not in the clear though: regular lock timeouts can also occur with MyISAM, although problems are, in my experience, less common.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I'm always intrigued about the "why" of things, so in this case... why aren't MySQL application developers aware of these things? And I think I might be able to answer that question. Anyone with a background in using transactional database systems (Oracle, etc) has been taught to expert and deal with these things, so it'll be an intrinsic part of how they write code. Contrarily, MySQL's non-transactional origins and the fact that many MySQL application developers do not have a background in database engineering or other database systems, explains most of it.&lt;br /&gt;&lt;br /&gt;But it's also MyISAM being deadlock free by design, that has allowed MySQL app developers to be particularly lazy about these things, AND get away with it! MyISAM always locks specified tables in a particular order whereas InnoDB, with its row-level locking, can't control the flow of locking needs, and thus cannot guarantee to be deadlock free. It's not a flaw (or magic) on either side, it's just consequences and possibilities due to the capabilities of the engines and their resulting internal architecture (also covered by one of the &lt;a href="http://openquery.com/training/storage_engines"&gt;Open Query training day-modules&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;So, learning this and without needing to pass blame on MySQL, any particular engine, or developers, we can now get on with things and develop (and fix up!) applications to have appropriate logic, whichever engine might be used underneath. But most importantly, please remember that just converting an app from MyISAM to InnoDB &lt;em&gt;without&lt;/em&gt; checking up on the error handling is &lt;em&gt;not safe&lt;/em&gt;.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:150464</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/150464.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=150464"/>
    <title>Error handling for MySQL applications</title>
    <published>2009-03-12T01:12:52Z</published>
    <updated>2009-03-12T01:49:56Z</updated>
    <category term="1040"/>
    <category term="1046"/>
    <category term="mysql_errno"/>
    <category term="1614"/>
    <category term="2013"/>
    <category term="mysql error codes"/>
    <category term="mysql_error"/>
    <category term="1205"/>
    <content type="html">When connecting to MySQL, or executing a query, proper error handling is required. Many take this very seriously, and do a construct like &lt;code&gt;mysql_connect() or die()&lt;/code&gt; or the equivalent with &lt;code&gt;mysql_query()&lt;/code&gt;. For web apps this generally makes error codes end up on the user page, you can easily see this by doing a Google search for some of the common error texts. Slightly improved apps are nicer to the user and log the error separately.&lt;br /&gt;&lt;br /&gt;But both approaches fail, fundamentally, as they don't take into account that not all errors are the same and, most importantly, many error are not fatal but require other forms of action. So let's look at that, look at what causes the errors so you truly understand that it's not fatal stuff, and how you can handle them.&lt;br /&gt;&lt;br /&gt;When you get a "not successful" response back from a MySQL API function, you first need find out what the error is with &lt;code&gt;mysql_errno()&lt;/code&gt; (and mysql_error() for a corresponding text string, if you want to log it).&lt;br /&gt;&lt;br /&gt;&lt;em&gt;So when in the below I write about an API function returning an error, I don't mean that the function itself literally returns the error code... it'll return false (or whatever the appropriate return code for non-success is for that function) and you need to call &lt;code&gt;mysql_error()&lt;/code&gt; to retrieve the actual error code. Oki? Let's continue!&lt;/em&gt;&lt;ul&gt;&lt;li&gt;If &lt;code&gt;mysql_connect()&lt;/code&gt; to the local Unix socket comes up with OS &lt;em&gt;(operating system, the &amp;lt;1000 codes come from the OS not MySQL server as such)&lt;/em&gt; &lt;strong&gt;error code 11 (MySQL error text "Resource temporarily unavailable")&lt;/strong&gt; this is actually defined as EAGAIN in your operating system. That's quite descriptive actually and can be read as "failed now, but do try again".&lt;br /&gt;Typically you can get this error when the maximum # of connections has been reached. A possible cause can be that apps keep a connection open even if they don't need to use it for an extended period, or an app server doing persistent connections even though the infrastructure does not effectively manage them (Apache/PHP is the prime example there). MySQL has a very fast connection handshake so speed-wise persistent connections are not necessary.&lt;br /&gt;There are some things you can tune on the MySQL server end and some other things to look at on the application server end... I posted a &lt;a href="http://arjen-lentz.livejournal.com/39717.html"&gt;note about the PHP issue and solution&lt;/a&gt; 4 years back.&lt;li&gt;If the error code is &lt;strong&gt;1040 (Too many connections)&lt;/strong&gt; the situation is similar but you were trying to open a TCP/IP connection to the server. The handling is similar though. You will want to retry, but not keep on looping forever of course ;-)&lt;br /&gt;By the way, you can't just increase &lt;code&gt;max_connections&lt;/code&gt; in my.cnf as some buffers are allocated per-connection and thus particularly on 32-bit installations you could get into memory trouble.&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Error 1046&lt;/strong&gt; I'm tossing in here just to make the point about non-fatal-errors... it means &lt;strong&gt;"No database selected"&lt;/strong&gt; and indicates you simply forgot to do mysql_select_db() before running a query that doesn't explicitly specify the database for each table it uses.&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Error 2013 (Lost connection to MySQL server during query)&lt;/strong&gt; is actually a generated inside your client library, and if your environment is using the C client library then simply re-issuing the query will make the library reconnect as well. You can also reconnect explicitly and then re-run the query. Why does it happen?&lt;br /&gt;It could be a network error that caused the TCP/IP connection to drop, or the &lt;code&gt;wait_timeout&lt;/code&gt; was exceeded on the server; the latter can actually be useful in keeping the # of open connections down, but the app will then need to handle errorcode 2013 correctly!!&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Error 1213 (Deadlock found when trying to get lock; try restarting transaction)&lt;/strong&gt; can only occur when using InnoDB, since MyISAM is by its design deadlock-free. You just need to re-run the query. If it's a multi-statement transaction, the entire transaction should be re-run. (I'll clarify this in a separate blog post immediately after this one!)&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Error 1614 (Transaction branch was rolled back: deadlock was detected)&lt;/strong&gt; is XA (distributed transaction, two-phase commit) related, handling essentially the same as for 1213.&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Error 1205 (Lock wait timeout exceeded; try restarting transaction)&lt;/strong&gt; can occur with both InnoDB and MyISAM, and again simply reissuing the statement or transaction is the way to go (also see note below).&lt;/ul&gt;Next up a related post about deadlocks and lock wait timeouts in both MyISAM and InnoDB, and more specifically about some things to look out for when converting from MyISAM to InnoDB (&lt;a href="http://arjen-lentz.livejournal.com/150770.html"&gt;Migrating MySQL MyISAM apps to the InnoDB storage engine&lt;/a&gt;). Also, to be very clear, when I write about "re-run" or "re-issue" the query, I don't mean "create an endless loop". Normal coding sense applies.&lt;br /&gt;&lt;br /&gt;The error codes mentioned in this post are merely very common ones, there are more! For ref, see &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/error-handling.html"&gt;Errors, Error Codes, and Common Problems&lt;/a&gt; in MySQL's online reference manual.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:150065</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/150065.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=150065"/>
    <title>Safari 4 browser beta.... first impressions</title>
    <published>2009-03-06T03:31:50Z</published>
    <updated>2009-03-06T03:32:10Z</updated>
    <content type="html">On my MacBook, I use both Safari and Firefox anyway, so this is not a "browser switch" story... merely that Safari 4 beta is now available.&lt;br /&gt;&lt;br /&gt;It feels fast, and has some pretty interesting features... does take some getting used to, particularly having the tabs all the way at the top now. And the size of the tabs scales with the # present, which I find to be a nuisance; I prefer them to be a fixed size, this also keep the closing button [X] in a consistent position if you close multiple tabs. I'll work with it for some days.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:149930</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/149930.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=149930"/>
    <title>Do you have a fork stuck in your head?</title>
    <published>2009-03-06T00:20:36Z</published>
    <updated>2009-03-06T03:02:37Z</updated>
    <content type="html">This is actually a MySQL-related post, but I like odd analogies - stuff that makes you laugh tends to be remembered better!&lt;br /&gt;&lt;br /&gt;So to get back to the fork...  it's stuck in your head and you have a serious headache.&lt;br /&gt;You go to the doctor. Would you like the doctor to&lt;br /&gt; A) prescribe something for the headache, or&lt;br /&gt; B)  identify that the fork might be causing the headache, and suggest that it be removed?&lt;br /&gt;There may be other factors causing the headache, but leaving the fork there is probably a bad idea anyway, right?&lt;br /&gt;&lt;br /&gt;When someone asks me questions like "what's the maximum number of columns MySQL can have in a table", a little alarmbell goes off in my head (better than a fork, eh!), and I try to explore the "why" - much to some people's annoyance... they just want "the answer". But I do this because it's one of those anti-patterns, indicative of other issues. There are indeed valid reasons to require lots of columns, but not many.&lt;br /&gt;&lt;br /&gt;I have standards, and I apply them on Freenode #mysql IRC as well as with &lt;a href="http://openquery.com/"&gt;Open Query&lt;/a&gt; clients. I don't want to just help you "fix" your headache while leaving a fork in your bleeding head.&lt;br /&gt;Instead, I'd like to make sure there's no fork, first. Once you're aware of the issues in the anti-pattern, you can make an assessment (with or without assistance) whether the problem you were trying to address is actually the real problem, or whether you want to deal with any underlying issues.&lt;br /&gt;Am I an annoying doctor? ;-)</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:149720</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/149720.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=149720"/>
    <title>mysql_install_db, mysqld --bootstrap, binary log, cPanel</title>
    <published>2009-03-05T04:55:15Z</published>
    <updated>2009-03-05T12:24:30Z</updated>
    <category term="bootstrap"/>
    <category term="binlog"/>
    <category term="mysql"/>
    <category term="binary log"/>
    <category term="mysql_install_db"/>
    <category term="mysqld"/>
    <category term="cpanel"/>
    <content type="html">Warning... what follows is a murky mess.&lt;br /&gt;It's filed as &lt;a href="http://bugs.mysql.com/43398"&gt;MySQL bug#43398&lt;/a&gt; (verified!) but it's triggered by cPanel doing evil.&lt;br /&gt;&lt;br /&gt;Scenario....&lt;blockquote&gt;Start a mysql server, as normal&lt;br /&gt;Then run mysql_install_db (as root, like you would when you first install MySQL)&lt;br /&gt;See a new binlog file get created, with ownership/group root!&lt;/blockquote&gt;Of course you generally wouldn't run mysql_install_db while a server is running, but there's nothing to prevent you (or something else) from doing so!&lt;br /&gt;--bootstrap just shouldn't initialise binlog, then there wouldn't be a issue.&lt;br /&gt;&lt;br /&gt;cPanel runs mysql_install_db in its automatic upgrade scripts (dangerous already, automatically upgrading MySQL Server on a system!), it's run every night on cPanel systems even if no upgrade is done, and it behaves exactly as described above. It then chowns the binlog files to mysql:mysql which is of course a hack and not a fix, also there's still a brief moment where the new logfile has the wrong permissions, and mysqld may still encounter various race conditions by the mysql --bootstrap just adding a binlog file independently (as described in the bug report).&lt;br /&gt;&lt;br /&gt;Then some people filed a bug with cPanel about binlog files ending up as root when datadir is changed from the default, so cPanel added this:&lt;pre&gt;# temporary fix for non-standard mysql directory.

echo " "
echo -n "POSTUPCP: running temporary MySQL permissions fix: "
for dir in data import tmp logs ; do

if [ -d "/home/mysql/${dir}" ]; then
  chown -R mysql.mysql "/home/mysql/${dir}" &amp;&amp;gt;/dev/null
fi
done

echo "OK"
echo " "
# end temp fix&lt;/pre&gt;That's right, it's an additional hack to set the permissions right, but meanwhile the server is still running and doing its thing. The potential for race conditions is just ridiculous.&lt;br /&gt;&lt;br /&gt;Key take-away from this story... look, I'm not opposed to workarounds, but it's very important to understand what cause a particular symptom has. Then, a workaround may be "ok" within a specific context. But if the root cause is not understood (or not found at all) then applying workarounds like this is beyond dangerous.&lt;br /&gt;In this case it's in a commercial product that's deployed in thousands of managed server deployments. That's just freaky.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:149469</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/149469.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=149469"/>
    <title>grsecurity</title>
    <published>2009-03-05T03:25:14Z</published>
    <updated>2009-03-09T23:47:48Z</updated>
    <content type="html">Hint... don't install stuff like this on your production servers unless you have advanced Linux skills... &lt;a href="http://www.grsecurity.net/"&gt;http://www.grsecurity.net/&lt;/a&gt;&lt;br /&gt;It's custom kernel modifications. So any time you upgrade kernel, you need an update of this stuff as well. And never mind the potential bugs that in themselves can cause security and reliability issues.&lt;br /&gt;You don't "just" want to install any such package on a production server (MySQL or otherwise), unless you really really know what you're doing. It's just not a userspace kind of thing.&lt;br /&gt;&lt;br /&gt;Apparently it's something that some cPanel deployments install to further secure their system, but that comes to the fundamental question of whether you want to be running cPanel in serious production environments.... beef for another post, and I'll get to that shortly.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:149169</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/149169.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=149169"/>
    <title>OpenSolaris on an Eee PC?</title>
    <published>2009-03-04T07:47:29Z</published>
    <updated>2009-03-04T07:47:29Z</updated>
    <category term="solaris"/>
    <category term="sun"/>
    <category term="eeepc"/>
    <content type="html">No, I didn't do it, honestly! ;-)&lt;br /&gt;I just got an email from Sun (Open Query being a Partner and all) to participate in a survey, and this is the incentive prize. It's kinda funny, but also a bit indulgent. I really don't think that's where OpenSolaris shines, so why even go there... just to prove that it'll run in a tiny environment? Who cares? I mean, you'd usually run it on a nice 64bit multi-core machine with plenty of RAM and storage, right? Just like any other new server...&lt;br /&gt;&lt;br /&gt;I don't get it... perhaps someone else will offer a more plausible suggestion, but so far I'm guessing indulgence ;-)</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:148770</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/148770.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=148770"/>
    <title>Challenge: build a queue/IPC in standard MySQL without "polling"</title>
    <published>2009-03-01T13:21:20Z</published>
    <updated>2009-03-01T13:21:44Z</updated>
    <content type="html">Following scenario... you want to pass on some basic info to another task, through MySQL, and the other task can just wait for it - naturally you don't want to poll (keep issuing a query to see if there's anything new) as that's hideously inefficient even if you use the query cache.&lt;br /&gt;&lt;br /&gt;Rules: standard MySQL (no special storage engines); and stay within MySQL, no other tools.&lt;br /&gt;&lt;br /&gt;I have some thoughts on this, for instance using the behaviour of InnoDB with isolation levels and locking... can be engineered to either acquire a lock (after waiting for someone else to release) or timeout, where the timeout can be set so you don't have to poll all the time... but curious if anyone might have more nifty ideas!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:148551</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/148551.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=148551"/>
    <title>Open Query - job opportunities for MySQL and related skillsets</title>
    <published>2009-02-27T02:01:52Z</published>
    <updated>2009-02-27T02:03:01Z</updated>
    <content type="html">Economic downturn? Perhaps, our service offering and pricing is such that we've actually only seen an increase in demand, which is of course great! So, we're looking for additional skilled and enthusiastic co-workers.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://openquery.com/"&gt;Open Query&lt;/a&gt; is not structured like your typical company, and this is quite on purpose. Our funding, business structure and approach, human resources, decisions on offering and pricing, are all "a bit different" to jive with our thoughts on building a company that provides a range of excellent services, while also really looking at what customers actually need, and providing a healthy (literally) working environment for our people.&lt;br /&gt;&lt;br /&gt;One of our key aims is towards no-stress, both for ourselves as well as for our clients. You may figure stress and emergencies are an inevitable "fact of life", but we feel that that would be a wrong starting point. When instead we put our minds to creating no-stress solutions, we will at least end up with something low-stress rather than "same old".&lt;br /&gt;&lt;br /&gt;For our workers, we offer ongoing contracts for a guaranteed minimum of hours a month and an agreed maximum. So you can have more free time, or do other things. We pay decent rates so you may find that part-time is quite sufficient for your life needs! We fully expect "an honest day's work" but won't load you until you're run off your feet - and this contract structure guarantees that.&lt;br /&gt;&lt;br /&gt;Your principal place of work would be your home. That's not for everyone, but works well for many and is absolutely ideal for some - we have experience with this and can help you with ideas on how to arrange things.&lt;br /&gt;&lt;br /&gt;Most work is done remotely (you'll need a reliable ADSL connection, although I sometimes work from a cafe with a UMTS connection for my laptop - that's fine for some work, but not all), and for those tasks we really don't mind where you live. We have some strategic needs in terms of availability in certain ranges of timezones.&lt;br /&gt;&lt;br /&gt;If you are (also) interested in a trainer position, there are additional requirements in terms of experience and skill, as well as location. You would never be doing just training with us though, otherwise you'd a) lose touch with the real world and b) find plane seat 23B and hotel room 843 to be your primary residence, which we think neither of those things would be good.&lt;br /&gt;&lt;br /&gt;Did I get your attention, and you're not put off but rather intrigued and attracted by Open Query's operational "quirkyness"? Then I'd love to talk with you! For more details and contact info, see &lt;a href="http://openquery.com/company/jobs"&gt;http://openquery.com/company/jobs&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:arjen_lentz:148326</id>
    <link rel="alternate" type="text/html" href="http://arjen-lentz.livejournal.com/148326.html"/>
    <link rel="self" type="text/xml" href="http://arjen-lentz.livejournal.com/data/atom/?itemid=148326"/>
    <title>On Value and Cost - part 2 (failed loyalty scheme)</title>
    <published>2009-02-19T23:50:50Z</published>
    <updated>2009-02-19T23:53:16Z</updated>
    <content type="html">Some offerings are just a complete fail. I'll give you an example from my real world. Supermarket chains around here give out a voucher for a petrol discount when you spend more than $30 in one go. That's kinda smart, since petrol pricing is something people care about so it can drive changes in customer behaviour (to a point).&lt;br /&gt;Then one of the big chains has introduced a kind of loyalty card last year, whereby the discount gets linked to the card rather than getting printed on the receipt. Saves hassle with paper, but the real objective (like any loyalty card) is to better track customer behaviour by allowing the supermarket to link your purchases over time.&lt;br /&gt;&lt;br /&gt;The key fail is that you still only get the discount if you spend $30 in one go. Of course this is aimed to entice people to do fewer big shops rather than more smaller ones. But apart from the paper hassle, we've merely identified two benefits to the vendor, and nothing much for the customer. And it doesn't even work for the supermarket, because now people won't bother showing their card if they're spending less than $30, and thus their behaviour doesn't get tracked for those purchases. That's the thing you'd want to specifically track, if you'd like to get people to change their purchasing behaviour. And the discounts aren't sufficient to drive a change in behaviour, they still do ad-hoc shops. So it just doesn't work.&lt;br /&gt;&lt;br /&gt;What could help? Keeping the loyalty card concept, the supermarket could record points for every purchase, with a bonus number (or percentage) for bigger purchases. At a certain level of points, the customer gets their fuel discount. It's all automated through the cash registers anyway, so all that is easy enough to implement.&lt;br /&gt;&lt;br /&gt;But I haven't told you about the other fail, on the customer side. With the cards, people now can't easily tell whether there's a discount on their card, unless they login to some website to check (and remember yet another login and password). They used to at least have their discount voucher, which you handed over when you pay for the petrol.&lt;br /&gt;&lt;br /&gt;If you don't show your card now you still get your voucher (although no special offers that only apply if you show the card but again are only valid if the purchase is greater than $30), and if that were scrapped I'm sure that people would still use the card when doing bigger purchases just to not lose out on the discounts. That doesn't mean it's a good system though. It sucks on all sides as it pretty much fails all its objectives.</content>
  </entry>
</feed>
