Friday, November 18, 2011

Wordpress from a MySQL DBA view

Wordpress is a very popular Content Management System, usually built on top of a MySQL Database. Recently I attended a local Wordpress user group an that started me wondering what the database tables look like. So I installed a new Wordpress installation on a Ubuntu test box running MySQL 5.6.2.

Wordpress creates eleven tables: wp-commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_terms, wp_usermeta, and wp_users.

MySQL Workbench generated an EER Model you can see nearby. The first thing that caught me eye was the use of unsigned BIGINTs in every table as keys. Usually you want to use the smallest data type you can for keys. The smaller the key, usually the fast the system can evaluate it. But then maybe there are blog out there that need 18,446,744,073,709,551,615 posts or authors or links.

Hmm, can I start a side business making Wordpress faster by converting all those BIGINTs for those who only to expect 4,294,967,295 posts??

Since I am using MySQl 5.6, the table formats defaulted to InnoDB. Some plugins for Wordpress require full-text search indexes which is now available in the 5.6 preview release.

Wednesday, August 31, 2011

MySQL for Oracle DBAs, or How to Speak MySQL for Beginners

I will be speaking at Oracle Open World on MySQL for Oracle DBAs, or How to Speak MySQL for Beginners on Tuesday, October 4th in the Golden Gate B room in the Marriot Marquis. And at the same time down the hall, Sunny Bains will be presenting on InnoDB Performance Tuning. And just a short time later there will be a MySQL Community Reception.

Sunday, August 14, 2011

Bem-vindo ao Meetup MySQL Brasil!

For those of you in around Sao Paulo this week, Aiton Lastori send me the following:

Next week we will host a MySQL Happy Hour at Oracle's Sao Paulo office.
We are exited because there are room for 100 people and over 500
subscribed! Oracle marketin provided the money for the free beer and Ana, our lead dev in Brazil, and is doing an amazing job organizing
everything. I've created a group in

Tuesday, July 5, 2011

FISL12 -- Open Source show with Music and Dancing in Brazil.

Not so long ago, it was easy to judge a technical conference by the number of small screwdrivers1 you picked up as swag from the show. Open source shows usually have similar elements in common with each other like someone in a penguin costume, at least one guy in a kilt2, piles of Linux distro CDROMs, and bonus points for either Mad Dog or Linus in person. Last week I was in Porto Alegre, Brazil for FISL where they had all that plus folk songs and dancing3. They really raised the bar for open source shows.

The MySQL Community is large, vibrant, and inquisitive. Davi Arnaut, one of our developers who lives in the North of Brazil, presented on MySQL 5.5 and 5.6 to a full room. I was in the Oracle booth answering questions about new features, workbench and the Enterprise edition. During the four days, there was a constant flow to the booth and we got to meet many developer and students who rely on MySQL.
I enjoyed meeting all the 'MySQ-elle' users at FISL.

And next year I will have more MySQL swag for the attendees. The stickers and t-shirts were popular and went quickly.

  1. Philips head, flat head or the rare Allen head.
  2. Usually a Ultilikilt
  3. Most of the show attendees on the floor were gathered around the booth for a local restaurant belting out songs.

Friday, May 20, 2011

Performance tuning -- option files from the distribution and a simple benchmark

Hopefully you are caught up on the recommended reading from the last post as today we will look at creating a simple benchmark using a common tool to determine which option file to use. The MySQL server will use default values if it can not find an option file. Under the /usr/local/mysql/support-files for MySQL 5.6 are eight1
sample configuration files that can be renamed and dropped in place as a staring point. See the Using Option File page for details.

But these files have not kept pace with hardware. For instance, a small system is listed as being under 64m of memory while huge is 1-2G. More modern settings will be covered in a later post but we can use these files in a simple test on a fairly simple test machine2.

So how do we know which configuration is the best for the environment? A simple test will be run that accesses the database on the system and the time will be recorded. Usually you want to use a test that as closely mimics your 'normal' load but this is an introductory series and we will grow into more rigorous tests. Testing these various configuration files was done with mysqlslap and the next post will go into details on mysqlslap and how to use it with queries from your logs.

A simple mysqlslap test was run3 and the times recorded. The various option files were copied to /etc/mysql/my.cnf, mysqld_safe --user=mysq& was used to start the server, and then the test was run. We change one variable, the option file, repeat the test, and not the differences.

Config fileAvg Run Time
InnoDB Heavy1.526

So the system with 1.5G of memory runs best on the option file designed for system with 1-2G of memory! That result will probably not shock too many people. This was an overly simple example and next time we will go a bit deeper on using mysqlslap and then start to look at some other tools. Then we will create a simple web based application for testing.

To be continues

Next time: Using your data with mysqlslap

  1. Three files for Windows: config.small.ini, config.medium.ini, and config.huge.ini and five for UNIX-like systems: my-small.cnf, my-medium.cnf, my-large.cnf, my-huge.cnf, and my-innoidb-heavy-4g.cnf
  2. The test box is a IBM Thinkpad R50e that I use for testing and runs a recent version of Fedora with 1.5G of memory.
  3. mysqlslap --auto-generate-sql --concurrency=100

Thursday, May 19, 2011

Performance tuning basics

I have been getting a lot of questions about performance tuning this month. So this will be the first in a series on the basics.

Go get your copies of High Performance MySQL: Optimization, Backups, Replication, and More and MySQL Administrator's Bible1 and read up on benchmarking. Also take a peek at George Trujillo's MOCA. These readings will provide you with a overview of the methods and approaches you will see in later entries. The goal is to get a baseline measurement so that a change can be evaluated as an improvement or a determent.
Then do a fresh install of MySQL server on a non production system.

And lastly get a copy of your new installation's option file, usually my.cnf or my.ini for Windows systems. But do not be surprised if your system does not have one.

To be continued

Next time: A simple test using mysqlslap

1. You should have need to have copies of these books in your library.

Friday, May 6, 2011

MySQL Lunch-n-Learn

MySQL Lunch-n-Learn is not a new performance schema table or a new BLOB data type for Chef Gordon Ramsey. It is where a MySQL engineer comes to your office bringing lunch to talk about the most popular open source database. I was asked to participate in one this morning at a major company headquartered in Dallas. The company wanted some information on updates to the MySQL server, a comparison between InnoDB and MyISAM, and some company specific questions.

It is often hard to get new product news to our users and this program provides us with a way to answer specific questions. And the customer gets to select the agenda items to make certain they get what they need form this event.

So if you want to get the latest on MySQL 5.6, Memcahched-to-InnoDB, or replication strategies, use the link at the top of this entry to set up your Lunch-n-Learn.

Wednesday, May 4, 2011

Dallas MySQL Users Meeting May 10th

May 10th meeting -- Join us for a presentation on the new features in MySQL 5.6

Tuesday May 10th 4:30 PM to 6:00 PM (doors lock at 5PM)

Please RSVP!

Refreshments provided!!
Oracle Offices
7460 Warren Parkway
Suite 300.
Frisco, TX 75034

Tuesday, May 3, 2011

OTN MySQL Developer Day in Santa Clara

Today is the MySQL Developer Day in Santa Clara. We have a full day of sessions on everything from basics to performance tuning.

Tuesday, April 26, 2011

OTN MySQL Developer Day in Santa Clara-- RSVP before the seats are all gone!

The OTN MySQL Developer Day in Santa Clara is one week away. Be sure to register as space is going fast.

Get the Technical Know-how to Succeed with the World’s Most Popular Open Source Database

MySQL is the world’s most popular open-source database, and powers websites and applications of numerous leading and fast-growing organizations.

The OTN Developer Day MySQL is a one-stop shop for you to learn all the essential skills about MySQL. In this free, one-day seminar, we will cover everything you need to know to successfully design, develop, and manage your MySQL databases. You’ll also learn the guidelines and best practices in performance tuning and scalability.

Attend this event and gain the knowledge to:

  • Develop your new applications cost-effectively using MySQL
  • Improve performance of your existing MySQL databases
  • Manage your MySQL environment more efficiently
Don’t miss this exclusive opportunity to network with your peers, and hear the tips and tricks from the MySQL experts at Oracle. No matter you’re a DBA or a developer, come find out how you can make the best of MySQL in your IT infrastructure.
8:00 a.m. – 9:00 a.m. Registration
9:00 a.m. – 10:00 a.m. Keynote: MySQL Essentials
10:00 a.m. – 11:00 a.m. Session: MySQL Replication and Scalability
11:00 a.m. – 11:15 a.m. Break
11:15 a.m. – 12:15 p.m. Session: MySQL on Windows
12:15 p.m. – 1:00 p.m. Lunch
1:00 p.m. – 2:00 p.m. Session: MySQL Performance Tuning
2:00 p.m. – 3:30 p.m. Hands-On Lab: MySQL Administration and Management Tools
3:30 p.m. – 4:00 p.m. Raffle and Closing