Professional Documents
Culture Documents
Who is Percona?
CONSULTING
SUPPORT
TRAINING
MAINTENANCE
.. for MySQL.
Who is Percona?
CONSULTING
SUPPORT
TRAINING
MAINTENANCE
.. for MySQL.
Who is Percona?
CONSULTING
SUPPORT
TRAINING
MAINTENANCE
.. for MySQL.
Who is Percona?
CONSULTING
SUPPORT
TRAINING
MAINTENANCE
.. for MySQL.
Who is Percona?
CONSULTING
SUPPORT
TRAINING
MAINTENANCE
.. for MySQL.
Todays Agenda
Percona products at 10 000 feet. A closer look at Percona Server with XtraDB. A closer look at XtraBackup. A quick look into the future. Finding more information.
Percona Server?
Official Oracle Product MySQL Server The InnoDB Storage Engine (Plugin edition) InnoDB Hot Backup License GPL/Commercial GPL/Commercial Commercial
Official Percona Product Percona Server The XtraDB Storage Engine XtraBackup
Current releases are based on MySQL 5.1. Earlier releases based on MySQL 5.0 are available.
Contains all of the great work of the MySQL engineering team + additional enhancements on top.
XtraDB is..
We ship Percona Server 5.1 with XtraDB included. You dont have to download it separately, or do anything special to enable it.
XtraBackup is...
An re-implementation of InnoDBs hot backup utility. XtraBackup can backup MyISAM, Archive and InnoDB tables. It can backup MySQL, Percona and MariaDB servers.
A fork or a spoon?
We change the name to help users identify our distinctively different set of features. ~30K lines changed out of millions. We rebase off newer ofcial MySQL releases. License remains as GPL (Open Source). Compatibility is maintained.
A word on compatibility:
The le format between MySQL with InnoDB to Percona Server with XtraDB does not change.* XtraDB identies itself as InnoDB:
ALTER TABLE my_table ENGINE=INNODB; or CREATE TABLE my_table (a INT) ENGINE=INNODB; still works!
If you want to revert back, just remove the Percona Packages and install MySQL packages.
Both Debian/Red Hat packages dont remove the data directory when you remove the programs.
Compatibility (cont.)
When you connect from your PHP/Python/Perl/C/C++/ Ruby/.NET/<insert other language> application to Percona Server, you do not need to make any special changes. Your application just sees MySQL on port 3306. Really, nothing here changes.
10
Todays Agenda
Percona products at 10 000 feet. A closer look at Percona Server with XtraDB. A closer look at XtraBackup. A quick look into the future. Finding more information.
11
Release Model
Short release cycle. Changes are mostly incremental enhancements. i.e. Version number should be reads as:
Percona-Server-server-51-5.1.52-rel11.6.140.rhel5.x86_64.rpm
Major MySQL Version (MySQL 5.1) Minor MySQL Version (MySQL 5.1.52)
12
Releases History
So what changes?
14
Performance Improvements
Improved Buffer Pool Scalability Separate location of double write buffer* Improved IO Path + adaptive checkpointing Transaction logs larger than 4G supported.
Faster Crash Recovery Insert buffer controls Separate purge thread Completely disable the query cache. Faster page checksums* Strip comments before using query cache
Data dictionary memory consumption controls Support for different page sizes*
15
* Changes on disk format. Must use mysqldump to revert to regular MySQL releases.
Consistency of timing is also more important than raw throughput. Without diagnostics, you wont get what you are entitled to.
An earlier benchmark showing Performance of XtraDB 9.x versus regular MySQL releases. Higher is better. Newer benchmarks are available at http://www.percona.com/ software/benchmarks/
16
Stability of results
A lot of engineering work has been done to minimize variance. Sharp drops in MySQL releases are caused by checkpointing activities.
17
Usability Enhancements
Show data dictionary Show contents of the buffer pool Save index statistics between restarts Import / export of buffer pool contents Bug fixes - ahead User / Index / Table statistics of time Disable automatic statistics regeneration Transactional Replication Advise in processlist when waiting on Query cache mutex. Improved slow query log Log connection errors Import / export of innodb_file_per_table tables Deadlock counter Retain query response time distribution.
18
$ mysql -e SET GLOBAL log_slow_verbosity = full; Percona Server $ tail /var/log/mysql.slow .. # Time: 100924 13:58:47 # User@Host: root[root] @ localhost [] # Thread_id: 10 Schema: imdb Last_errno: 0 Killed: 0 # Query_time: 399.563977 Lock_time: 0.000110 Rows_sent: 1 Rows_examined: 46313608 Rows_affected: 0 Rows_read: 1 # Bytes_sent: 131 Tmp_tables: 1 Tmp_disk_tables: 1 Tmp_table_sizes: 25194923 # InnoDB_trx_id: 1403 # QC_Hit: No Full_scan: Yes Full_join: No Tmp_table: Yes Tmp_table_on_disk: Yes # Filesort: Yes Filesort_on_disk: Yes Merge_passes: 5 # InnoDB_IO_r_ops: 1064749 InnoDB_IO_r_bytes: 17444847616 InnoDB_IO_r_wait: 26.935662 # InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000 # InnoDB_pages_distinct: 65329 SET timestamp=1285336727; select STRAIGHT_JOIN count(*) as c, person_id FROM cast_info FORCE INDEX(person_id) INNER JOIN title ON (cast_info.movie_id=title.id) WHERE title.kind_id = 1 GROUP BY cast_info.person_id ORDER by c DESC LIMIT 1;
19
$ mysql -e SET GLOBAL profiling_server = 1; $ tail /var/log/mysql.slow .. # Query_time: 4.555235 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0 Rows_affected: 0 Rows_read: 1 # Profile_starting: 4.554799 Profile_starting_cpu: 0.000000 Profile_checking_permissions: 0.000095 Profile_checking_permissions_cpu: 0.000000 Profile_Opening_tables: 0.000088 Profile_Opening_tables_cpu: 0.000000 Profile_init: 0.000056 Profile_init_cpu: 0.000000 Profile_optimizing: 0.000046 Profile_optimizing_cpu: 0.000000 Profile_executing: 0.000098 Profile_executing_cpu: 0.000000 Profile_end: 0.000049 Profile_end_cpu: 0.000000 Profile_query_end: 0.000045 Profile_query_end_cpu: 0.000000 Profile_freeing_items: 0.000084 Profile_freeing_items_cpu: 0.000000 Profile_logging_slow_query: 0.000045 Profile_logging_slow_query_cpu: 0.000000 # Profile_total: 4.555405 Profile_total_cpu: 0.000000 insert into teee4 select * from teee4 limit 10000000;
20
mysql> SET GLOBAL userstat_running = 1; Percona mysql> SELECT DISTINCT s.TABLE_SCHEMA, s.TABLE_NAME, s.INDEX_NAME FROM information_schema.statistics `s` LEFT JOIN information_schema.index_statistics IS ON (s.TABLE_SCHEMA = IS.TABLE_SCHEMA AND s.TABLE_NAME=IS.TABLE_NAME AND s.INDEX_NAME=IS.INDEX_NAME) WHERE IS.TABLE_SCHEMA IS NULL; +--------------+---------------------------+-----------------+ | TABLE_SCHEMA | TABLE_NAME | INDEX_NAME | +--------------+---------------------------+-----------------+ | art100 | article100 | ext_key | | art100 | article100 | site_id | | art100 | article100 | hash | | art100 | article100 | forum_id_2 | | art100 | article100 | published | | art100 | article100 | inserted | | art100 | article100 | site_id_2 | | art100 | author100 | PRIMARY | | art100 | author100 | site_id | ... +--------------+---------------------------+-----------------+ 1150 rows IN SET (1 min 44.23 sec)
Server
21
Usability (cont.)
Internal locking on the query cache is a major problem on multi-core servers. Wonder if youre waiting on the Query Cache?
22
23
Export the contents of the buffer pool to a le called ib_lru_dump in the data directory:
SELECT * FROM information_schema.XTRADB_ADMIN_COMMAND /*! XTRA_LRU_DUMP*/; SELECT * FROM information_schema.XTRADB_ADMIN_COMMAND /*! XTRA_LRU_RESTORE*/;
Restored ib_lru_dump:
24
Note: Not the actual contents - it takes 8 bytes to remember the address of a 16K page.
To summarize
Many MySQL users are not getting the performance they are entitled to.
They lack visibility into internal operations of MySQL. Giving a 50% improvement through new features sounds nice. What they dont realize is theyre losing 100% by not being aware.
25
Todays Agenda
Percona products at 10 000 feet. A closer look at Percona Server with XtraDB. A closer look at XtraBackup. A quick look into the future. Finding more information.
26
mysqldump
mysqldump
Filesystem Snapshot (LVM) ALL MOSTLY HOT SYSTEM SYSTEM SLOW-MED BEST HIGH YES
XtraBackup /InnoDB Hot Backup INNODB HOT TABLE TABLE FAST BEST LOW YES
XtraBackup /InnoDB Hot Backup ALL WARM TABLE TABLE FAST BEST LOW YES
MySQLHotc opy MyISAM WARM TABLE TABLE FAST BEST MED YES
Cold Backup ALL COLD SYSTEM SYSTEM BEST BEST N/A YES
Engines Warmth Flexibility of Backup Flexibility of Restore Backup Time Restore Time Impact of Backup Binary log Coordination
27
If your off-peak load is not six times less than your peak load, this may result in a need to over-provision.
28
Engines Warmth Flexibility of Backup Flexibility of Restore Backup Time Restore Time Impact of Backup Binary log Coordination
Mysqldump may be faster in a few cases. Concern yourself more with recovery time and impact.
29
http://www.mysqlperformanceblog.com/2010/11/08/anargument-for-not-using-mysqldump-in-production/
XtraBackup is...
Restore is as simple as moving the backup to your datadir. It causes the least impact while creating the backup - and is only blocking while backing up MyISAM tables.
30
31
32
Advanced Features
Backup to a stream (can be copied straight across the network, or fed through a compression program). Throttle to only a limited number of IOPS. Incremental backup.*
33
* Some special restrictions apply. Data Definition must not have changed since last backup.
34
http://www.mysqlperformanceblog.com/2009/09/14/statisticsof-innodb-tables-and-indexes-available-in-xtrabackup/
Todays Agenda
Percona products at 10 000 feet. A closer look at Percona Server with XtraDB. A closer look at XtraBackup. A quick look into the future. Finding more information.
35
MySQL 5.5
A greatly improved focus on performance. Some additional diagnostic/usability features. Work has already began porting features. We will continue to maintain our 5.1 series.
36
Our Blueprints are publicly available through LaunchPad: https://blueprints.launchpad.net/percona-server Percona Server with XtraDB R12.1 is now a release candidate.
It will include the ability to store the buffer pool in shared memory and built-in response time distribution stats. It will also feature HandlerSocket.
37
XtraBackup Plans
http://www.percona.com/docs/wiki/perconaxtrabackup:xtrabackup:option-and-variablereference#parallel
This is very helpful for RAID controllers and some SSDs, which require multiple threads to exploit their capacity.
38
Feature development is customer-driven. Commercial Support and Maintenance for Percona Server, XtraDB and XtraBackup are available.
http://www.percona.com/support/mysql-supportmaintenance/
39
Seeking sponsorship of parallel replication: http://www.mysqlperformanceblog.com/2010/11/08/ implementing-parallel-replication-in-mysql/ We need to get more customers involved, to share the cost of this large and ambitious project.
40
Expert technical advice. Insurance against bugs in MySQL. Customized server binaries.
41
Todays Agenda
Percona products at 10 000 feet. A closer look at Percona Server with XtraDB. A closer look at XtraBackup. A quick look into the future. Finding more information.
42
Getting Started
Percona Server with XtraDB and XtraBackup are free software released under the GPL license.
43
Training Classes
Chicago
Tuesday, 01 Feb 2011 to Friday, 04 Feb 2011
London
Monday, 21 Feb 2011 to Thursday, 24 Feb 2011
Frankfurt
Monday, 28 Feb 2011 to Thursday, 03 Mar 2011
See www.percona.com/training to register. Private training and combined onsite consulting/training is available.
44
Any Questions?
Slides and a recording will be made available after this presentation.
45