MySQL Profiling

Database Profiling for MariaDB and Percona Server

Both MariaDB and Percona Server are forks of MySQL and strive to be drop-in replacements for MySQL from a binary, api compatibility, and command line perspective. It’s great to have an alternative to MySQL since you never know what might happen to it in the future.

The Setup

Installing both MariaDB and Percona Server onto test instances is pretty simple. This example uses two Red Hat Enterprise Linux (RHEL) servers running on Amazon Web Services (AWS).

Installing both MariaDB and Percona Server consists of setting up yum repository files (documented here and here) and running the yum installation commands. This takes care of getting the binaries installed so the rest of the process is related to starting and configuring the individual database servers.

The startup command for both MariaDB and Percona Server is “/etc/init.d/mysql start” so you can see that these products really do strive for direct drop in adherence to MySQL. As you can see in the screen grabs this example runs MariaDB 10.0.3 and Percona Server 5.5.31-30.3.

Screen Shot 2013-07-01 at 2.21.48 PM Screen Shot 2013-07-01 at 2.23.30 PM

Connected to each of these databases are 1 instance of WordPress and 1 instance of Drupal in a nearly “out of the box” configuration besides adding a couple of new posts to each CMS to help drive a small amount of load. his example doesn't set up a load testing tool so a high disk I/O load on each server was induced by running the UNIX command “cat /dev/zero > /tmp/zerofile”. This command pumps the number 0 into that file as fast as it can basically crushing the disk. (Use Ctrl-C to kill this command before you fill up your disk.)

The Profiling

Getting the profiling set up is really easy. Here a test instance of AppDynamics for Databases was used to remotely profile the Databases console and navigate to the agent manager.  Click the “add agent” button, and filled in the fields as shown below (Here MySQL as the database type):

Screen Shot 2013-07-01 at 3.39.47 PM

The remote agent didn’t connect the first time because in this example we forgot to configure iptables to let the connection through even though the AWS firewall rules had been set up properly (facepalm). After getting iptables out of the way (just turned off since these were test instances) my database monitoring connections came to life.

The Result

Taking a look at all of the data pouring into AppDynamics for Databases you can see that it is 100% compatible with MariaDB and Percona Server. There are no errors being thrown and the data is everything that it should be.

The beauty of the induced disk I/O load was that just by clicking around the web interface of WordPress and Drupal this example gets slow response times. Here are some screen grabs for each database type for you to check out…

MariaDB Activity

AppDynamics for Databases activity screen for the MariaDB database.

Percona Activity

AppDynamics for Databases activity screen for the Percona database.

MariaDB Explain Statement

Explain statement for a select statement in MariaDB.

Percona Explain Statement

Explain statement for a select statement in Percona.

MariaDB Statistics

A couple of statistics charts for MariaDB.

Percona Statistics

A couple of statistics charts for Percona.

If you’re currently running MySQL you might want to check out MariaDB and Percona Server. It’s possible that you might see some performance improvements since the storage engine for MariaDB and Percona is XtraDB as opposed to MySQL’s InnoDB. Having choices in technology is a great thing. Having a unified monitoring platform for your MySQL, MariaDB, Percona Server, Oracle, SQL Server, Sybase, IBM DB2, and PostgreSQL database is even better. Click here to get started with your free trial of AppDynamics for Databases today.