tag:blogger.com,1999:blog-169599462008-07-25T01:40:42.820+02:00The Data Charmergmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comBlogger203125tag:blogger.com,1999:blog-16959946.post-79669774828767940652008-07-25T01:31:00.004+02:002008-07-25T01:40:42.985+02:00OSCON 2008 - MySQL Proxy - from architecture to implementation<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_gVfZHGgf5LA/SIkR55xjxUI/AAAAAAAAAMk/E9CCbULS5HA/s1600-h/Picture+15.png"><img style="cursor: pointer;" src="http://bp1.blogger.com/_gVfZHGgf5LA/SIkR55xjxUI/AAAAAAAAAMk/E9CCbULS5HA/s400/Picture+15.png" alt="" id="BLOGGER_PHOTO_ID_5226728528999073090" border="0" /></a><br />The presentation about MySQL Proxy at OSCON 2008 is over.<br /><br />Here are the <a href="http://datacharmer.org/presentations/oscon2008/mysql_proxy_oscon_2008a.pdf">slides</a>.<br /><br />Thanks to my co-presenter Ronald Bradford and to all the participants. If you have more questions about the session, please use this blog's comments.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-62373052614962752022008-07-21T13:30:00.000+02:002008-07-21T15:03:19.893+02:00Some quirks of circular and row-based replicationOne of the new features introduced by MySQL 5.1 is row-based replication.<br /><br />Unlike the classic statement-based replication, used in MySQL up to version 5.0, row-based replication transfers the data instead of the statement used to create it.<br /><br />If you want to have a taste of row-based replication, you can do some experiments with MySQL Sandbox.<br /><br />First, we create a sandbox of circular replication with MySQL 5.0<br /><br /><pre><code>./make_replication_sandbox --topology=circular --how_many_nodes=3 \<br />/path/to/mysql-5.0.51a-YOUR_OS.tar.gz<br /><br />cd $HOME/sandboxes/rcsandbox_5.0.51<br />./n1 -e "create table test.t1(i int)"<br />./n3 -e "insert into test.t1 values (@@server_id)"<br />./use_all "select * from test.t1"<br /># server: 1:<br />i<br />101<br /># server: 2:<br />i<br />102<br /># server: 3:<br />i<br />103<br /></code></pre><br />This is statement-based replication at its best.<br /><br />A look at the binary log confirms that this is the case.<br /><br /><pre><code> $ ./node3/my sqlbinlog node3/data/mysql-bin.000001 |tail<br />#080720 8:57:59 server id 103 end_log_pos 1958 Query thread_id=8 exec_time=0 error_code=0<br />SET TIMESTAMP=1216569479/*!*/;<br />SET @@session.auto_increment_increment=3, @@session.auto_increment_offset=3/*!*/;<br />insert into test.t1 values (@@server_id)/*!*/;<br /></code></pre><br />It may be desirable to preserve the different variables in every slave, and I know of a few schemes where it is useful, but in most cases a user wants the data on master and slaves to be always the same (think of backup slaves, for instances), and therefore the statement-based replication should be considered faulty in this respect.<br /><br />Let's do the same experiment with the latest 5.1<br /><br /><pre><code>./make_replication_sandbox --topology=circular --how_many_nodes=3 \<br />/path/to/mysql-5.1.26-rc-YOUR_OS.tar.gz<br /><br />cd $HOME/sandboxes/rcsandbox_5.0.51<br />./n1 -e "create table test.t1(i int)"<br />./n3 -e "insert into test.t1 values (@@server_id)"<br />./use_all "select * from test.t1"<br /># server: 1:<br />i<br />103<br /># server: 2:<br />i<br />103<br /># server: 3:<br />i<br />103<br /></code></pre><br />Now, that's different. We can see row-based replication in action. And we can see that the binary log looks a lot different.<br /><br /><pre><code> $ ./node3/my sqlbinlog node3/data/mysql-bin.000001 |tail<br />#080720 9:05:00 server id 103 end_log_pos 3247 Query thread_id=25 exec_time=0 error_code=0<br />SET TIMESTAMP=1216569900/*!*/;<br />SET @@session.auto_increment_increment=3, @@session.auto_increment_offset=3/*!*/;<br />BEGIN<br />/*!*/;<br /># at 3247<br /># at 3288<br />#080720 9:05:00 server id 103 end_log_pos 3288 Table_map: `test`.`t1` mapped to number 19<br />#080720 9:05:00 server id 103 end_log_pos 3322 Write_rows: table id 19 flags: STMT_END_F<br /><br />BINLOG '<br />LGKDSBNnAAAAKQAAANgMAAAAABMAAAAAAAAABHRlc3QAAnQxAAEDAAE=<br />LGKDSBdnAAAAIgAAAPoMAAAQABMAAAAAAAEAAf/+ZwAAAA==<br />'/*!*/;<br /># at 3322<br />#080720 9:05:00 server id 103 end_log_pos 3392 Query thread_id=25 exec_time=0 error_code=0<br />SET TIMESTAMP=1216569900/*!*/;<br />COMMIT<br /></code></pre><br />So far, all is as expected (if you have been keeping up with the documentation, of course). The default <em>binlog_format</em> in MySQL 5.1 is <em>mixed</em>, meaning that the server will use statement-based as much as possible, switching to row-based when there is the risk of incorrect replication, like in this case.<br /><br />Users can change <em>binlog_format</em> at will, thus influencing how replication is performed. However, in the case of circular replication, you must be extra careful, because you don't have control on how the other nodes are behaving.<br /><br />For example.<br /><br /><pre><code>$ ./n1 -e "truncate test.t1"<br />$ ./n3 -e "set binlog_format='statement';insert into test.t1 values (@@server_id)"<br />$ ./use_all "select * from test.t1"<br /># server: 1:<br />i<br />101<br /># server: 2:<br />i<br />101<br /># server: 3:<br />i<br />103<br /></code></pre><br /><span class="caps">WTF</span>? Why server 1 and server 3 have inserted their corresponding server ids, and server 2 has not?<br /><br />Let's do some debugging.<br /><ol><li>Server 3 inserts @@server_id with statement-based replication, overriding the defaults.</li><li>Server 3's slave, server 1, executes the statement. But its default <em>binlog_format</em> is still "row", not "statement". </li><li>Server 2, slave of server 1, receives a row-based chunk from the binary log, and therefore inserts the value of its master, because the statement was not passed along.</li></ol>Using row-based format explicitly would not cause any side effect.<br /><pre><code><br />$ ./n1 -e "truncate test.t1"<br />$ ./n3 -e "set binlog_format='row';insert into test.t1 values (@@server_id)"<br />$ ./use_all "select * from test.t1"<br /># server: 1:<br />i<br />103<br /># server: 2:<br />i<br />103<br /># server: 3:<br />i<br />103<br /></code></pre>Looking for really useful uses of row-based replication, we can experience the greatest advantage (compared to statement-based) when inserting the result of an expensive calculation. Let's try. First of all, we force row-based replication on all nodes permanently.<br /><br /><pre><code>$ ./use_all 'set global binlog_format="row"'<br /></code></pre>Then we execute an expensive query, and see the results.<br /><pre><code>$ ./n3 -e "insert into test.t1 select count(*) from information_schema.columns"<br />$ ./use_all "show global status like 'opened_tables' "<br /># server: 1:<br />Variable_name Value<br />Opened_tables 17<br /># server: 2:<br />Variable_name Value<br />Opened_tables 17<br /># server: 3:<br />Variable_name Value<br />Opened_tables 41<br /></code></pre>If you know how information_schema works in MySQL, you know that if you want to get statistics on the number of columns, the server has to open all the tables and count them. Server 3 has done exactly that, and the number of opened tables is more than double than its fellows servers.<br /><br />This is a useful operation to perform when you know that the master is inserting the result of an expensive calculation, and you don't want to delay the slaves.<br /><br />Switching to row-based replication permanently would be a mistake, though. Consider a simple update like this one:<br /><br /><pre><code>UPDATE huge_table set some_column = 'some value' where some_other_column = 'X';<br /></code></pre><br />This would be relatively inexpensive in statement-based replication. If the table has 200 columns, though, using row-based format your binary log will pass the whole record to the slaves.<br />Used with care, row-based replication can deliver good results.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-61943755189971707492008-07-09T12:29:00.004+02:002008-07-09T12:55:02.643+02:00Proxy webinar - slides, script, FAQWe did it. <a href="http://www.mysql.com/news-and-events/web-seminars/display-159.html">Designing Scalable Architectures with MySQL Proxy</a> was delivered successfully, with over 150 attendees.<br />There is a large number of questions that were asked during the session, and you can find them in <a href="http://forge.mysql.com/wiki/MySQL_Proxy_FAQ">MySQL Proxy FAQ</a>.<br />The slides, with the highly entertaining images used by John Loehrer to illustrate his point are also <a href="http://datacharmer.org/presentations/webinar_proxy_jul2008/mysql_proxy_scalable_arch.pdf">online</a><br />Finally, John posted his <a href="http://forge.mysql.com/tools/tool.php?id=151">Connection pooler Lua script</a> in the Forge.<br />Thanks to John Loehrer for his lively presentation, to Jimmy Guerrero and Rich Taylor for organizing the event, to Jan Kneschke, for answering questions online while we were talking, and to all the attendees, for showing such degree of interest.<br />And don't forget that there is still a <a href="http://dev.mysql.com/tech-resources/quickpolls/">quick poll on the future of MySQL Proxy</a> that you can still vote on.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-87501368216845227742008-07-08T06:30:00.001+02:002008-07-08T06:30:00.940+02:00Shaping the future of MySQL Proxy<table border="0"><tr><td><br />Here is a chance for all users to influence the future development of <a href="http://forge.mysql.com/wiki/MySQL_Proxy">MySQL Proxy</a>. <br />If you care about Proxy, you may want to check the <a href="http://dev.mysql.com/tech-resources/quickpolls/">current quickpoll</a> in the Dev Zone, and vote for your favorite features.<br />The developers have a truckload of ideas, of course, but only a finite amount of time. So they can't develop all the features at once. They must start somewhere, and your vote can help them decide which ones should get higher priority.<br /></td><td><br /><img src="http://lh4.ggpht.com/g.maxia/RpZts7D6I3I/AAAAAAAAAA8/sTc-nvt-GNo/mysql_proxy.jpg" width="300" ></td></tr></table><br />In the meantime, don't forget the incoming webinar on <a href="http://www.mysql.com/news-and-events/web-seminars/display-159.html">Designing Scalable Architectures with MySQL Proxy</a>. It's TODAY (tomorrow for some, depending on your time zone), July 8, 2008 at 10am PDT, 1pm EDT, 7pm CEST.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-72712519838083275192008-07-07T20:15:00.005+02:002008-07-07T21:33:59.628+02:00Even faster online backup!<table border="0"><tr><td><a href="http://www.flickr.com/photos/datacharmer/2280764097/in/set-72157603952143770/"><img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_gVfZHGgf5LA/SHJdebLFATI/AAAAAAAAAMc/9vc_RCC6HPk/s400/big_lizard.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5220337695347507506" /></a></td><td><br />I discussed <a href="http://datacharmer.blogspot.com/2008/07/faster-online-backup-with-myisam-driver.html">my findings</a> with Guilhem Bichot, one of the online backup creators, and he remarks:<br /><blockquote> You could also try<br /><pre><code>export MYISAM_BACKUP_NO_INDEX=1</code></pre><br />before starting mysqld. It should not backup index (and rebuild them at repair time). Should make a smaller backup and a longer restore.</blockquote><br />I am not really looking for a longer restore, but let's give it a try. I restarted the database with the suggested option, and here is what I got:<br /></td></tr></table><br /><pre><code><br />backup database employees to 'emp2.bkp';<br />+-----------+<br />| backup_id |<br />+-----------+<br />| 4 | <br />+-----------+<br />1 row in set (3.18 sec)<br /><br />drop schema employees;<br />Query OK, 10 rows affected (0.02 sec)<br /><br />restore from 'emp2.bkp';<br />+-----------+<br />| backup_id |<br />+-----------+<br />| 5 | <br />+-----------+<br />1 row in set (18.33 sec)<br /></code></pre><br />The backup is definitely faster, and the restore is slower than the 11 seconds I got with the previous test. However, it's much faster than the standard restore!<br />Moreover, the backup file is barely 70 MB. That's an excellent compromise. Perhaps it won't be that fast with a several GB of data, but for now, it looks very good.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-28576495160106853862008-07-07T14:30:00.003+02:002008-07-07T15:53:09.064+02:00Faster online backup with MyISAM driver<a href="http://www.flickr.com/photos/datacharmer/2280764779/" title="Sydney Wildlife Centre by datacharmer, on Flickr"><img src="http://farm4.static.flickr.com/3215/2280764779_1dfab9829e.jpg" alt="Sydney Wildlife Centre" width="400" /></a><br />Remember the <a href="http://datacharmer.blogspot.com/2008/05/test-driving-free-and-open-online.html">first test of online backup</a>? I tested the new feature, which was performing quite well, compared to mysqldump. OK. Get ready for a surprise.<br />I tested the native <a href="http://forge.mysql.com/wiki/OnlineBackup">MyISAM driver</a> from the <a href="https://code.launchpad.net/mysql-server">mysql-6.0-backup tree</a>, and I compared the results with the normal backup.<br /><table border="1"><tbody><tr><th>version</th><th>backup time</th><th>restore time</th></tr><tr><td>standard</td><td align="right">25.58</td><td align="right">79.11</td></tr><tr><td>MyISAM driver</td><td align="right"><b>4.15</b></td><td align="right"><b>11.53</b></td></tr></tbody></table><br />Please be amazed!<br />The difference is also visible from the metadata. The standard version says:<br /><pre><code>select * from mysql.online_backup\G<br />*************************** 1. row ***************************<br /> backup_id: 1<br /> process_id: 0<br /> binlog_pos: 0<br /> binlog_file: NULL<br /> backup_state: complete<br /> operation: backup<br /> error_num: 0<br /> num_objects: 8<br /> total_bytes: 69970045<br />validity_point_time: 2008-07-07 11:39:04<br /> start_time: 2008-07-07 11:38:39<br /> stop_time: 2008-07-07 11:39:04<br />host_or_server_name: localhost<br /> username: msandbox<br /> backup_file: emp.bkp<br /> user_comment:<br /> command: backup database employees to 'emp.bkp'<br /> engines: Default, Snapshot<br /></code></pre>And the native driver version says:<br /><pre><code>select * from mysql.online_backup\G<br />*************************** 1. row ***************************<br /> backup_id: 1<br /> process_id: 0<br /> binlog_pos: 0<br /> binlog_file: NULL<br /> backup_state: complete<br /> operation: backup<br /> error_num: 0<br /> num_objects: 8<br /> total_bytes: 335531054<br />validity_point_time: 2008-07-07 11:32:04<br /> start_time: 2008-07-07 11:32:00<br /> stop_time: 2008-07-07 11:32:04<br />host_or_server_name: localhost<br /> username: msandbox<br /> backup_file: emp.bkp<br /> user_comment:<br /> command: backup database employees to 'emp.bkp'<br /> engines: Snapshot, MyISAM<br /></code></pre>Doesn't it just make you want to rush to download the code at once?<br />The information about total_bytes is somehow puzzling. The size of the backup file is actually 89 MB for the standard version and 160 MB for the MyISAM driver. Thus, you pay a faster backup and restore with a bigger file. Personally, I can live with that.<br /><br /><br /><small><i>As you may suspect, the picture does not have any relationship with backup, but it's cute, isn't it?</i></small>gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-864881911369088942008-07-02T23:30:00.001+02:002008-07-03T10:53:57.896+02:00MySQL Sandbox 2.0 has been released<table border="0"><tbody><tr><td><a href="https://launchpad.net/mysql-sandbox"><img src="http://lh5.ggpht.com/g.maxia/SGvwmKP96jI/AAAAAAAAAMU/vkuL3g7BVYM/DolphinSandbox_2_0_300x255.jpg" title="MySQL Sandbox" /><br /></a></td><td><br />Taking advantage of <a href="https://blueprints.launchpad.net/mysql-sandbox/+spec/release-sandbox-2-0/+deptree">Launchpad</a> excellent development services, I completed the tasks necessary to release <a href="https://launchpad.net/mysql-sandbox">MySQL Sandbox 2.0</a>.<br />So, you may ask, what's new? Quite a lot, actually:<br /><ul><li>more intuitive script names</li><li>master sandbox directory</li><li>faster</li><li>supports circular replication</li><li>more error checking</li><li>includes a test suite</li><li>uses a default options file</li></ul></td></tr></tbody></table><br /><h3>more intuitive script names</h3><br />One of the problem in the old sandbox was that the names of the scripts suggested some installation of the sandbox itself. This has been addressed in version 2.0. You now have the very clear names:<br /><pre><code> make_sandbox creates a single sandbox<br />make_replication_sandbox creates a replication sandbox<br />make_multiple_sandbox creates sandbox containing many servers<br /> of the same version<br />make_multiple_custom_sandbox creates a sandbox containing many servers<br /> of different versions</code></pre><h3>master sandbox directory</h3>By default, MySQL Sandbox will create a directory under your home, named "sandboxes", and all sandboxes will be created under that directory. In addition of making your sandboxes more organized, the master directory provides some handy scripts to deal with many sandboxes at once. You can start, stop, or send a SQL command to all the sandboxes with just one command.<br /><h3>faster</h3>The Sandbox had a few "sleep" instructions, to wait for the server being installed to come online. This solution was slowing down fast machines, where the server can start much faster than the standard 3 seconds I added to the sandbox, but was sometimes not enough for slower machines, where the server may take more than 3 seconds to start up, especially with replication. The new sandbox uses a loop coupled with a timeout limit. Thus, quick machines are faster, and slow machines don't fail.<br /><h3>supports circular replication</h3>Now you can create a replication ring.<br /><pre><code>./make_replication_sandbox --topology=circular --how_many_nodes=5 VERSION<br /># or<br />./make_replication_sandbox --master_master VERSION<br /></code></pre><h3>includes a test suite</h3>If you have resources and MySQL binary tarballs at your disposal, you can stress test MySQL Sandbox (and your box!) with this test suite. For example, assuming that your 5.0.51 and 5.1.25 binaries are in $HOME/opt/mysql<br /><pre><code>./test/test_sandbox.pl --versions=5.1.51,5.1.25<br /></code></pre>This will create 22 sandboxes<br /><h3>more error checking</h3>This is a direct consequence of the above item. Having a test suite has made the sandbox much more robust.<br /><h3>uses a default options file</h3>There is also a default option file, where you can keep the options that you need to be executed always.<br /><h3>Try it!</h3><br />Go get the 2.0 tarball from <a href="https://launchpad.net/mysql-sandbox">launchpad</a>. If you find any bugs, there is a very convenient <a href="https://bugs.launchpad.net/mysql-sandbox">bugs reporting system</a>. Please use it!gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-55295855988109018092008-07-02T14:23:00.003+02:002008-07-02T14:40:01.075+02:00OSCON 2008 - Getting in touch with the open source makers<table border="0"><tr><td>For some reasons, I have never been able to attend <a href="http://conferences.oreilly.com/oscon">OSCON</a> so far. I have been going to the MySQL Users Conference almost every year in April, and that usually left me without a great desire of crossing the Atlantic again. This year is different. I have crossed the Atlantic already three times, and yet I am about to board a plane once more, heading for the Portland, Oregon.<br /></td><td><a href="http://conferences.oreilly.com/oscon"><br /><img src="http://conferences.oreillynet.com/banners/oscon/speaker/oscon2008_banner_speaker_125x125.gif" width="125" height="125" border="0" alt="OSCON 2008" title="OSCON 2008" /></a></td></tr></table><br />And for some lucky circumstances, I am also a speaker.<br />I will join <a href="http://ronaldbradford.com/about.htm">Ronald Bradford</a> on the podium, to speak about (surprise surprise!) <a href="http://en.oreilly.com/oscon2008/public/schedule/detail/2915">MySQL Proxy, from architecture to implementation</a>.<br />I will have also my hands full in the evenings. There will be plenty of <a href="http://en.oreilly.com/oscon2008/public/schedule/stype/bof">BoFs</a> (including two that I will host) and parties, social gatherings, competitions, which I plan to enjoy for my personal enlightenment, not only to fulfill my duties. <br />I am looking forward to meet old friends and to make new ones.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-37378359270487338422008-07-01T00:37:00.006+02:002008-07-01T00:54:33.949+02:00Looking back at the first half year<table border="0"><tr><td><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_gVfZHGgf5LA/SGljuAvrbVI/AAAAAAAAALI/8JJ-agX2fKM/s1600-h/Sakila_writer_256x243.jpg"><img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_gVfZHGgf5LA/SGljuAvrbVI/AAAAAAAAALI/8JJ-agX2fKM/s400/Sakila_writer_256x243.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5217811285410540882" /></a></td><td><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_gVfZHGgf5LA/SGlhs_11UwI/AAAAAAAAAK4/BmApNB0-hVI/s1600-h/posts.png"><img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_gVfZHGgf5LA/SGlhs_11UwI/AAAAAAAAAK4/BmApNB0-hVI/s400/posts.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217809068964795138" /></a></tr></table><br />Half a year has gone, most of it with my new company, Sun Microsystems.Kaj has made a detailed <a href="http://blogs.mysql.com/kaj/2008/06/30/kajs-digest-blog-for-january-to-june-2008/">digest</a> of his first half.<br />I took the DBA approach and queried the Planet MySQL database. I know that this qualifies as cheating, but I could not resist.<br />I published a total of 111 blog posts since January, with peaks in March and April (the users conference was coming).<br />I wrot about most everything, but some topics are prominent. Users Conference and MySQL proxy are the winners. All in all, I would say that I have fairly distributed my topics.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_gVfZHGgf5LA/SGlia8zqdGI/AAAAAAAAALA/LLzOkfsvaUU/s1600-h/topics.png"><img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_gVfZHGgf5LA/SGlia8zqdGI/AAAAAAAAALA/LLzOkfsvaUU/s400/topics.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5217809858424370274" /></a>gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-89182208189092759642008-06-25T22:40:00.001+02:002008-06-25T23:24:22.838+02:00Scalable architectures with MySQL ProxyMySQL community, mark your calendars!. On July 8th, 2008, there is a Webinar on <a href="http://www.mysql.com/news-and-events/web-seminars/display-159.html">Designing scalable architectures with MySQL Proxy</a>.<br />This is not the usual marketing sponsored webinar. Although we love to show off, this is not a "look-how-good-we-are" presentation. This is a community driven event, where a community member, using only MySQL Proxy and some creativity, solved his production problems.<br /><a href="http://www.mysql.com/news-and-events/web-seminars/display-159.html"><img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_gVfZHGgf5LA/SGK2LQTanxI/AAAAAAAAAKw/r6XZPPkPn1w/s400/scaling_proxy.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5215931622919675666" /></a><br />This is a real story of a community member who used open source software to build a customized scalable architecture to suit his purposes. Isn't it a good story?<br />I won't steal his thunder and tell you in advance what was the problem about. I will introduce the general concepts about Proxy, and then our guest John Loehrer will tell hist story in full colors.<br />Don't miss this one!gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-35873310294690517842008-06-20T09:55:00.003+02:002008-06-20T10:17:03.667+02:00MySQL Sandbox - planning for 2.0Taking advantage of Launchpad environment, I started paving the way for version 2.0 of <a href="https://launchpad.net/mysql-sandbox">MySQL Sandbox</a>.<br />I opened a new <a href="https://code.launchpad.net/%7Egiuseppe-maxia/mysql-sandbox/mysqlsandbox2"> branch for version 2.0</a>, which currently holds 1.99.1, and I listed the necessary tasks using the built-in <a href="https://blueprints.launchpad.net/mysql-sandbox">blueprints</a> feature.<br /><a href="http://launchpad.net/sandbox"><img style="cursor: pointer;" src="http://bp2.blogger.com/_gVfZHGgf5LA/SFTyIdzLZ5I/AAAAAAAAAKg/gNf5OVMSHDk/s400/Sakila_sandbox_479x396_white_bg.png" title="MySQL Sandbox" alt="MySQL Sandbox" id="BLOGGER_PHOTO_ID_5212056896026666898" border="0" width="150" /></a><br />So now I have a list of tasks to keep track of the development.<br /><ul><li>implement test suite (have a good prototype - I am getting to it)</li><li>replace sleep with check loop (thinking - some analysis required)</li><li>create function library (good progress)</li><li>script to kill unresponsive servers (good progress)</li><li>remote sandbox installer (thinking - hard to implement without being intrusive)</li><li>allow url for tarball (thinking - needs external components)</li><li>define circular replication (thinking - easily doable)</li><li>refactoring for internationalization (thinking - easily doable - long task)</li></ul>The above features should all go to version 2, although the list is still open. No feature freeze has been called. It's still alpha.<br />I am unsure about the remote installer. I have implemented such a feature a few years ago, and it turned out to be quite intrusive (the choice was between being intrusive and fragile). I may consider making it a plugin or moving it to a later version. Still thinking.<br /><br />The development model is open. If you use the Sandbox and want to submit a patch or have comments on its development plans, please contribute!gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-51511214410559873882008-06-19T15:30:00.002+02:002008-06-20T08:27:29.445+02:00From Bazaar to Sandbox in 5 moves<a href="http://bp1.blogger.com/_gVfZHGgf5LA/SFomC4vydhI/AAAAAAAAAKo/LHsNR4dEcaM/s1600-h/mysql_bazaar.png"><img style="cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_gVfZHGgf5LA/SFomC4vydhI/AAAAAAAAAKo/LHsNR4dEcaM/s400/mysql_bazaar.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5213521349669189138" /></a><br />Now that MySQL <a href="http://blogs.mysql.com/kaj/2008/06/19/version-control-thanks-bitkeeper-welcome-bazaar/">has switched its development</a> to <a href="http://launchpad.net/projects/bazaar">Bazaar</a>, we can play a bit with the new tools. One thing that I have tried immediately upon adoption of the new <span class="caps">RCS </span>is to create a test bench for multiple MySQL versions by combining Bazaar and <a href="http://launchpad.net/mysql-sandbox">MySQL Sandbox</a>.<br /><br />If you are into bleeding edge testing, you may like to know how to get a new MySQL server up and running in a sandbox from a source tree.<br /><h2>First move - make the repository</h2>This is a zero time consuming move, and you will have to do this only once. But this move will save you heaps of time in future. By creating a shared repository, you are telling Bazaar to avoid redundant copies of files (actually Bazaar is much smarter than this, but as a simple explanation it will do).<br /><pre><code>$ bzr init-repo shared<br />$ cd shared/<br /></code></pre><h2>Second move - get the source</h2>Now we're ready to get the first copy of our source. The first branch we get is the current tree, 5.1. Depending on the speed of your network connection, it will take between 20 and 40 minutes.<br /><pre><code>$ time bzr branch lp:mysql-server/5.1 51<br /></code></pre><em>lp</em> stands for <a href="http://launchpad.net/">launchpad</a>. <em>mysql-server</em> is the project name, and <em>5.1</em> is the version. <em>51</em> is the directory we are creating on the local disk. You can call it whatever you want. I prefer short names.<br /><br />This operation may be tricky. The current Bazaar client (1.5) is not verbose. It may actually appear to be doing nothing for very long time. It is actually importing code. Don't be discouraged and bear with me on this. It will pay off in the end. After a while you will see a progress bar and eventually it will display the result.<br /><pre><code>Branched 2655 revision(s). <br /></code></pre> <pre><code>real 19m14.110s<br />user 7m22.883s<br />sys 1m21.372s<br /></code></pre>In my laptop, it took less than 20 minutes, but it could be much slower, depending on connection type and intensity of net traffic.<br /><br />Let's have a look at the size of what we have downloaded. The hidden directory <em>.bzr</em> contains the biggest chunk.<br /><pre><code>$ du -sh .bzr/ */<br />498M .bzr/<br />129M 51/<br /></code></pre>Now for the juicy part. We want to branch also MySQL 5.0. You may be ready for yet another 20 minutes and 600 more MB of data to be added, but you are in for a good surprise:<br /><pre><code>$ time bzr branch lp:mysql-server/5.0 50<br />Branched 2634 revision(s). <br /></code></pre><pre><code>real 0m42.205s<br />user 0m28.100s<br />sys 0m4.757s<br /></code></pre><strong>Less than one minute!</strong> And what about storage?<br /><pre><code>$ du -sh .bzr/ */<br />498M .bzr/<br />100M 50/<br />129M 51/<br /></code></pre>As you see, the new code added just the difference between 5.1 and 5.0, so it did not even had to get it from the net because it mostly got the previous version from the internal history (we'll come back to this point in a later post). <br />A similar experience awaits you when branching the newest version, 6.0. A bit slower than 5.0 (because it has to get something more from the net), but still quite fast compared to the full tree we got in the first run.<br /><pre><code>$ time bzr branch lp:mysql-server/6.0 60<br />Branched 2664 revision(s). <br /></code></pre><pre><code>real 4m45.383s<br />user 1m39.727s<br />sys 0m20.776s<br /></code></pre><pre><code>$ du -sh .bzr/ */<br />566M .bzr/<br />100M 50/<br />129M 51/<br />146M 60/<br /></code></pre><h2>Third move - export the code</h2>We have now on disk the code for three versions. We could just go inside each directory and build it, but that would not be clean. So in this move we just export the code to a build directory that we create for this task.<br /><pre><code>$ mkdir ~/install/build<br /></code></pre><pre><code>$ ls<br />50 51 60<br /></code></pre>Using a shell loop, we export each tree to a build directory. It takes about 30 seconds for each tree.<br /><pre><code>$ for R in 50 51 60 ; do echo $R ; cd $R ; bzr export ~/install/build/$R ; cd .. ; done<br />50<br />51<br />60<br /></code></pre><h2> Fourth move - build the code</h2>We are finally ready to build. Each build can take quite long, depending on your box. In my laptop, it takes about 40 minutes per build.<br /><br />In the ./BUILD directory in each source tree there are several building scripts. Choose the one that suits your purposes, eventually disabling the parts that you don't need (e.g. cluster).<br /><pre><code>$ cd ~/install/build<br /></code></pre><pre><code>$ for R in 50 51 60 ; do \<br /> cd $R ; \<br /> ./BUILD/your_favorite_script && ./scripts/make_binary_distribution ; \<br /> cd .. ; \<br /> done<br /></code></pre>After each build, this loop runs make_binary_distribution, which creates a binary tarball, right what you need for MySQL Sandbox.<br /><h2>Fifth move - sandbox it!</h2>Now, let's use our favorite installation tool to use these new binaries.<br /><br />Download the <a href="http://launchpad.net/mysql-sandbox">sandbox</a>. Make sure that you got at least version 1.21.<br /><pre><code>$ export SANDBOX_HOME=$HOME/sandboxes<br />$ cd ~/install/mysql_sandbox-1.21<br /></code></pre>For each version, you invoke the sandbox installer as<br /><pre><code>./express_install full/path/to/tarball_name.tar.gz<br /></code></pre>Here we go<br /><pre><code>$ ./express_install.pl ~/install/build/50/mysql-5.0.66-darwin9.3.0-i386.tar.gz<br />unpacking /Users/gmax/install/build/50/mysql-5.0.66-darwin9.3.0-i386.tar.gz<br />Executing ./install.pl --basedir=/Users/gmax/install/build/50/5.0.66 \<br /> --sandbox_directory=msb_5_0_66 \<br /> --install_version=5.0 \<br /> --sandbox_port=5066 \<br /> --no_ver_after_name<br /> The MySQL Sandbox, version 1.21 09-Jun-2008<br /> (C) 2006,2007,2008 Giuseppe Maxia, MySQL AB<br />installing with the following parameters:<br />home_directory = /Users/gmax/sandboxes<br />sandbox_directory = msb_5_0_66<br />sandbox_port = 5066<br />datadir_from = script<br />install_version = 5.0<br />basedir = /Users/gmax/install/build/50/5.0.66<br />[...]<br />loading grants<br />sandbox server started<br />installation options saved to current_options.conf.<br />To repeat this installation with the same options,<br />use ./install.pl --conf_file=current_options.conf<br />----------------------------------------<br />Your sandbox server was installed in /Users/gmax/sandboxes/msb_5_0_66<br /></code></pre><pre><code><br />$ ./express_install.pl ~/install/build/51/mysql-5.1.26-rc-darwin9.3.0-i386.tar.gz<br />unpacking /Users/gmax/install/build/51/mysql-5.1.26-rc-darwin9.3.0-i386.tar.gz<br />Executing ./install.pl --basedir=/Users/gmax/install/build/51/5.1.26 \<br /> --sandbox_directory=msb_5_1_26 \<br /> --install_version=5.1 \<br /> --sandbox_port=5126 \<br /> --no_ver_after_name<br /> The MySQL Sandbox, version 1.21 09-Jun-2008<br /> (C) 2006,2007,2008 Giuseppe Maxia, MySQL AB<br />installing with the following parameters:<br />home_directory = /Users/gmax/sandboxes<br />sandbox_directory = msb_5_1_26<br />sandbox_port = 5126<br />datadir_from = script<br />install_version = 5.1<br />basedir = /Users/gmax/install/build/51/5.1.26<br />my_file =<br />[ ... ]<br />sandbox server started<br />installation options saved to current_options.conf.<br />To repeat this installation with the same options,<br />use ./install.pl --conf_file=current_options.conf<br />----------------------------------------<br />Your sandbox server was installed in /Users/gmax/sandboxes/msb_5_1_26<br /></code></pre><pre><code>$ ./express_install.pl ~/install/build/60/mysql-6.0.6-alpha-darwin9.3.0-i386.tar.gz<br />unpacking /Users/gmax/install/build/60/mysql-6.0.6-alpha-darwin9.3.0-i386.tar.gz<br />Executing ./install.pl --basedir=/Users/gmax/install/build/60/6.0.6 \<br /> --sandbox_directory=msb_6_0_6 \<br /> --install_version=6.0 \<br /> --sandbox_port=6060 \<br /> --no_ver_after_name<br /> The MySQL Sandbox, version 1.21 09-Jun-2008<br /> (C) 2006,2007,2008 Giuseppe Maxia, MySQL AB<br />installing with the following parameters:<br />home_directory = /Users/gmax/sandboxes<br />sandbox_directory = msb_6_0_6<br />sandbox_port = 6060<br />datadir_from = script<br />install_version = 6.0<br />basedir = /Users/gmax/install/build/60/6.0.6<br />[ ... ]<br />sandbox server started<br />installation options saved to current_options.conf.<br />To repeat this installation with the same options,<br />use ./install.pl --conf_file=current_options.conf<br />----------------------------------------<br />Your sandbox server was installed in /Users/gmax/sandboxes/msb_6_0_6<br /></code></pre>At the end of the exercise, you have three sandboxes with the three major MySQL versions, ready to use. Enjoy!gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-73176437339362222912008-06-16T16:30:00.003+02:002008-06-16T18:01:28.142+02:00Sun Tech day in CagliariThe event had an ominous start. Apparently, nobody among the geeks who organized it had paid any close attention to the date to see if it had any significance, and nobody noticed that it was one of the dates when Italian football team was playing a game in the European championship!<br />I was reminded of a similar case, during FrOSCon 2006, which was held during the World cup. Lenz gave a speech in front of 5 people, all friends and colleagues! So we were afraid that we could face a similar debacle.<br />Our fears were swept away when the event started, and the room was filled in to capacity by a very dedicated audience, welcomed by professor Giulio Concas, our generous host, who also introduced a project on software quality metrics.<br /><a href="http://www.flickr.com/photos/datacharmer/2584334244/" title="Domenico Minchella by datacharmer, on Flickr"><img src="http://farm4.static.flickr.com/3119/2584334244_1135384571.jpg" width="500" height="375" alt="Domenico Minchella" /></a><br />Domenico Minchella, a passionate Solaris ambassador, made a convincing demonstration of ZFS crash recovery. He is never afraid of picking a fight with the audience, and he turns every flamebait into advocacy.<br /><a href="http://www.flickr.com/photos/datacharmer/2584334620/" title="Stefano Sanna and his Sun SPOT toys by datacharmer, on Flickr"><img src="http://farm4.static.flickr.com/3274/2584334620_d8365a4c76.jpg" width="500" height="375" alt="Stefano Sanna and his Sun SPOT toys" /></a><br />Stefano Sanna presented what he called "the pitiful case of a grown up man who has to use Sun SPOT to justify with his wife why he is still playing with Lego toys!".<br /><a href="http://www.flickr.com/photos/datacharmer/2583505855/" title="Stefano Sanna and his Sun SPOT toys by datacharmer, on Flickr"><img src="http://farm4.static.flickr.com/3263/2583505855_2b4c0df983.jpg" width="500" height="375" alt="Stefano Sanna and his Sun SPOT toys" /></a><br />The toy performed as expected, and Stefano has more excuses to continue promoting the Sun SPOT.<br /><a href="http://www.flickr.com/photos/datacharmer/2583506689/" title="Fabrizio Gianneschi by datacharmer, on Flickr"><img src="http://farm4.static.flickr.com/3017/2583506689_1f3fe7df8f.jpg" width="500" height="375" alt="Fabrizio Gianneschi" /></a><br />Also Fabrizio Gianneschi had a toy to play with. In addition to the news of Java technology advancement, he played with a Java powered pen that speaks and replays what you write.<br /><a href="http://www.flickr.com/photos/datacharmer/2583507919/" title="throwing dolphins at the audience by datacharmer, on Flickr"><img src="http://farm4.static.flickr.com/3036/2583507919_fdfef0cc43.jpg" width="500" height="375" alt="throwing dolphins at the audience" /></a><br />After the last session, where I had to warn the impatient audience that the dolphins from the desk would be distributed only at the very end, Massimiliano Dessì and yours truly performed the by now celebrated "throw them the dolphins" stunt, which was greatly appreciated. With our delight, most of the audience stayed after the session, to enjoy technical chatting and refreshments.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-33706955405520950802008-06-16T10:24:00.004+02:002008-06-16T11:02:07.311+02:00stupid things you can do to kill your businessIn the global information age, you must get things right if you want to survive. <br /><h3>Mindless (mis)information.</h3><br />My ISP, which has a near monopolistic position in my country, has a support phone line. I called it yesterday, because my DSL was down. The usual routine goes: dial #1 for phone, #2 for data problems. I dial #2, and I get a recorded voice "all operators are busy. You can get support at our web site, www.xxx.it". I just called you because I can't connect, you dumb!<br /><h3>Dumbest e-commerce ever</h3><br />There is a huge movie theater nearby, which is convenient, but the queue at the ticket counter is uninspiring, especially during week-ends. So I check their online ticket sales. Can you believe this? They charge you an additional EUR 0.5 for online tickets. In my book, online services must be cheaper than manned ones, and this is why the airline and the books industries are moving their business online. Charging more for online tickets means that you did not understand the game, and probably you were cheated by the company you chose for this service. The latter is probably true, because, when I continued the booking procedure, I was asked to fill in my credit card details before being told how much I was charged. No way. I booked at the competitor movie theater, which is a few miles farther, but their e-commerce works as expected.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-16182313719913310232008-06-15T12:34:00.007+02:002008-06-15T14:09:52.722+02:00MySQL Sandbox 1.22 and the joys of developing on launchpadI have recently moved <a href="http://launchpad.net/mysql-sandbox">MySQL Sandbox</a> to <a href="http://launchpad.net">launchpad</a> and <a href="http://bazaar-vcs.org/">Bazaar</a>.<br /><table border="0" cellpadding="5" cellspacing="5"><tr><td valign="center" align="center"><a href="http://launchpad.net/sandbox"><img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_gVfZHGgf5LA/SFTyIdzLZ5I/AAAAAAAAAKg/gNf5OVMSHDk/s400/Sakila_sandbox_479x396_white_bg.png" border="0" title="MySQL Sandbox" alt="MySQL Sandbox"id="BLOGGER_PHOTO_ID_5212056896026666898" width="250" /></a></td><td valign="center" align="center"><a href="http://launchpad.net"><img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_gVfZHGgf5LA/SFTxBP0gspI/AAAAAAAAAKY/_xoiv5SHtNw/s400/launchpad-mugshot.png" border="0" alt="launchpad" title=launchpad id="BLOGGER_PHOTO_ID_5212055672503448210" /></a></td></tr></table><br />Working with Launchpad is really a joy. It is much more than providing a <a href="https://code.launchpad.net/mysql-sandbox">web interface to Bazaar version control</a>. It also includes provisions for <a href="https://bugs.launchpad.net/mysql-sandbox">bug reporting and handling</a>, writing <a href="https://blueprints.launchpad.net/mysql-sandbox">blueprints for your roadmap</a>, creating distribution files, and manage your packages if you want to release them in Ubuntu.<br />Using the above tools, I implemented a couple of new features to MySQL Sandbox, and I started to work on a roadmap for the next version, which is now taking shape.<br />The latest version (1.22) includes the ability of using a default option file (<i>$HOME/.msandboxrc</i>), a safer usage of the "--force" option, and several bug fixes.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-33570645284781653392008-06-10T00:52:00.004+02:002008-06-10T14:32:00.263+02:00MySQL Sandbox 1.21 - matrioska and launchpad<a href="https://launchpad.net/mysql-sandbox">MySQL Sandbox</a> has moved to a new home. It is now hosted at <a href="http://launchpad.net">Launchpad</a>, a friendly environment where developers can work together.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_gVfZHGgf5LA/SE20gkOm_AI/AAAAAAAAAKQ/05uqzvWyvDo/s1600-h/750px-Russian-Matroshka_no_bg.jpg"><img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_gVfZHGgf5LA/SE20gkOm_AI/AAAAAAAAAKQ/05uqzvWyvDo/s400/750px-Russian-Matroshka_no_bg.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5210018815511297026" /></a><br />What's new with MySQL Sandbox? The matrioskas in the image are a clue. Version 1.21 introduces the concept of SANDBOX_HOME, which previously was only a path under which store the sandboxes. With time, when I was using more and more sandboxes, I realized that I wanted to take control of all the sandboxes at once, and issue global commands to all of them. <br />Starting with this version, the sandbox installer recognizes an environmental variable named $SANDBOX_HOME, and builds the sandboxes under that path.<br />In addition to grouping all the sandboxes in a place, the installer creates a few scripts that allow you to take control of all the active sandboxes.<br />Let's say that you have a single sandbox of MySQL 5.0.62, a replication system of 7 5.1.24 servers, and a multiple installation of 5 6.0.5 servers.<br />Prior to this version, if you wanted to stop each sandbox, you should have to enter each sandbox directory and run "./stop" or "./stop_all". With the sandbox outer container, you just have to run "./stop_all" from <b>one</b> place.<br />You can also execute the same command in each server in all your sandboxes, by means of the "./use_all" script.<br />If you want to learn more, on Thursday, June 12, 2008 at 15:00 CEST, I will host a <a href="http://forge.mysql.com/wiki/MySQL_Sandbox">MySQL University session</a> on this very subject.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-11111985870083841562008-06-05T19:01:00.006+02:002008-06-05T19:28:07.518+02:00Which OS for your MySQL server?On MySQL <a href="http://dev.mysql.com">developers zone</a> there is <a href="http://dev.mysql.com/tech-resources/quickpolls/primary-os.html">a quick poll</a> on which operating system you use.<br /><a href="http://dev.mysql.com/tech-resources/quickpolls/primary-os.html"><img style="cursor:pointer; cursor:hand;" src="http://bp3.blogger.com/_gVfZHGgf5LA/SEgc2rkjSBI/AAAAAAAAAKI/RSdkFgD2AkY/s400/operating_systems.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5208444694788524050" /></a><br />The combined results of all Linux flavors accounts for 50% of the answers so far. What surprised me is the 6% of mac OSX used as a server. My own experience with macs is just as desktop or laptop. In my very personal view, it feels like a waste to use such a beautiful thing like a Mac as a server. Linux, as Neal Stephenson put it in <a href="http://artlung.com/smorgasborg/C_R_Y_P_T_O_N_O_M_I_C_O_N.shtml">In The Beginning Was The Command Line</a> is like a tank. Efficient but not appealing, compared to Macs, which are described as stylish cars. <br />So, if business is a battle, the Linux tank seems your best bet to get out alive when the smoke settles. The funny thing is that Solaris is an even sturdier tank than Linux, and it should deserve more attention. I guess that, being a recent contender in the open source arena, it will have to pay the price of the learning curve. A price that Linux has paid long time ago and now is reaping the fruit.<br />If you disagree, <a href="http://dev.mysql.com/tech-resources/quickpolls/primary-os.html">have your say!</a>gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-10857263046378513562008-06-02T23:29:00.007+02:002008-06-05T19:01:03.469+02:00BoF at OSCON<table border="0" cellspacing="5" cellpadding="5"><tr><td><img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_gVfZHGgf5LA/SERp7JLCTbI/AAAAAAAAAKA/oS9P2EvW2o0/s400/peacock.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5207403533942541746" /></td><td><br />I have just been informed that in addition to a regular session, I will host two Birds Of a Feather sessions at <a href="http://en.oreilly.com/oscon2008/public/content/home">OSCON 2008</a>.<br /><ul><li><a href="http://en.oreilly.com/oscon2008/public/schedule/detail/4503">MySQL Proxy Wizardry</a></li><li><a href="http://en.oreilly.com/oscon2008/public/schedule/detail/4504">MySQL Sandbox, or How to Do Custom Installs in Seconds</a></li></ul><br />The <a href="http://en.oreilly.com/oscon2008/public/cfp/25">call for papers</a> is still open. Any suggestions for more entries?<br /></td></tr></table>gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-15734287556487812008-06-02T21:32:00.001+02:002008-06-02T21:32:01.527+02:00Firefox 3 is coming<a href="http://www.spreadfirefox.com/en-US/worldrecord"><img style="cursor: pointer;" src="http://bp1.blogger.com/_gVfZHGgf5LA/SEQ80N9nt7I/AAAAAAAAAJ4/q6O8Uo6mvsg/s400/Picture+104.png" alt="" id="BLOGGER_PHOTO_ID_5207353936946116530" border="0" /></a><br />Firefox has been my steady web companion since version 1.0 (and Mozilla before that). For some time now I wanted to try <a href="http://www.mozilla.com/en-US/firefox/all-rc.html">Firefox 3</a>. I was reluctant to abandon Firefox 2, because of the unavailability of most add-ons. I was especially missing the Google Bar, which I have been using on a regular basis.<br />However, a few days ago I found a replacement. <a href="https://addons.mozilla.org/en-US/firefox/addon/492">GoogleBar Lite</a> is almost like the original, minus some feature that I wasn't using anyway.<br />So I have been using Firefox 3 for a while, and I noticed better performance, and no trouble. The additional features are cool, like the Most Visited pull down menu or the location bar integrated with history and search.<br />Firefox enthusiasts want to set a <a href="http://www.spreadfirefox.com/en-US/worldrecord">download world record</a>. I don't think it's necessary, but certainly will be pleasant to achieve it. I <a href="http://www.spreadfirefox.com/en-US/worldrecord">pledged</a>.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-68619865511399038092008-06-01T22:50:00.000+02:002008-06-01T23:38:08.984+02:00Can you see advertising?While preparing a presentation for Rome University, I took many snapshots of MySQL web site. I asked for review, and Colin pointed at the advertising that was in most every page.<br />Now that he mentioned it, yes. I saw the advertising. But when I was working with the live page, taking the screenshots, adjusting them with the Gimp, and inserting them into the presentation, I did not notice them at all.<br /><span style="font-weight:bold;"><big>I am blind to ads</big></span>. <br />I must be the worst nightmare for advertisers. I have pop-up blockers and javascript filters in my browser, so don't see many of them, but the remaining ones are like a ink stain on the page. My brain registers the presence of an alien presence, and quickly instructs my senses to ignore it. If someone tells me that there is an ad in a given page, I have to look at the page twice, to put the ad into focus.<br />Why does this happen?<br />I guess that, after so much time spent using the web, I am trained to spot where the content is, and I filter off automatically all the distracting bits.<br />If the ad contains an interesting image, I may register that, and even remember it sometimes, but I have no idea of what they were selling with that picture. <br /><img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_gVfZHGgf5LA/SEMV8oev2qI/AAAAAAAAAJw/ognmtITKH38/s400/subway_ad.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5207029725573143202" /> <br />For instance, I saw this image in the Singapore subway. I took a picture because it was cute. I can't remember what was advertised.<br />Now, if this <i>filtering</i> happens due to my frequent usage of the web, I wonder how many users have developed the same self defense and evolved into a <i>Homo Sapiens Non Publicitarius</i>, a particular breed of human being who has been saturated by ads and can't see them anymore.<br />Anyone from the same mutation out there?gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-10420048631777407442008-05-28T11:30:00.002+02:002008-05-28T12:55:40.475+02:00Piercing the fog<img src="http://bp0.blogger.com/_gVfZHGgf5LA/SDtL3el6yTI/AAAAAAAAAJY/5BtY9uYxXks/s400/boat_trip_cloud3.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5204837210833733938" title="fog" /><br />There have been many surveys on MySQL, but usually not as deep as <a href="http://www.kwiksurveys.com/online-survey.php?surveyID=KOKK_e414c40b">this one</a> launched by <a href="http://www.paragon-cs.com/wordpress">Keith Murphy</a>, editor of the <a href="http://www.paragon-cs.com/mag/">MySQL Magazine</a> and <a href="http://marksitblog.blogspot.com/">Mark Schoonover</a>.<br />I have seen some turmoil lately, with talks of forking the code base and organizing a community conference. The community seems restless, and this initiative could be an attempt of counting their ranks to see how much they can dare.<br />I welcome this initiative of seeing through the fog. If a survey was needed, rather than waiting one to fall from the sky (or from the <a href="http://sun.com">Sun</a> :-) ), the industrious bloggers have started their own. I will be curious to see the results.<br />Inside MySQL, we have been talking about creating a phone home feature to do a live count of the user base, but as you can see there is no such thing yet. So this survey could provide the data that the missing phone home feature has failed to bring back. The user base measuring itself: that's an interesting thought.<br />If you can spare 10 minutes, I recommend <a href="http://www.kwiksurveys.com/online-survey.php?surveyID=KOKK_e414c40b">taking the survey</a>.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-39889031908816512002008-05-27T21:30:00.002+02:002008-05-27T23:16:31.927+02:00Chaining ProxiesIf you need to combine two scripts with <a href="http://forge.mysql.com/wiki/MySQL_Proxy">MySQL Proxy</a> you have three choices.<br /><ul><li>You can manually rewrite the two scripts (good luck!)</li><li>you can use the <a href="http://datacharmer.blogspot.com/2007/11/multiple-scripts-in-mysql-proxy.html">load-multi</a> module to load scripts on demand;</li><li>or you can use the proxy chaining technique.</li></ul><img src="http://bp3.blogger.com/_gVfZHGgf5LA/SDxWV-l6yVI/AAAAAAAAAJo/C1K0Py9R1rY/s400/chained_proxy.png" alt="" id="BLOGGER_PHOTO_ID_5205130204912732498" border="0" /><br />To chain two proxies, you need to start one Proxy with the first Lua script, pointing at the real backend, listening to a non-standard port. Then you start the second Proxy with the second Lua script, having the first proxy as a backend, and listening to the standard proxy port.<br />It's a difficult and error prone procedure. You would forget about it, unless there were an easy workaround. And indeed you can have such a workaround. Just use the <a href="http://forge.mysql.com/tools/tool.php?id=140">chain_proxy script</a> from MySQL Forge and use it with this simple syntax:<br /><pre><code>$ chain_proxy first_script.lua second_script.lua</code></pre>When I made this script, I had the problem of handling the standard output for each proxy instance. The brute force solution is to start each instance in a separate terminal window, but that is less than optimal. It would be almost as much work as doing things manually.<br />Considering that usually I need the output of a Proxy session only for debugging and that I am a frequent user of <a href="http://en.wikipedia.org/wiki/GNU_Screen">GNU screen</a>, I made this arrangement:<br />The script starts each proxy inside a separate <i>screen</i>. At the end, it gives the list of screens being used, and creates a customized script in /tmp/ to kill the chained proxies and remove the screens.<br /><pre><code>$ chain_proxy digits.lua loop.lua<br />proxy started on screen "second_proxy" using script "loop.lua" - pid_file : /tmp/proxy1.pid<br />proxy started on screen "first_proxy" using script "digits.lua" - pid_file : /tmp/proxy_chain1.pid<br />stop script is /tmp/proxy_chain_stop<br />There are screens on:<br /> 21257.first_proxy (Detached)<br /> 21258.second_proxy (Detached)<br />2 Sockets in /tmp/uscreens/S-gmax.<br /></code></pre>In this example, the two proxies are started in sequence, and the script gives information on what is going on. The output of "loop.lua" is in the "first_proxy" screen. To see it, I only need to do<br /><pre><code>$ screen -r first_proxy<br /></code></pre>When I am finished using the chained Proxy, I type<br /><pre><code>$ /tmp/proxy_chain_stop<br />There are screens on:<br /> 21257.first_proxy (Detached)<br /> 21258.second_proxy (Detached)<br />2 Sockets in /tmp/uscreens/S-gmax.<br /><br />No Sockets found in /tmp/uscreens/S-gmax.<br /></code></pre>This script can also be implemented by redirecting the output of each proxy to a different file. YMMV. I like the screen solution better.<br /><br />I will be speaking about this feature (and more) during my <a href="http://blogs.sun.com/datacharmer/entry/mysql_university_lua_advanced_scripting">MySQL University session on advanced Lua scripting</a>.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-91102274283368765732008-05-27T13:30:00.002+02:002008-05-27T14:44:22.213+02:00Virtual squares - Taking virtualization to new limits<table border="0"><tr><td><a href="http://virtualsquare.org/"><img src="http://bp0.blogger.com/_gVfZHGgf5LA/SDvtQel6yUI/AAAAAAAAAJg/AHwT84BrSV4/s400/virtualsquare.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5205014661702535490" width="200" title="Virtual Square"/></a></td><td><br />During the Italian Free Software Conference in Trento, I attended an amazing presentation on virtual components. <br />Renzo Davoli, professor at Bologna University and hacker, has stretched the concept of virtualization to new limits. <a href="http://virtualsquare.org/">Virtual Square</a> is a project aiming at developing more dynamic implementations of virtual entities, which eventually get separated from the concept of operating system and root privileges.<br /></td></tr></table><br />The coolest aspect of all this project is the virtualization of <a href="http://wiki.virtualsquare.org/index.php/Introduction#View_OS">single elements</a> like a disk drive, a net port, a file system, without root privileges, and with no impact on other users.<br />Virtualizing single elements makes life easier for demanding users, and more quite for their neighbors, who won't be affected by massive reduction of overall resources as it happen with normal virtualization of operating systems.<br />Think of the applications: for example, it would be easier to establish dedicated quotas for database and web server users, with better security and easier maintenance and without creating new OS users. MySQL, with its limited interface for user resources, would surely benefit from this system. There is a lot of potential in this idea. Let's hope it is pushed a bit farther than the academic circles.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-90351362945867394132008-05-22T09:00:00.000+02:002008-05-22T10:40:47.627+02:00A look at the Open Source CensusYesterday I had a look at the <a href="http://www.osscensus.org/">Open Source Census</a> (OSC), a project aiming at counting the installations of open source packages.<br /><a href="http://www.osscensus.org/"><img src="http://bp2.blogger.com/_gVfZHGgf5LA/SDUrbel6ySI/AAAAAAAAAJQ/sb6jUpaJKsY/s400/OSC_header.gif" alt="" id="BLOGGER_PHOTO_ID_5203112695565044002" border="0" /></a><br />It is a collaborative effort. The OSC offers the infrastructure, and it's open to cooperation. It works with a disc scanner, and relies on the principle that the contributions are voluntary and anonymous.<br />If you want to contribute, you need to register, and you are encouraged to do so anonymously. The OSC is not interested in who you are, but the registration gives you a chance of tracking your results with the rest of the community.<br />The registration is also necessary to avoid duplicates, and to track your installations over time, should you decide to do that on a regular basis.<br />If you want to give it a try, the procedure goes like this:<br /><ol><li>Register (with any fancy name you want);</li><li>download the scanner package (it's open source)</li><li>scan your computer (or some selected directories), using your unique identifier</li><li>look at the results;</li><li>send the results to the census (using the same tool).</li></ol>Bear in mind that there is no way for the OSC to track down who you are, because you are not asked in the first place. So the results are truly anonymous.<br /><br />Some concerns:<br /><ul><li>The scan package is open source. However, even the simplest package available the pure Ruby) is more than 6000 lines of code. If you are security conscious, examining the code is not a quick task. You will have to rely on peer review from the community, or do a test scan in a virtual machine to examine what the software does (that's what I did);</li><li>If you have a large machine, the scan may take hours. You will have to plan for night scans if you want to contribute seriously.</li></ul><br />On the plus side, the process of scanning is open. You can contribute the signatures of your favorite open source tools, to be included in the next scans.<br />Looking at the results may bring some surprises. I did not know that I had two different versions of MySQL-connector/J in my laptop, or two versions of PostgreSQL connector either! And I wonder how I managed to get 5 (<b>FIVE</b>) different versions of docbook-xml in my laptop, given that I haven't ever asked to install it.<br />However, the scanner gives you more than the public list of packages found in your box. For your own consumption (it is not sent to the census) it produces a detailed list of where each package was found. So you cam analyze that list and eventually clean up the system.<br />Other surprising results. I checked how often MySQL was installed, and it turns out to be present on 37% of the scanned boxes. The surprising results, however, is the <a href="https://www.osscensus.org/packages-name-public.php?offset=9&limit=50&page=9">the distribution of old versions</a>. About 20% of MySQL servers are still using version 4.x. Fascinating!<br />The project is young, but very promising, in my opinion. There may be problems for adoption from large corporations (security policies will be hard to deal with), but if the community picks up, it may produce good results. Give it a try.gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.comtag:blogger.com,1999:blog-16959946.post-1159193147497008352008-05-15T17:44:00.003+02:002008-05-15T18:33:43.706+02:00What's in a name?<blockquote><i>What's in a name? That which we call a rose by any other name would smell as sweet.</i></blockquote><br />Good old William had his reasons to say so, but then either he was not concerned about misspellings or he didn't care. (A recent <a href="http://www.amazon.co.uk/Shakespeare-World-Stage-Eminent-Lives/dp/0007197896">book</a> about the Bard actually points out that all Shakespeare's known signatures are differently spelled, and none of them is spelled <i>Shakespeare</i>!)<br />The problem with my name is that, for the majority of non-Italians, it does not sound familiar, and consequently it gets misspelled. As a frequent traveler, I have seen every sort of mischief done to my first name.<br />I don't really understand why, but most English speakers write "G<b>UI</b>seppe" instead of "G<b>IU</b>seppe." Sometimes I was called "Giuseppa" (which is a female name) or "Giuseppi" (which is a non existing plural of my name), or "Jooseppai" (which is how I pronounce it) and several variations with additional or missing vowels.<br />Let me set the record straight, for anybody who cares.<br />The right spelling is "<span style="font-size:180%;">G-I-U-SEPPE</span>". To remember the right order, you may use what I call the <b>selfish rule</b>: <i>First I, then U</i>. Got it? :)<br /><br />Now, let me use this fact to compare the behavior of two companies. When I was hired by MySQL, I braced myself in wait of the misspelling, which did not come! All my official documents, personnel listings, email accounts, company badge, were produced without any mistake. I was impressed. Apparently, MySQL HR people are very attentive to these details. When I was hired by Sun, instead, well, let me say that it was not the same quality. MySQL was an international company, while Sun seems more an US company with international branches. They are learning, though. <br /><br /><small>I wrote the draft for this post long ago, but I left it aside. Now, since it seems that I am not the only one with <a href="http://www.flamingspork.com/blog/2008/05/14/my-name-is/">this problem</a>, I state my point.</small>gmaxhttp://www.blogger.com/profile/15801583338057324813noreply@blogger.com