Ulf Wendel

2008/10/03
by admin
Comments Off on Kücken, die vergebens den Schnabel aufreissen

Kücken, die vergebens den Schnabel aufreissen

Ich habe gerade frei und räume die Festplatten auf. Beim Aufräumen fand ich auf diese Fotos von Jungtieren der Küstenseeschwalbe, welche vergebens den Schnabel aufreissen.

2008/09/19
by admin
1 Comment

PHP: New network traffic, CPU and memory savings with mysqlnd

BIT and CPU squeezing with Facebook, Tuenti and Andrey – for the die hard experts… The MySQL Client Server Protocol supports two flavours of sending database results to the client send as text and as binary. Unlike the text protocol, the binary protocol avoids converting data into strings whenever possible. For example, the binary protocol send a TINYINT column value as one byte and not as a length coded string of a length of one to four bytes. This saves CPU cycles on the server by avoiding a cast operation and it saves at least one byte of network traffic – sometimes. Furthermore, ext/mysqli will use an (PHP) integer variable instead of a string to hold the column value. This saves memory when caching database results in APC (see below for memcached). A MySQL server patch and an experimental mysqlnd branch allows you to use the binary protocol for all statements – not only prepared statements. Furthermore, you can get native types support even without touching the server.

Here is an example of the difference it makes to store a hash in APC which uses strings to hold integer values versus a hash that uses integers to hold the same integer values. If the hash would have been created by fetching results from MySQL using mysqli_query(), it would store all the integers using strings and it would require 102 kB. The same database result would require only 100 kB, if ext/mysqli would return integers as PHP integers and not as strings. Not a big deal, but this is just one example and even small differences can sum up. We have new fine tuning screws to play with…

$integers = array();
$strings = array();
for ($i = 0; $i < 169; $i++) {
  $integers[$i] = array($i, $i, $i);
  $strings[$i] = array((string)$i, (string)$i, (string)$i);
}

apc_clear_cache("user");

apc_store("integers", $integers, 10);
apc_store("strings", $strings, 10);

$info = apc_cache_info("user");
foreach ($info['cache_list'] as $details) {
	printf("Cache entry %-10s requires %d bytes\n", $details['info'], $details['mem_size']);
}

Cache entry integers   requires 100318 bytes
Cache entry strings    requires 102014 bytes

Continue Reading →

2008/09/05
by admin
Comments Off on Slides (german) from MySQL Connectors talk at the Hamburg MySQL Meetup

Slides (german) from MySQL Connectors talk at the Hamburg MySQL Meetup

On monday I gave a presentation at MySQL user group meeting in Hamburg on the team I’m working for: the MySQL Connectors team. The presentation was given in german. Unfortunately about 99.99999% of all PlanetMySQL had no chance to join the meetup, but you can find the slides (german language) here for download (PDF). The slides give an overview on the team, its products and its activties. You will also find introduction material on those Connectors (drivers) I am working on: Connector/OpenOffice.org, Connector/C++ and all the PHP stuff.

Continue Reading →

2008/08/29
by admin
1 Comment

Duo mit Kopfschmerzen

Unsere Duo war im früheren Leben eine Schrotflinte. Der Zylinderkopf zeigt deutliche Spuren von Geschossen. Wahrscheinlich gab es Tage an denen sich Kugellager aus dem Inneren des Motors sich ihren Weg nach draußen gebahnt haben. Die vermeintlichen Fluchthelfer sind der Zylinder und der Auspuff.

Zylinderkopf unter Beschuss

Der Motor ist im OP: Zylinder einschleifen, neuer Kolben, neue Kurbelwelle, neue Lager. Nach 30 Jahren und 5.500 Kilometern erblicken die Original DDR-Teile zum ersten Mal wieder die Sonne. Ob sie 1978 beim Einbau damit gerechnet haben ihren Lebensabend unter der Westsonne zu verbringen?

2008/08/21
by admin
Comments Off on (Not) Using OpenSolaris 2008.05 for Connector/OpenOffice.org development (I)

(Not) Using OpenSolaris 2008.05 for Connector/OpenOffice.org development (I)

While Andrey made good progress with the Connector/OpenOffice.org I wasted my time trying to use OpenSolaris 2008.05 as an OpenOffice.org development platform. OpenSolaris is not on the list of platforms used my the maintainers and developers of OpenOffice.org. Another open technology – JDK 1.5 – has lowered my openness towards new development platforms.

If you are an OpenOffice.org end-user, skip this blog posting: grab a binary package and be happy! That’s better for the world-wide climate because your power consumption will be lower. An Intel Core 2 Duo E6750 class PC needs some 4-6 hours to compile OpenOffice.org. As a plain vanilla user, its better for your notebook hard disk to use a pre-compiled binary. When Georg started his OpenOffice.org initiative he burned his notebook hard disk within short time. Burned means burned: overheated. OpenOffice.org is a monster: du -h […] 2,0G oo.org-m28/.

The posting might be of more interest for developers.

Continue Reading →

2008/08/05
by admin
Comments Off on MySQL Connector/C++ preview is available!

MySQL Connector/C++ preview is available!

A new MySQL product is born. The preview release of MySQL Connector/C++ is available for download at http://downloads.mysql.com/forge/connector_cpp_preview . Connector/C++ is a new database driver to connect C++ applications to the MySQL Server. The preview mimics parts of the JDBC 3.0 API and is licensed under the terms of the GPL (plus FLOSS License Exception). Have a look at the announcement and the MySQL Connector/C++ wiki page for further “official” information.

Motivation and Advantages

The Connector/C++ is based on an initial development from MySQL GUI team. The GUI team needed a C++ based connector with a JDBC like API. Andrey Hristov from the MySQL Connectors team had been assigned to take the initial code over from Vladimir Kolesnikov. He worked on it – to a different degree – over several months. Andrey is now the main developer of two Connectors for two of the five most common programming languages according to the TIOBE Programming Community Index – PHP and C++. Andrey, that is outstanding work! The TIOBE Index is in line with a MySQL quick poll asking for the primary programming language used for developing MySQL applications: C++ is very common and deserves a dedicated Connector.

Continue Reading →

2008/07/28
by admin
1 Comment

PDO_MYSQLND: The new features of PDO_MYSQL in PHP 5.3

PDO_MYSQLND is in the PHP CVS repository at php.net: PDO_MYSQL has been patched (PHP 5.3, PHP 6.0). Try out PDO_MYSQL with the MySQL native driver for PHP (mysqlnd). Its has new features.

Since Kaj’s announcement of the MySQL native driver for PHP (mysqlnd), we promised to to patch all three PHP MySQL extensions (ext/mysql, ext/mysqli and PDO_MYSQL) optionally support it. Almost exactly a year ago, on July 27th 2007, mysqlnd and updated versions of ext/mysql and ext/mysqli have been checked into the PHP 6 (HEAD) branch of the PHP CVS repository. PDO_MYSQL was the last extension to be upgraded. We have choosen PDO_MYSQLND as a working title for the upgrade PDO_MYSQL. On Monday, July 21st 2008, Johannes has committed the patch into the CVS with a short comment.


 Log:
  - Add mysqlnd support for PDO_mysql, fixes at least bug#41997,#42499,  pecl#12794, pecl#12401

Continue Reading →

2008/07/07
by admin
Comments Off on PDO_MYSQLND: Monday morning murders

PDO_MYSQLND: Monday morning murders

I am a member of the monday morning murder association. I murdered bugs. As said earlier, the modification of PDO_MYSQL to support both the MySQL native driver for PHP (mysqlnd) and the MySQL Client Library (AKA libmysql) is progressing. A good number of known and unknown bugs has been killed. But some new have been found as well – an overview.

Continue Reading →

2008/07/04
by admin
Comments Off on PDO_MYSQLND: Mighty multiple-queries and PDOStatement::nextRowset()

PDO_MYSQLND: Mighty multiple-queries and PDOStatement::nextRowset()

MySQLs multiple-queries feature makes it possible to run two or more SQL commands with one function call: SQL injections made easy. The PDO design is said to be optimized for security. For security reasons PDO has gone the stony road of prepared statements. If security matters, why does PDO_MYSQL explicitly enable multiple-queries? If portability matters, why do you use a MySQL specific feature?

Mighty multiple-queries feature: performance

Multi-statement is yet another example of how optimization works: trade in one feature (security) for another (performance). Sending several SQL command with one function call saves communication round-trips. You need only one round-trip for executing n > 1 SQL statements. This can be a mighty feature if you need to tune MySQL to the extreme. The price you pay is that you have to check carefully what SQL commands you send.

Continue Reading →