<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>PHP, the universe and all the rest</title>
    <link>http://www.php-groupies.de/blogs/</link>
    <description>PHP Groupie since 1999 </description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.0.3 - http://www.s9y.org/</generator>
    <pubDate>Mon, 30 Apr 2012 06:31:39 GMT</pubDate>

    <image>
        <url>http://www.php-groupies.de/blogs/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: PHP, the universe and all the rest - PHP Groupie since 1999 </title>
        <link>http://www.php-groupies.de/blogs/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Fun with Cluster and Locking</title>
    <link>http://www.php-groupies.de/blogs/archives/50-Fun-with-Cluster-and-Locking.html</link>
            <category>MySQL</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/50-Fun-with-Cluster-and-Locking.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=50</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=50</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;I&#039;ve been dealing with MySQL Cluster in one way or another since around 2005 or so (back in the MySQL 4.1 days) but it is still full of &amp;quot;funny&amp;quot; surprises. This post is a collection of different locking related issue i ran into during the previous weeks that i had not been aware of up to now (or simply may have forgotten over time)&lt;/p&gt;

&lt;p&gt;== Unique hash indexes lock exclusively ==&lt;/p&gt;

&lt;p&gt;This is the one that regular users are most likely to run into: in general row logs in MySQL Cluster distinguish between reads and writes so that writers can block other writers, but not readers and readers from other transactions always see the last committed row value (Cluster currently only supports the READ COMMITTED isolation level). As soon as you have a secondary unique index in addition to a primary key things are different though. Internally a unique index that is not the primary key is implemented as a unique hash index in Cluster (and optionally also as an additional ordered T-Tree), and for unique hash entries there only seems to be exclusive locking so that writers will block readers across transactions.&lt;/p&gt;

&lt;p&gt;See &lt;a href=&quot;http://bugs.mysql.com/65086&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;http://bugs.mysql.com/65086&lt;/a&gt; for actual examples.&lt;/p&gt;

&lt;p&gt;== Long running transactions can block starting nodes ==&lt;/p&gt;

&lt;p&gt;Less likely to happen, but very annoying if it happens and you don&#039;t know about it:&lt;/p&gt;

&lt;p&gt;A starting node needs to lock all rows for a very short period of time near the end of start phase 5. At this point it needs to wait for all current transaction to free the locks they are holding (by either COMMIT or ROLLBACK). This is usually not a problem as cluster transaction are not supposed to last very long anyway, but if there happens to be a long running transaction it can potentially block a node start forever. A stopping node will wait for pending transactions for 5 seconds and will then terminate these transactions the hard way, a starting node on the other hand will gracefully wait forever.&lt;/p&gt;

&lt;p&gt;This is bad in two ways:&lt;/p&gt;

&lt;p&gt;1) it is obviously bad availability wise as you may end up with a non-redundant configuration for extended periods of time and without any way to automatically identify and terminate the offending transaction(s)&lt;/p&gt;

&lt;p&gt;2) currently the blocked starting node does not even tell what it is waiting for, it just silently sits and waits. So unless you know what is going on you are faced with a node that is simply stuck without doing anything (CPU, disc and network load next to zero)&lt;/p&gt;

&lt;p&gt;The related bug report is &lt;a href=&quot;http://bugs.mysql.com/65037&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;http://bugs.mysql.com/65037&lt;/a&gt; , proposed solutions are meaningful log messages in the short term and killing active transactions after a grace period in the long run.&lt;/p&gt;

&lt;p&gt;== Weird error message on lock timeout ==&lt;/p&gt;

&lt;p&gt;This last item is related to the non-standard INSERT ... ON DUPLICATE KEY UPDATE construct. What can happen here is that the INSERT part fails with a lock wait timeout as the key is write locked by another transaction. The expected error message in this case would simply be &amp;quot;Lock wait timeout exceed&amp;quot; but what you&#039;ll actually get is &amp;quot;Transaction already aborted&amp;quot;. What seems to happen here is that the ON DUPLICATE KEY UPDATE part is triggered by any error in the INSERT phase and not only by duplicate key violation. So the INSERT part is tried tried, fails with &amp;quot;Lock wait timeout&amp;quot; (which implicitly rolls back the current transaction), next the UPDATE part is tried, fails with &amp;quot;Transaction already aborted&amp;quot; and overwrites the previous error ...&lt;/p&gt;

&lt;p&gt;The related bug report is &lt;a href=&quot;http://bugs.mysql.com/65130&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;http://bugs.mysql.com/65130&lt;/a&gt;&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Fri, 27 Apr 2012 19:22:44 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/50-guid.html</guid>
    
</item>
<item>
    <title>Partition fun again, today with ARCHIVE</title>
    <link>http://www.php-groupies.de/blogs/archives/47-Partition-fun-again,-today-with-ARCHIVE.html</link>
            <category>MySQL</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/47-Partition-fun-again,-today-with-ARCHIVE.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=47</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=47</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;After the fun with InnoDB and MyISAM and massive partitioning it&#039;s time to move on to some other storage engines. So for the next round of fun i chose ARCHIVE:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;  mysql&amp;gt; create table t1 (id int primary key auto_increment, val int) 
      engine=archive partition by hash(id) partitions 1023;
  Query OK, 0 rows affected (0.26 sec)

  mysql&amp;gt; insert into t1 values(NULL,1);
  ERROR 1194 (HY000): Table &#039;t1&#039; is marked as crashed 
      and should be repaired

  mysql&amp;gt; drop table t1; 
  ERROR 2013 (HY000): Lost connection to MySQL server 
      during query&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;PS: MariaDB does not seem to be affected ...&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Fri, 06 Apr 2012 18:50:00 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/47-guid.html</guid>
    
</item>
<item>
    <title>A different kind of static?</title>
    <link>http://www.php-groupies.de/blogs/archives/48-A-different-kind-of-static.html</link>
            <category>MySQL</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/48-A-different-kind-of-static.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=48</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=48</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;While actually trying to check for something completely different (more on that later maybe)&lt;br /&gt;
i found that mysql, mysqladmin and other client binaries in my MySQL 5.5 install dir did&lt;br /&gt;
not list libmysqlclient.so as a dependency in ldd output anymore. Looks as if since the&lt;br /&gt;
switch to Cmake it gets statically linked into all the bundled client libraries and so&lt;br /&gt;
increases binary sizes by a factor of about 10x now, and i can&#039;t see any Cmake build&lt;br /&gt;
option that would produce the old behavior either.&lt;/p&gt;

&lt;p&gt;So my /usr/local/mysql-5.5.21/bin directory now uses 130MB instead of the 17MB that&lt;br /&gt;
the /usr/local/mysql-5.1.60/bin one used. Doesn&#039;t sound much by itself, but for &lt;br /&gt;
someone like me who tries to keep as many versions as possible installed in parallel&lt;br /&gt;
for testing purposes it sums up to several GB quickly, and it totally defies the&lt;br /&gt;
purpose of having a shared libmysqlclient.so in the first place ... &lt;img src=&quot;http://www.php-groupies.de/blogs/templates/default/img/emoticons/sad.png&quot; alt=&quot;:-(&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Mon, 12 Mar 2012 10:30:55 +0100</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/48-guid.html</guid>
    
</item>
<item>
    <title>Fun with partitions and MyISAM, part #2</title>
    <link>http://www.php-groupies.de/blogs/archives/46-Fun-with-partitions-and-MyISAM,-part-2.html</link>
            <category>MySQL</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/46-Fun-with-partitions-and-MyISAM,-part-2.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;This is part of the reply i got on my &lt;a href=&quot;http://bugs.mysql.com/bug.php?id=64498&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;bug report&lt;/a&gt; on the ALTER TABLE issue with MyISAM and a large number of partitions from my &lt;a href=&quot;http://www.php-groupies.de/blogs/archives/44-More-fun-with-partitions,-this-time-with-MyISAM.html&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;previous post&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;This is a design limitation, MyISAM have one file handle open for the .MYI file shared by all instances of one table, and one file handle open for each table instance for the .MYD file. And the ha_partition generic partitioning engine  always open all partitions when opening a table/handler.&lt;/p&gt;

&lt;/blockquote&gt;
&lt;p&gt;So this should not only affect ALTER TABLE but all operations on MyISAM tables with large number of partitions should eventually run into this. Lets try and see what happens ...&lt;/p&gt;

 &lt;br /&gt;&lt;a href=&quot;http://www.php-groupies.de/blogs/archives/46-Fun-with-partitions-and-MyISAM,-part-2.html#extended&quot;&gt;Continue reading &quot;Fun with partitions and MyISAM, part #2&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 07 Mar 2012 05:29:36 +0100</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/46-guid.html</guid>
    
</item>
<item>
    <title>More fun with partitions, this time with MyISAM</title>
    <link>http://www.php-groupies.de/blogs/archives/44-More-fun-with-partitions,-this-time-with-MyISAM.html</link>
            <category>MySQL</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/44-More-fun-with-partitions,-this-time-with-MyISAM.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=44</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=44</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    
&lt;pre&gt;&lt;code&gt;mysql&amp;gt; CREATE TABLE t1 (id INT PRIMARY KEY ) 
             engine=myisam PARTITION BY HASH(id) PARTITIONS 1000;
Query OK, 0 rows affected (0.18 sec)

mysql&amp;gt; alter table t1 add column v int;
ERROR 1016 (HY000): Can&#039;t open file: &#039;./test/t1.frm&#039; (errno: 24)

mysql&amp;gt; quit
Bye

$ perror 24
OS error code  24:  Too many open files&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Looks as if MyISAM tries to open all the 1000 partition .MYD/.MYI files at once and runs out of file handles during this operation ...&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Wed, 29 Feb 2012 14:22:59 +0100</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/44-guid.html</guid>
    
</item>
<item>
    <title>Some fun with partitions and InnoDB ...</title>
    <link>http://www.php-groupies.de/blogs/archives/43-Some-fun-with-partitions-and-InnoDB-....html</link>
            <category>MySQL</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/43-Some-fun-with-partitions-and-InnoDB-....html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=43</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=43</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;Creating or dropping a partitioned table on InnoDB can become a quite expensive operation, on my laptop i&#039;m seeing the following times for a simple table with 100 or 1000 partitions (using 5.1.58 right now as i&#039;m testing on stock Ubuntu 11.10):&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;  mysql&amp;gt; CREATE TABLE t1 (id INT PRIMARY KEY )
               engine=innodb PARTITION BY HASH(id) PARTITIONS 100;
  Query OK, 0 rows affected (5.21 sec)

  mysql&amp;gt; drop table t1;
  Query OK, 0 rows affected (5.11 sec)

  mysql&amp;gt; CREATE TABLE t1 (id INT PRIMARY KEY )
               engine=innodb PARTITION BY HASH(id) PARTITIONS 1000;
  Query OK, 0 rows affected (52.76 sec)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So the time to create a partitioned InnoDB table grows linearly with the number of partitions at a &#039;speed&#039; of about 20 partitions per second, and during that time the hard disk LED is always on. The rate for creating regular InnoDB tables on this machine is about 10 tables per second by the way.&lt;/p&gt;

&lt;p&gt;MyIsam on the other had can create around 17 tables per second, and creating a single partitioned MyISAM table only takes about a 10th of a second.&lt;/p&gt;

&lt;p&gt;So what is going on with InnoDB here? First of all from the engines point of view each partition of a partitioned table is an actual table, all the partitioning magic happens on a layer above the storage engine one, and the storage engine only receives handler requests for the actual partition tables involved. On the storage engine layer the actual engines are not aware that these tables are part of a larger partitioned table at all (with the exception of ndbcluster tables, but MySQL Cluster is a different story in this respect anyway).&lt;/p&gt;

&lt;p&gt;So when creating an InnoDB table with 1000 partitions the InnoDB storage engine actually receives 1000 individual requests to create a table. Now what seems to happen is that for each&lt;br /&gt;
created partition/table InnoDB flushes at least its internal data dictionary to disk. Given the constant disk activity and rather low internal table creation rate it may even do a full checkpoint for each table, i haven&#039;t checked the details on this yet. And when dropping a partitioned table the same thing happens in reverse.&lt;/p&gt;

&lt;p&gt;So this may be something to keep in mind when planning to use large numbers of partitions on InnoDB ...&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Wed, 29 Feb 2012 12:55:36 +0100</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/43-guid.html</guid>
    
</item>
<item>
    <title>MySQL features i forgot about #1 : slave_compressed_protocol</title>
    <link>http://www.php-groupies.de/blogs/archives/42-MySQL-features-i-forgot-about-1-slave_compressed_protocol.html</link>
            <category>MySQL</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/42-MySQL-features-i-forgot-about-1-slave_compressed_protocol.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=42</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=42</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;It is probably about time to re-read the MySQL manual end-to-end as i more and more find myself discovering features i either completely forgot about or which i never was aware of in the first place ...&lt;/p&gt;

&lt;p&gt;Todays guest is &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#sysvar_slave_compressed_protocol&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;slave_compressed_protocol&lt;/a&gt;, an option that has probably been there ever since MySQL 3.23 at least (so that i can&#039;t claim that i seem to have missed the ChangeLog entry as i usually do &lt;img src=&quot;http://www.php-groupies.de/blogs/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;With slave_compressed_protocol enabled the communication between slave and master uses the MYSQL_OPT_COMPRESS option to compress the protocol stream if both sides support it (and it&#039;s very unlikely to find an installation that does *not* support it these days), so this can be a big savior if your master and slave are at different sites with only limited bandwidth between the two.&lt;/p&gt;

&lt;p&gt;Unfortunately this is a global server option though, IMHO this should be part of the options provided by the CHANGE MASTER command, similar to all the SSL encryption related stuff that is part of CHANGE MASTER.&lt;/p&gt;

&lt;p&gt;Looks as if it is about time for YAFR (Yet Another Feature Request) ...&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Thu, 23 Feb 2012 06:10:40 +0100</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/42-guid.html</guid>
    
</item>
<item>
    <title>PHPreboot braindump</title>
    <link>http://www.php-groupies.de/blogs/archives/41-PHPreboot-braindump.html</link>
            <category>PHP</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/41-PHPreboot-braindump.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=41</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=41</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;Looks as if we have the next member in the &amp;quot;I want to become Caliph instead of the Caliph&amp;quot; club: &lt;a href=&quot;http://code.google.com/p/phpreboot/&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;PHPreboot&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is just a braindump of thoughts on the various bullet points and examples on the projects home page (but i don&#039;t think it&#039;s worth any more time to analyze it and comment on it either):&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;less $, less &#039;;&#039; like in javascript&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not sure whether this is really an improvement, while $ and ; are not really necessary from a parsers (or lazy typers) point of view they &lt;b&gt;do&lt;/b&gt; carry some context information ... so this is breaking the &amp;quot;The burden shall be on the writer, not the readers&amp;quot; principle IMHO&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;secure by default: no eval, no magic quotes/string interpolation&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yes, that&#039;s all that needs to be disabled to guarantee secure code ... NOT&lt;/p&gt;

&lt;p&gt;Magic quotes were a bad idea, but for slightly different reasons. eval() by itself is not a bad idea either if used properly, same as with backticks, system(), popen(), ...&lt;/p&gt;

&lt;p&gt;And just by disabling magic quotes and eval() you do not make code secure by default, XSS and SQL injections can still happen without these, and i&#039;d bet that most malicious code injections in vulnerable PHP apps were not using eval() but include/require as attack vector to make PHP execute their own code ... want to forbid these, too?&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;full unicode support&lt;/b&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That&#039;s a good thing, we may just have different ideas of &amp;quot;full&amp;quot; ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;no from/to string auto-conversion&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I do like the &amp;quot;to&amp;quot; part of it ... not really sure about the &amp;quot;from&amp;quot; part ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;a SQL compatible syntax&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which SQL dialect? And looking at the code: how would i handle queries against multiple database connections?&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;Perl 5 regex literal&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I personally prefer to write preg_match() literally ... but that may be just me and my PERL allergy ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;URI/file literal&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I don&#039;t see that much gain in that one over explicit fopen(), ... calls either&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;fast as Java thanks to a runtime profiler/optimizer and JSR 292 API&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There&#039;s room for improvement in PHP optimizers and op code caches for sure ...&lt;/p&gt;

&lt;p&gt;In my personal use cases a JVM based PHP would actually be a loss though. Most stuff i&#039;m using PHP for these days is medium complex command line stuff (like my code generators), and for most of this my PHP scripts are already done with their job in a time that would not even be sufficient for a JVM to initialize and execute the very first byte code op of my user code&lt;/p&gt;

&lt;p&gt;There&#039;s also the more general issue that when going the way of the JVM you either go bytecode all the way and have to say goodbye to all the PHP extensions that are actually just thin wrappers around native C libraries, re-implement those libraries functionality in a language supported by the JVM or go the way of JNI ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;provide an embedded database derby and a standalone web server grizzly by default&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;... instead of SQLite and ?forgot-the-name-of-the-upcoming-integrated-webserver-thingy? ...?&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;native XML syntax&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sorry, can&#039;t see how that&#039;s &amp;quot;native XML syntax&amp;quot;, PHP and its use of XML processing instruction syntax is as native as you can get, hiding executable code in DATA not so much&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;Language as close as possible to PHP&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sorry but even that simple example does not really look like PHP to me as all. Maybe part of that is due to the use of &amp;quot;elseif&amp;quot; instead of &amp;quot;else if&amp;quot;. I haven&#039;t seen any PHP code using &amp;quot;elseif&amp;quot; in years, i even had to double check that it works in this context and not just in the IF: ... ELSEIF: ... ENDIF; form.&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;b&gt;native XQuery&lt;/b&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Again i&#039;m not sure whether i want to have that on the Syntax level ...&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;[...]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So to summarize:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;the language does hardly look like PHP anymore (actually looks more like a PERL/Python chimera to me personally)&lt;/li&gt;
    &lt;li&gt;the language will not be backwards compatible to PHP syntax wise (afaict)&lt;/li&gt;
    &lt;li&gt;the language will not have many of the functionality that PHP gets from native C libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;=&amp;gt; so why should it have the letters PHP in its name at all?&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Mon, 10 Oct 2011 17:22:12 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/41-guid.html</guid>
    
</item>
<item>
    <title>Overriding bind=... in included MySQL option files</title>
    <link>http://www.php-groupies.de/blogs/archives/40-Overriding-bind...-in-included-MySQL-option-files.html</link>
            <category>MySQL</category>
            <category>Puppet</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/40-Overriding-bind...-in-included-MySQL-option-files.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=40</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=40</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;Debian and Ubuntu make use of the &lt;b&gt;!includedir&lt;/b&gt; directive at the end of the packaged &lt;b&gt;my.cnf&lt;/b&gt; to allow for extending and overriding their default configuration without having to modify the distribution config file.&lt;/p&gt;

&lt;p&gt;This is especially nice in combination with configuration tools like &lt;b&gt;puppet&lt;/b&gt; as it is usually much easier to add a file to the system than to modify an existing file.&lt;/p&gt;

&lt;p&gt;I ran into a small gotcha with this though: the default my.cnf binds mysqld to the localhost TCP interface so that it listens IP 127.0.0.1 only. To make the mysql server reachable from other hosts the &lt;b&gt;bind=127.0.0.1&lt;/b&gt; setting needs to be overwritten.&lt;br /&gt;
How to change the binding to a different IP should be obvious, but how to disable an existing binding completely if you want your mysqld to listen on all available interfaces?&lt;/p&gt;

&lt;p&gt;The most obvious would be to simply say&lt;/p&gt;

&lt;p&gt;bind=&lt;/p&gt;

&lt;p&gt;, this does not have any effect though. What needs to be done instead is&lt;/p&gt;

&lt;p&gt;bind=0.0.0.0&lt;/p&gt;

&lt;p&gt;to make mysqld listen on all interfaces again.&lt;/p&gt;

&lt;p&gt;This is obviously a solution for IPv4 only, for allowing incoming connections from all v4 and v6 interfaces allowing &lt;b&gt;bind=&lt;/b&gt; without any argument to reset any existing bindings would probably be more clever?&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Tue, 04 Oct 2011 08:29:10 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/40-guid.html</guid>
    
</item>
<item>
    <title>Multiple network adapters in Vagrant VMs</title>
    <link>http://www.php-groupies.de/blogs/archives/39-Multiple-network-adapters-in-Vagrant-VMs.html</link>
            <category>Vagrant</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/39-Multiple-network-adapters-in-Vagrant-VMs.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;For testing some stuff related to MySQL Cluster, port binding and having two network interfaces on the same subnet i needed a bit more than my usual &amp;quot;all nodes on localhost&amp;quot; setup. Looking for a reusable solution i this time did not just simply plug several of my old laptops into the same hup but tried to create a &lt;a href=&quot;http://vagrantup.com/&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;Vagrant&lt;/a&gt; setup for this.&lt;/p&gt;

&lt;p&gt;This quickly lead to the question how to define multiple network adapters per Vagrant VM. The manual is not too clear about this yet, and the key piece of information is not yet to be seen in the network section but is hiding in the section on port forwarding: the &lt;b&gt;:adapter&lt;/b&gt; option.&lt;/p&gt;

&lt;p&gt;So to define multiple adapters you need to add &lt;b&gt;:adapter =&amp;gt; $value&lt;/b&gt; options on each of the &lt;b&gt;vm.network&lt;/b&gt; lines, with &lt;b&gt;$value&lt;/b&gt; counting up from one, e.g.:&lt;/p&gt;

&lt;p&gt;config.vm.network(&amp;quot;33.33.33.10&amp;quot;, :adapter =&amp;gt; 1);&lt;br /&gt;
    config.vm.network(&amp;quot;33.33.33.20&amp;quot;, :adapter =&amp;gt; 2);&lt;/p&gt;

&lt;p&gt;In my case i need both adapters to be on the same IP subnet. Vagrant (or VirtualBox?) is not clever enough for this yet and will create two distinct host-only networks for this, routing and binding works as expected though as the kernels inside the VMs do not care about (and are not even aware of) this.&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Sat, 17 Sep 2011 08:35:29 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/39-guid.html</guid>
    
</item>
<item>
    <title>MySQL Conference talk slides</title>
    <link>http://www.php-groupies.de/blogs/archives/38-MySQL-Conference-talk-slides.html</link>
            <category>MySQL</category>
            <category>OSM</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/38-MySQL-Conference-talk-slides.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=38</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=38</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;Slides for my two MySQL Conference talks are now available from the O&#039;Reilly conference site:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;a href=&quot;http://en.oreilly.com/mysql2011/public/schedule/detail/17383&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;From Map to Web - OpenStreetMap -&amp;gt; (PostGIS|MySQL|SpatiaLite) -&amp;gt; Openlayers&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://assets.en.oreilly.com/1/event/56/A%20code%20stub%20generator%20for%20MySQL%20and%20Drizzle%20plugins%20Presentation%201.pdf&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;A code stub generator for MySQL and Drizzle plugins&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

 
    </content:encoded>

    <pubDate>Fri, 15 Apr 2011 18:53:55 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/38-guid.html</guid>
    
</item>
<item>
    <title>Why go with O(n) if you can have O(n²)?</title>
    <link>http://www.php-groupies.de/blogs/archives/37-Why-go-with-On-if-you-can-have-On.html</link>
            <category>MySQL</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/37-Why-go-with-On-if-you-can-have-On.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=37</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;Found this while waiting for the CSV export of a search result from (*undisclosed project*) ...&lt;/p&gt;

&lt;p&gt;The export took almost half an hour even though it was just extracting the snail mail addresses of about 40K contacts, so what caused it to only spit out about 20 rows per second? Looking at the PROCESSLIST output a pattern was easy to detect. What greeted me was a single running query which had only been running for a few seconds even though i was already waiting for export results for about 20 minutes:&lt;/p&gt;

&lt;p&gt;SELECT ... LIMIT 32900, 100;&lt;/p&gt;

&lt;p&gt;And then a few seconds later:&lt;/p&gt;

&lt;p&gt;SELECT ... LIMIT 33000, 100;&lt;/p&gt;

&lt;p&gt;So instead of retrieving the search results for export by firing a single query and processing the results in one go the same pagination logic seemed to be used as for displaying search results. About 400 queries instead of a single one, and each iteration taking more query time, with finally the last one taking about the same time as the only query in the all-at-once alone.&lt;/p&gt;

&lt;p&gt;Somewhere, somehow, something terribly went wrong it seems ....&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Thu, 03 Mar 2011 10:49:01 +0100</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/37-guid.html</guid>
    
</item>
<item>
    <title>osm2pgsql nor able to read PBF files directly</title>
    <link>http://www.php-groupies.de/blogs/archives/36-osm2pgsql-nor-able-to-read-PBF-files-directly.html</link>
            <category>OSM</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/36-osm2pgsql-nor-able-to-read-PBF-files-directly.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=36</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=36</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;With the changes i recently committed to the OSM SVN repository osm2pgsql can now read OSM files in the new binary PBF format directly (with parsing code based on that found in pbf2osm). Files in PBF format are available from the geofabrik download site along with their XML counterparts and are usually about 30% smaller than bzip2 compressed XML. osm2pgsql also parses PBF about twice as fast, so substantially reducing the time taken for the first processing step.&lt;/p&gt;

&lt;p&gt;Also part of my committed changes are an improved autotools setup that checks for library and header file availability in the configure stage already, and that only includes PBF support if the needed GNU ProtoBuffer related tools and libraries are available.&lt;/p&gt;

&lt;p&gt;Unfortunately the PBF code requires at least protobuf-c 0.14, which is not yet part of current distributions, so you&#039;ll have to install that one from source yourself. But with proper configure checks in place you&#039;ll be at least warned about version mismatches here and osm2pgsql will be built without PBF support then.&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Mon, 08 Nov 2010 23:35:08 +0100</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/36-guid.html</guid>
    
</item>
<item>
    <title>DirectDownload plugin now with track description</title>
    <link>http://www.php-groupies.de/blogs/archives/35-DirectDownload-plugin-now-with-track-description.html</link>
    
    <comments>http://www.php-groupies.de/blogs/archives/35-DirectDownload-plugin-now-with-track-description.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=35</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;Thanks to TomH for adding the missing fields to the API response so quickly &lt;img src=&quot;http://www.php-groupies.de/blogs/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.php-groupies.de/blogs/uploads/Screenshot.png&quot; width=&quot;848&quot; height=&quot;411&quot; alt=&quot;Screenshot.png&quot; /&gt;&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Tue, 12 Oct 2010 21:46:40 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/35-guid.html</guid>
    
</item>
<item>
    <title>My first JOSM plugin: Direct GPX track download</title>
    <link>http://www.php-groupies.de/blogs/archives/34-My-first-JOSM-plugin-Direct-GPX-track-download.html</link>
            <category>Java</category>
            <category>OSM</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/34-My-first-JOSM-plugin-Direct-GPX-track-download.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=34</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=34</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;No more need to manually download tracks you previously uploaded to openstreetmap.org first, then opening the downloaded file with JOSMs &amp;quot;Open file ...&amp;quot; dialog. You can now pick an uploaded track and have it loaded into a new GPX layer directly with the help of the &lt;b&gt;DirectDownload&lt;/b&gt; &lt;span title=&quot;Something that plugs in&quot; class=&quot;serendipity_glossaryMarkup&quot;&gt;plugin&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;You can download the &lt;a href=&quot;http://php-baustelle.de/DirectDownload.jar&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;compiled plugin .jar&lt;/a&gt; or &lt;a href=&quot;http://php-baustelle.de/DirectDownload.tar.gz&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;the source code&lt;/a&gt;, but be warned: current status is &amp;quot;works for me&amp;quot; aka. &amp;quot;proof of concept&amp;quot;.&lt;br /&gt;
The desired functionality is there, but it still is a bit rough around the edges.&lt;/p&gt;

 &lt;br /&gt;&lt;a href=&quot;http://www.php-groupies.de/blogs/archives/34-My-first-JOSM-plugin-Direct-GPX-track-download.html#extended&quot;&gt;Continue reading &quot;My first JOSM plugin: Direct GPX track download&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 11 Oct 2010 08:02:52 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/34-guid.html</guid>
    
</item>

</channel>
</rss>
