How did the MySQL ZRM do the job?: Difference between revisions

From wiki.zmanda.com
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 4: Line 4:


An example command displaying backup size and backup time for a backup set ''backupSet2'':
An example command displaying backup size and backup time for a backup set ''backupSet2'':
  # mysql-zrm-reporter  --fields backup-date,backup-level,backup-size,backup-time \
  # mysql-zrm-reporter  --fields backup-date,backup-level,backup-size,backup-time \
   --where backup-set=backupSet2
   --where backup-set=backupSet2
  ***************************************************************************
          backup_set backup_date                            backup_level  backup_size  backup_time
    backup-set  backup-date    backup-level backup-size    backup-time
-------------------------------------------------------------------------------------------------------   
  ****************************************************************************
          backupSet2  Sat 09 Sep 2006 10:00:37 AM PDT                    0     54.26 MB  00:00:33
    backupSet2  20060829140723  0           58MB            15 seconds.
          backupSet2  Sat 09 Sep 2006 10:01:41 AM PDT                    0     64.23 MB  00:00:50
    backupSet2  20060829140819  0           59MB            26 seconds.
          backupSet2  Sat 09 Sep 2006 10:03:30 AM PDT                    0     74.98 MB  00:01:03
    backupSet2  20060829141001  0           78MB            40 seconds.


 
Using [[mysql-zrm-reporter]] tool, you can figure out what backup method was used to do the backup (''backup-method-info'' report). You can override the backup method by setting backup parameters - ''replication'', ''logical-backup'', ''lvm-snapshot'' in MySQL ZRM configuration for the backup set.
Using [[mysql-zrm-reporter]] tool, you can figure out what backup method was used to do the backup (''backup-method-info'' report). You can override the backup method by setting backup parameters - ''replication'', ''logical-backup'', ''lvm-snapshot'' in MySQL ZRM configuration for the backup set.


Line 30: Line 30:


Example: Backup performance report
Example: Backup performance report
 
  # mysql-zrm-reporter --where backup-set=backupSet1 --show backup-performance-info
  # /usr/bin/mysql-zrm-reporter --where backup-set=backupSet1 --show backup-performance-info
  backup_set  backup_date     backup_level backup_siz  backup_time     read_locks_time  flush_logs_time                                                                    
  backup_set  backup_date   backup_level backup_size backup_time read_locks_time  flush_logs_time
  --------------------------------------------------------------------------------------------------------
  -------------------------------------------------------------------------------------------------
  backupSet1  Sat 09 Sep 2006            0   54.26 MB 00:00:33        00:00:12         00:00:08
  backupSet1  20060909100021 0           4.26 MB     00:00:06    00:00:03         00:00:00
            10:00:37 AM PDT
  backupSet1  20060909100123 0           4.26 MB     00:00:03    00:00:02         00:00:00
  backupSet1  Sat 09 Sep 2006            0   64.23 MB 00:00:50        00:00:21         00:00:10
  backupSet1  20060909100300 0           4.26 MB     00:00:03     00:00:02         00:00:00
            10:01:41 AM PDT
  backupSet1  Sat 09 Sep 2006            0   74.98 MB 00:01:03         00:00:29         00:00:09
            10:03:30 AM PDT

Revision as of 18:21, 22 September 2006

Did I use the correct method to backup?

The mysql-zrm-reporter tool provide backup statistics about the MySQL backup run. It is a good idea to review the backup-time, read-locks-time, flush-logs-time and backup-size to determine whether the method used by MySQL ZRM is appropriate for the backup set. The predefined backup-performance-info report is a useful tool to tune backup process or switch to a different backup method.

An example command displaying backup size and backup time for a backup set backupSet2:

# mysql-zrm-reporter  --fields backup-date,backup-level,backup-size,backup-time \
  --where backup-set=backupSet2
         backup_set  backup_date                             backup_level  backup_size  backup_time
-------------------------------------------------------------------------------------------------------  
         backupSet2  Sat 09 Sep 2006 10:00:37 AM PDT                    0     54.26 MB  00:00:33
         backupSet2  Sat 09 Sep 2006 10:01:41 AM PDT                    0     64.23 MB  00:00:50
         backupSet2  Sat 09 Sep 2006 10:03:30 AM PDT                    0     74.98 MB  00:01:03


Using mysql-zrm-reporter tool, you can figure out what backup method was used to do the backup (backup-method-info report). You can override the backup method by setting backup parameters - replication, logical-backup, lvm-snapshot in MySQL ZRM configuration for the backup set.

Can I make backups more efficient?

The time taken to do a backup (backup window) and backup image size depends on various factors:

  • Backup method used for each database - logical backups, raw backups, lvm snapshot, MySQL replication
  • Backup level for the backup set
  • Size of the database
  • Database activity - read-only, read/write ratio
  • Database transaction rates
  • Recovery requirements - how often do you recover data? What is the reason for data recovery?

Use mysql-zrm-reporter tool and mysql-zrm logs to analyze the backups. The backup-performance-info report is a good starting point to analyze the bottlenecks in the backup strategy. It is possible to change all the MySQL backup parameters using the configuration file. Often, it takes multiple backup runs to arrive at a good parameters for a backup set.

Example: Backup performance report

# mysql-zrm-reporter --where backup-set=backupSet1 --show backup-performance-info
backup_set  backup_date      backup_level  backup_siz  backup_time      read_locks_time  flush_logs_time                                                                      
--------------------------------------------------------------------------------------------------------
backupSet1  Sat 09 Sep 2006             0    54.26 MB  00:00:33         00:00:12         00:00:08
            10:00:37 AM PDT
backupSet1  Sat 09 Sep 2006             0    64.23 MB  00:00:50         00:00:21         00:00:10
            10:01:41 AM PDT
backupSet1  Sat 09 Sep 2006             0    74.98 MB  00:01:03         00:00:29         00:00:09
            10:03:30 AM PDT