<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 22 May 2013 18:31:18 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Johannes Schl&#252;ter's Blog: MySQL Query Analyzer and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16935</guid>
      <link>http://www.phpdeveloper.org/news/16935</link>
      <description><![CDATA[<p>
<i>Johannes Schl&#252;ter</i> has a new post to his blog today mentioning the beta release of the <a href="http://pecl.php.net/mysqlnd_ms">mysqlnd_ms plugin</a> (previously mentioned by <a href="http://phpdeveloper.org/news/16918">Ulf Wendel</a> and a new feature that can be plugged into the MySQL Enterprise Monitor to make the Query Analyzer directly use PHP instead.
</p>
<blockquote>
When running a PHP-based application with MySQL it is often quite interesting to see what actually happens on the database sever. Besides monitoring of the system load etc. it is often interesting to see what queries are actually executed and which of them are expensive. A part of MySQL Enterprise Monitor is the <a href="http://mysql.com/products/enterprise/query.html">MySQL Query Analyzer</a> which helps answering these questions.
</blockquote>
<p>
This was handled via a proxy that sat between the database and app server and ran through the queries looking for improvements. This new plugin keeps it closer to PHP itself without having to hit against the proxy. You can see the result in these <a href="http://schlueters.de/blog/uploads/screenshots/mem_quan_php1.png">two</a> <a href="http://schlueters.de/blog/uploads/screenshots/mem_quan_php2.png">screenshots</a> from inside the Manager application. You also have the side benefit of getting a stack trace of it running through the app to help you identify the spots most needing improvement in the code too.
</p>]]></description>
      <pubDate>Fri, 30 Sep 2011 12:56:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ulf Wendel's Blog: PECL/mysqlnd_ms compared to a classic]]></title>
      <guid>http://www.phpdeveloper.org/news/16918</guid>
      <link>http://www.phpdeveloper.org/news/16918</link>
      <description><![CDATA[<p>
<i>Ulf Wendel</i> has a new post that <a href="http://blog.ulf-wendel.de/?p=318">compares the performance</a> of a classic method for using the mysqlnd plugin in MySQL replication to <a href=http://de2.php.net/mysqlnd_ms">mysqlnd_ms</a>, the replication and load balancing plugin for the mysqlnd driver (that works with the mysql and mysqli functionality and is, as of <a href="http://phpdeveloper.org/news/16913">this beta</a> of PHP, the default driver for MySQL connections).
</p>
<blockquote>
Recently I was asked if <a href="http://de2.php.net/mysqlnd_ms">PECL/mysqlnd_ms</a> should be used to add MySQL replication support to a yet to be developed PHP application. The <a href="http://blog.ulf-wendel.de/php.net/mysqlnd">mysqlnd</a> plugin, which supports all PHP MySQL extensions (PDO, mysqli, mysql), stood up against a classical, simple, proven and fast approach: one connection for reads, one connection for writes. Let's compare. This is a bit of an unfair challenge, because PECL/mysqlnd_ms was designed as a drop-in for existing applications, not optimized for those starting from scratch, *yell*... The plugin stands up quite well, anyway!
</blockquote>
<p>
He starts with a look at the "classical pattern" of using a factory or singleton to make a database object instance that gives back different connections for reads versus writes (slave vs master). The mysqlnd_ms plugin allows you to define configuration settings to tell the queries to automatically go to certain places for different actions. For example, you could use "master_on_write" to tell it to use a master node if you're doing an INSERT or UPDATE versus a SELECT. He also shows a more complex example using a SQL hint and one issue that might come from the "human element" - not paying attention to database character sets.
</p>]]></description>
      <pubDate>Wed, 28 Sep 2011 08:43:57 -0500</pubDate>
    </item>
  </channel>
</rss>
