O’Reilly MySQL Conference & Expo 2010 Keynote Vidoes

For those of us who were not able to attend this years Mysql Conference in Santa Clara, CA, the keynote videos have been posted online for your viewing pleasure!

UPDATE:

Here is a link to another location (Youtube), that has some more of the videos from the Mysql Conference, including the one given on Oracle to Mysql migration given by NPR’s own Joanne Garlow.

Raid Controller Caching Options

Here is a quick link to a blog post that talks about RAID caching for various database workloads.  The post also lists some of the popular RAID cards that are being put into use today, as well as  some interesting features that the author feels are missing from these current lineup of available RAID cards.

NPR developer talk at O’Reilly MySQL Conference and Expo 2010

Joanne Garlow one of the Senior developers here at NPR , will be giving a talk this Tuesday at the 2010 O’Reilly MySQL Conference and Expo in Santa Clara, CA.  The talk is entitled ‘Migration from Oracle to Mysql : An NPR Case Study’ and will focus on some of the ‘lessons learned’ during our recent Oracle to Mysql migration, it will also cover some of the tools that we found useful during the migration as well as some of the issues we encountered concerning character encoding and concurrency.

If you are thinking about converting your backend databases from Oracle to Mysql and you are attending this conference, you should attend this talk, as I am sure it will be very informative and quite helpful to you going forward.


Mysql slow log parsing with Maatkit

One of the tools that is included with Maatkit is called ‘mk-query-digest’.  If you have Mysql slow logging enabled, this perl script can me used to examine these entries, and provide a very useful and user friendly report that will help you understand the queries that are exceeding your current slow log threshold. You can then take the results and determine whether or not you have opportunity to do some schema and/or query optimization.

In order to get the ball rolling all you need to do is execute the following command:

‘perl /path/to/mk-query-digest /path/to/slow.log’

Once you do you will be presented with a report similar to the following:

# 200ms user time, 10ms system time, 9.59M rss, 11.17M vsz
# Overall: 199 total, 8 unique, 0.92 QPS, 3.44x concurrency ______________
#                    total     min     max     avg     95%  stddev  median
# Exec time           745s      1s     15s      4s      9s      3s      3s
# Lock time            4ms       0   159us    21us    66us    18us    16us
# Rows sent         16.35M       0 381.59k  84.16k 298.06k  81.83k  76.03k
# Rows exam         16.35M       0 381.59k  84.16k 298.06k  81.83k  76.03k
# Time range        2010-03-04 18:32:44 to 2010-03-04 18:36:21
# bytes             55.53k       6   7.67k  285.75  313.99  519.23  271.23

Continue reading

Modifying ethernet interface order in Debian

Sometimes after a fresh Debian Etch install  (I am not sure if this is fixed yet in Lenny or not), the order of your ethernet interfaces will be incorrect. You may also be in a position where you have more then two NIC cards and and you wish to swap eth0 and eth1 with eth2 and eth3, for consistency purposes for example.

In order to do so, you’ll need to make a change to the udev configuration file which controls which interfaces receive which names. You need to edit the following file:

‘/etc/udev/rules.d/z25_persistent-net.rules’

Simply make sure that you match the proposed interface with the correct MAC address and you are all set.

Go ahead and restart the server and you should be all set with the correctly labeled interfaces.

Subnet scanning with Nmap

If you are ever wondering which ip addresses on your network are currently being used, you can use nmap to find out.

For example to scan an entire class C subnet you can use the following command:

‘nmap -v -sP 192.168.1.0/24 |grep up’

This will produce a list of ip addresses which are currently being used.

You can also use this command to find a list of inactive ip addresses when you are looking to add devices to your network:

‘nmap -v -sP 192.168.1.0/24 |grep down’

Introduction to Maatkit

Maatkit is a group of perl scripts that provide advanced methods of administration for Mysql.

Here are a few of the more useful things that Maatkit allows you do to:

  1. Monitor MySQL replication delay
  2. Make a MySQL slave server lag behind its master.
  3. Ensuring slaves have the same data as masters
  4. Find duplicate indexes and foreign keys on MySQL tables.
  5. Execute SQL statements and print statistics.
  6. Execute queries on multiple servers and check for differences.

Here is the link to the Maatkit website which provides more details on each of the scripts.  I will be providing some real world examples of Maatkit usage in another post.

Percona patches for mysql 5.1

Percona has recently released some of their performance patches for Mysql 5.1.  Previous to these patches were only available for the 5.0.x codebase.

You can read more about it here. The link also provides from interesting benchmarks as well, pitting these patches vs the standard storage engine setup.

To be clear, these patches work against the built in version of Innodb with comes standard with the Mysql server.

You can xtradb if you wish to use some of the Percona patches that pertain to the Innodb plugin that is offered by Innobase

Streming media server

If you are looking for a way to stream media to either your xbox360 or your ps3 from a linux machine, then I highly recommend that you have a look at this project.  Ps3 Media Server is a java app that you can use to stream all kinds of content to either device.

I have been using it for almost a year now on Ubuntu and it has proven to be  extremely stable.

It also offers ‘on the fly’ transcoding which will allow you to play audio and video formats that might not be natively supported.

Here is the most well documented configuration guide I have come across while looking for tips and tricks.

Packet Loss with Cisco 3750

Over the last few weeks we have been encountering some strange networking issues at our off site data center.  The problem was characterized by slow ping times, packet loss, service timeouts, etc.  After checking all of the network devices on the outside facing link, we turned to the internal infrastructure, our new Cisco 3750 series routers.

After reviewing the configuration using the ‘show running-config’ command, we checked each of our bonded networking interfaces with ‘the show interface’ command to see if we could uncover any errors, dropped packets, etc.

Next we decided to check the switches available resources.  We used ‘show proc cpu’ in order to check the cpu usage.  This is when we saw the following line:

‘CPU utilization for five seconds: 97%/0%; one minute: 97%; five minutes: 98%’

We immediately knew that this is what we were looking for.  After contacting Cisco support…we learned that there exists an obscure bug in this version of IOS which causes this kind of behavior.  If you are interested in learning more about this specific issue, refer to Cisco bug ID ‘CSCsd95669’.

The only known fixes at this point are upgrade your version of IOS or restart your switch.  We have decided to restart the switch and monitor the cpu at regular intervals.  If this problem were to appear again, at that point we would obviously choose to upgrade.