Tuesday, January 24, 2012

I'm speaking at the MySQL Conference And Expo 2012!

Percona Live MySQL User's Conference, San Francisco, April 10-12th, 2012Hello Everyone,

I'm very pleased to announce that my submission to talk at the Mysql Conference And Expo 2012 has been accepted! I'll be giving a talk entitled "Introducing XtraBackup Manager", which, as the title suggests, will serve as an introduction to XtraBackup Manager.

I'll be covering what it is, how it works and its features as well as reserving some time for Q+A.

If you are interested in learning more about this tool and plan to attend the conference, this will be a great way to get started!

I hope to see some of you there in April!

For more info on the conference, click here.

Cheers,
Lachlan

Thursday, January 5, 2012

XtraBackup Manager Pre-Release v0.8 - Try it out today!

Aloha Everybody!

I'm happy to announce XtraBackup Manager Pre-Release v0.8!

Now that XtraBackup 1.6.4 is released and I have completed some of my final show-stopper bug fixes, I feel that XtraBackup Manager is now in a state ready for more general consumption.

I have yet to package up tarballs, but the Quick Start Guide in the Project Wiki contains all the steps you should need to get up and running from the svn trunk.

There is also some great detailed documentation, including diagrams of all of the different Backup Strategies here.

So please, check out the Project and take it for a spin -- if you have problems or questions, join the discussion on the XtraBackup Manager Google Group!

Thanks and Happy 2012!!

Note: Release notes for XtraBackup v0.8 can be found here.

Lachlan

Friday, December 2, 2011

XtraBackup Manager - XtraBackup Throttling

Hello again!

This week I have been spending some time adding support for throttling to XtraBackup Manager as it has been considered a pre-requisite for us using the tool against our production databases.

In order to add support for throttling, the first thing I did was to look into what kind of means are available to throttle.

It seems there are two methods, both of which are mentioned in Percona's docs or blogs.

#1. Use the --throttle=N parameter. You can give this to innobackupex or to xtrabackup directly. According to the documentation this will limit xtrabackup to use N IOPs/sec when running in --backup mode.

For local machine backups this means N total read/write IOPS/sec and for incrementals this simply means N read IOPS/sec. When using streaming mode --throttle does not take effect (see #2).

#2. Use a nifty tool called "pv" (Pipe Viewer). It has a few features, but most notably it can be use as a simple rate limiter in your pipeline. An example:

shell> cat myFile | pv -q -L10m > myFileCopy

The above will limit the speed at which the file is "cat" into myFileCopy to 10 megabytes a second. Assuming of course the IO subsystem can reach at least that speed.

The best application for pv is to place it somewhere in the pipeline of your streaming backups to limit the rate at which things can flow through the pipeline.

Eg.

shell> innobackupex --stream | pv -q -L10m | nc targetHost 10000

The above will stream through pv and limit the maximum throughput to 10 megabytes/second.

So now understanding what rate limiting methods are available, I needed to consider in what ways XtraBackup Manager uses XtraBackup and the best way to implement the throttling.

I know that:

a) XtraBackup Manager always uses streaming mode when it takes a full backup, so the only option to use there is #2, pv.

b) When performing an incremental backup, XtraBackup Manager will always have xtrabackup stage the deltas locally, before using netcat (nc) to shuttle the data back over the network to the backup host for storage. In this case, limiting using pv is not really useful, because xtrabackup is going to chew up as much IO as it can while calculating the deltas, so we need to opt for the --throttle option on xtrabackup.

So once I understood that I'll need to actually implement throttling in two ways in XtraBackup Manager, I thought about how I would present it to the user for configuration.

I personally find it a bit annoying and confusing that I have to think in two units of measurement for different situations, so I wanted to see if I could insulate the user from that.

My aim was to see if I could present the user with a single configurable for the throttle on a backup task. After all, you don't care what type of backup is going on, you just want to say "Don't use more IO than this much…".

So in order to achieve this, I needed to understand the relationship between the two options as well as the characteristics of IO in both cases.

From my understanding, if you are taking a full backup, you are simply streaming each file sequentially - so we are talking about sequential reads here.

If we are talking about incrementals, we basically give xtrabackup a log sequence number and say "check all the pages and copy ones with a log sequence number above the one we gave" -- so we're finding the pages that have been changed since the given log sequence number.

In this case, it should also be a sequential read, as we're scanning pages end to end, and just checking the log sequence number.

So in both cases it seems we're talking about sequential reads.

When using pv, we're already dealing in a term that is easy to understand and fairly non-subjective. A rate limit in megabytes/sec of sequential read is straight forward.

Now when we're dealing with the --throttle option and thinking in IOPS we have some more to think about. Firstly, how big is an IOP?

Since I'm no good at reading C source code, I opted for the black box method of investigation and simply took an idle database server and started running xtrabackup against it with various --throttle values, while watching iostat on the data mount.

Here are some results:

Throttle value vs Observed disk throughput MB/sec

1:3 MB/sec
2:4 MB/sec
3:5 MB/sec
4:6 MB/sec
5:7 MB/sec

Interestingly the pattern I observe is: throughput = N+2

My best interpretation after even attempting a little digging into xtrabackup.c is that on this idle system we are limiting xtrabackup to 1 x 1MB IOP per second to scan the InnoDB data files, plus we burn 2MB per second to scan/copy the InnoDB log so that it can be applied later.

Now the catch 22 in this whole thing is that I'm observing this on an idle system, so this 2MB per second of log IO would increase if there is more log activity -- surely on a busy system you would need to read more than 2MB of logs every second to keep up.

The catch part? If I actually make the system busy, I can no longer determine where all the different IO in iostat is coming from, so I can't determine how much IO xtrabackup is now using. I'm sure there is a better way to instrument that per process, but unfortunately it extends beyond my personal skill set right now.

In blogging this, I'm hoping someone reading this can help with ideas or clarification...

So coming back to how I should implement the throttling -- I'm fairly sure that IOPS are 1MB in xtrabackup and pv also allows me to throttle in MB/sec, so I should be able to give one simple "throttle" configurable to the XtraBackup Manager user and tell them it limits in MB/sec.

The question then becomes, should I adjust the value I pass to --throttle for XtraBackup to account for this "at least 2MB used for log scanning"?

I decided I wanted to try to be clever and go ahead and adjust it -- so the value passed to XtraBackup for --throttle is now adjusted -2. If the adjustment gives a throttle value less than 1, it is simply given as 1.

None of this is set in stone -- I'm still testing and experimenting, but I'm curious to know your thoughts.

Can anyone shed light on what xtrabackup is doing ?

Should I bother adjusting this value or not ?

Cheers,
Lachlan

Tuesday, November 22, 2011

XtraBackup Manager - Exciting progress!

Hi Folks,

Just another quick update.

I've been working really hard these past couple of weeks on getting what I'm hoping is some great documentation happening for XtraBackup Manager.

There is still more work to be done, but I'm really pleased with how it's coming along.

Stay tuned… awesome things are coming :)

Meanwhile, to those of you who celebrate Thanksgiving this week -- have a safe and happy holiday, however you choose to spend it!

Cheers,
Lachlan

Tuesday, November 8, 2011

XtraBackup Manager - Coming soon!...

Howdy everyone!

I'm very happy to announce that very soon XtraBackup Manager will be released in an initial alpha capacity.

The command-line configuration and management interface is very close to completion and I'll be working on some documentation soon too.

This alpha will serve as a way to get some early adopters testing the tool as well as help collate feedback on necessary features that I may have missed including so far.

Stay tuned!…

The first completely FREE/OSS management software for XtraBackup will be available soon!

Cheers,
Lachlan

Friday, September 23, 2011

XtraBackup Manager - What have I been up to!?!

Howdy all,

Just a quick update in the world of XtraBackup Manager development. In the last couple of weeks I have not been doing a great deal of work on XtraBackup Manager itself, but rather doing a lot of testing of XtraBackup Manager and implicitly XtraBackup along with it.

I hit upon some bugs that were basically roadblocks in the way that we intend to use XtraBackup and I'm sure issues that other folks will run into eventually once adoption of XtraBackup increases even more...

I have been working with Percona and SkySQL Support, as well as dabbling in some of the code myself to get fixes for these issues.

The main issues we hit were:

* tar4ibd crashes on certain InnoDB data files (unable to use streaming backups at all) - This was a regression in pre-release build of xtrabackup-1.6.3, For now "fixed" by using an older tar4ibd binary from stable 1.6.2 release.

* innobackupex would not capture MySQL slave position unless using FLUSH TABLES WITH READ LOCK and performing a full backup. Now slave position can be captured in incrementals or full backups without locks, provided that --safe-slave-backup is specified.

* Tables getting both DROP/CREATE or TRUNCATE during backup can cause assertion failure - SkySQL contributed a fix via Monty Program which I am ready to test now.

* Xtrabackup apply-log can crash when attempting to create temporary tables if the temp dir does not exist - Should be fixed very soon in xtrabackup-1.6.3 release.


When I decided to embark on the project for XtraBackup Manager, I was happy to think that finally I'll be able to give something back to the community in the tool that I make. It seems what I didn't consider was that in being such a heavy integrator with XtraBackup that I'd also be contributing some good QA and perhaps improvements to XtraBackup itself.

As an aside, I also found a couple of little issues in Shlomi's online alter table in the OpenArk toolkit and submitted patches for that -- so I've felt very contributive lately.

So what lies ahead?

More testing of XtraBackup and XtraBackup Manager as well as finishing off the command-line configurator.

Then we will be preparing to start eating my dog food and run XBM in production!

That's it for now...

Have a great weekend all!

Cheers,
Lachlan

Thursday, September 1, 2011

XtraBackup Manager - Command-line Configurator Preview!

Over the past two weeks I have been working on XtraBackup Manager as much as I can and I'm pleased to say that the command-line configurator is coming along very nicely!

There is now a generic "xbm" command that will be the way to manage hosts, storage volumes and backup schedules as well as doing restores, etc.

So far I have built the volume and host management in and will begin work on the backup schedules next!

Once this command-line interface is complete, I'll work to document it on the project wiki on Google Code and it should be ready for public consumption.

Here is a little preview of how it looks in action - forgive the ugly wrapping…


xbm@mslvlxbp01:~/xtrabackup-manager$ ./xbm

XtraBackup Manager v0.5 - Copyright 2011 Marin Software

Error: Context missing.

Usage: xbm <context> <action> <args> ...

Contexts and actions may be one of the following:

volume [add|list|edit|delete] <args>             -- Manage Backup Volumes
host [add|list|edit|delete] <args>               -- Manage Hosts to Backup
backup [add|list|edit|delete] <args>             -- Manage Scheduled Backup Tasks
snapshot [list|delete]                           -- Manage Backup Snapshots
restore [local|remote] <args>                    -- Restore Backups

You may specify only a context, or a context and action to get help on its relevant arguments.



xbm@mslvlxbp01:~/xtrabackup-manager$ ./xbm volumes    

XtraBackup Manager v0.5 - Copyright 2011 Marin Software

Error: Action missing.

Usage: xbm volumes <action> <args> ...

Actions may be one of the following:

  add <name> <path>                      -- Add a New Backup Volume
  list                                   -- List available Backup Volumes
  edit <name> <parameter> <value>        -- Edit a Backup Volume to set <parameter> to <value>
  delete <name>                          -- Delete a Backup Volume

You may specify an action without parameters to get help on its relevant arguments.

xbm@mslvlxbp01:~/xtrabackup-manager$ ./xbm volumes list

XtraBackup Manager v0.5 - Copyright 2011 Marin Software

-- Listing all Backup Volumes --

Name: Storage Array 1   Path: /backup/xbm
Name: Test /backup      Path: /backup


xbm@mslvlxbp01:~/xtrabackup-manager$ ./xbm volumes add MyVolume /tmp

XtraBackup Manager v0.5 - Copyright 2011 Marin Software

Action: New volume created with name/path: MyVolume -- /tmp