Boosting Performance and Scalability With The Innodb Upgrade For Mysql 5.1
Boosting Performance and Scalability With The Innodb Upgrade For Mysql 5.1
Boosting Performance and Scalability With The Innodb Upgrade For Mysql 5.1
Table of Contents 1 Executive Summary ..............................................................................................................3 2 Overview of the MySQL Database Server...........................................................................3 2.1 The MySQL 5.1 Storage Engine Architecture....................................................................3 3 MySQL 5.1 and the InnoDB Upgrade ...................................................................................5 3.1 Improved Performance, Scalability and Throughput..........................................................6 3.2 Performance Comparisons ................................................................................................6 3.3 Improved Manageability and Efficiency .............................................................................8 3.4 Improved Uptime and Reliability ........................................................................................9 4 Optimizing Performance, Security and Availability with MySQL Enterprise.................10 5 Conclusion ...........................................................................................................................10 6 Learn More ...........................................................................................................................11
1 Executive Summary
MySQL used in conjunction with the InnoDB storage engine is a consistently high-performing and scalable transactional database. However, this server architecture was somewhat limited in its ability to scale by fully utilizing modern servers with more than four CPUs and advanced memory allocation capabilities. This meant that businesses couldnt make full use of their investment in multi-CPU machines, which is less than ideal when IT budgets are constrained. To meet this growing need, we have included a free and easy-to-install InnoDB Upgrade for MySQL 5.1 with MySQL versions 5.1.38 and higher. This Upgrade provides users with an immediate, seamless option for achieving higher performance and scalability, specifically on modern, multi-core, multi-CPU servers. This is a significant improvement that transparently provides InnoDB users with added performance and scalability gains without also requiring changes to their current MySQL schemas or applications. In this paper we provide a technical overview of the MySQL storage engine architecture used by the InnoDB Upgrade for MySQL 5.1. It then explores the features, performance and scalability gains InnoDB users can expect to see when enabling the InnoDB Upgrade in MySQL 5.1.38 or later.
Figure 1 - The MySQL Storage Engine Architecture The MySQL storage engine architecture provides a standard set of management and support services that is common to all the underlying storage engines. The storage engines themselves are the components of the database server that actually perform actions on the underlying data that is maintained at the physical server level. This efficient and modular architecture provides large performance and manageability benefits for those wishing to specifically target a particular application need such as transaction processing, data warehousing, high availability situations, etc. while enjoying the advantage of utilizing a set of interfaces and services that are independent of any one storage engine. From a technical perspective some of the key differences in storage engines include: Concurrency/Locking Some applications have more granular lock requirements (such as row-level locks) than others. Choosing the right locking strategy can reduce overhead and therefore help with overall performance. Concurrency/Locking also supports capabilities like multi-version concurrency control or snapshot read. Transaction Support Not every application needs transactions, and for those that dont, the added overhead can be avoided. But for those that do, there are a number of MySQL storage engines that support transactional features, such as ACID compliance. Physical Storage This involves things like overall page size for tables and indexes to the format used for storing data to physical disk. Different storage architectures can have an impact on the overall performance of both read and write operations based on application and data characteristics. Index Support Different application scenarios benefit from different index strategies. Each storage engine generally has its own indexing methods, although some indexing mechanisms (like B-tree indexes) are common to nearly all engines. Memory Caches MySQL offers storage engines whose data only resides in RAM, which results in very fast performance. Others use different variations of memory caches for transactions, transaction logs, tables, and indexes. Other areas Including things like multiple I/O threads for parallel operations, thread concurrency, database checkpointing, bulk insert handling, and more.
Each set of the storage engine components is designed to offer a select set of benefits for a particular application. Conversely, avoiding a set of component features helps steer clear of unnecessary overhead. So, it stands to reason that understanding a particular applications set of requirements and selecting the proper MySQL storage engine can have a dramatic impact on overall system efficiency and performance. And a DBA or developer can certainly put multiple storage engines in play for the same application, giving the application extreme flexibility and high-performance. Beginning in MySQL 5.1, a new storage engine interface allows DBAs and developers to dynamically and easily install/uninstall storage engines within the MySQL Server. To add a new storage engine, the engines plugin shared library is loaded into MySQL using the INSTALL PLUGIN statement. For example, if the EXAMPLE engine plugin is named ha_example and the shared library is named ha_example.so, the engine would be loaded into MySQL with the following statement: INSTALL PLUGIN ha_example SONAME 'ha_example.so'; To unplug a storage engine from the MySQL Server, the UNINSTALL PLUGIN statement is used: UNINSTALL PLUGIN ha_example; MySQL 5.1.38 and higher distributions now ship with the InnoDB Upgrade shared library so users can dynamically INSTALL the InnoDB Upgrade and replace the built-in InnoDB within MySQL without compiling from source or re-linking MySQL. For current deployments and schemas, databases created with the built-in InnoDB are compatible with the InnoDB Upgrade and users can easily fall back to the built-in InnoDB configuration if desired. For specific instructions on downloading, version status, installing and enabling the new InnoDB Upgrade for MySQL 5.1 see: http://www.innodb.com/doc/innodb_plugin-1.0/index.html.
The supporting InnoDB Upgrade features and enhancements are described below.
A complete, detailed explanation of all of the new Innodb Upgrade performance and scalability features and how to enable and use them with MySQL 5.1 can be found here: http://www.innodb.com/doc/innodb_plugin-1.0/innodb-performance.html
Figure 2 5.1 with Built-in InnoDB vs. 5.1 with InnoDB Upgrade Performance Gains Similar results have been achieved when using MySQL's internal SYSBENCH Standard OLTP tests running SELECT/UPDATE/DELETE/INSERT queries against MySQL 5.1 with the same InnoDB enablement and configurations noted above are shown in Figure 3:
Figure 3 5.1 with Built-in InnoDB vs 5.1 with InnoDB Upgrade Performance Gains
Understanding that results will vary for specific installations, the environmental specifics used for the internal MySQL internal DBT2 and SYSBENCH tests are provided here for those wishing to run similar benchmarks when evaluating MySQL 5.1 with the InnoDB Upgrade: Hardware: - dl360-g5-b box (Intel x86_64 (Dual Quad-Core Xeon 5345),RAM 16GB) OS: - SuSE 10 - kernel - 2.6.16 - fs - ext3 dbt2 test details: - version of dbt2 test - 0.37 - scale - 10 warehouses MySQL Server Configuration: - x86_64-glibc32 package InnoDB options: --innodb_status_file=0 --innodb_data_file_path=ibdata1:100M:autoextend --innodb_buffer_pool_size=2G --innodb_additional_mem_pool_size=20M --innodb_log_file_size=650M --innodb_log_files_in_group=2 --innodb_log_buffer_size=16M --innodb_thread_concurrency=0 --innodb_flush_log_at_trx_commit=1 --innodb_flush_method=O_DIRECT
Efficient Storage Options for Large Objects and Variable-Length Columns Improves storage efficiency of large objects by allowing users to create tables using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED. With these options long column values are stored fully off-page, and the associated clustered index record contains only a 20-byte pointer to the overflow page. New INFORMATION_SCHEMA tables Seven new tables provide information specific to InnoDB compression and transaction locking. o INNODB_CMP Contains status information on the efficiency and operations related to compressed tables. o INNODB_CMP_RESET Same as above, but reading from this table resets the reported statistics. o INNODB_CMPMEM Contains status information on the compressed pages that reside in the buffer pool. o INNODB_CMPMEM_RESET Same as above, but reading from this table resets the reported statistics. o INNODB_TRX - Contains information about every transaction currently executing inside InnoDB, including whether the transaction is waiting for a lock, when the transaction started, and the particular SQL statement the transaction is executing. o INNODB_LOCKS Contains a row for each blocked transaction that describes each lock the transaction has requested and what the transaction is waiting on. o INNODB_LOCK_WAITS Contains information about transactions that are waiting for a specific lock.
A complete, detailed rundown of all of the new InnoDB Upgrade for MySQL 5.1 Manageability and Efficiency related features, including important details on the new supporting File and Row Format features can be found here: http://www.innodb.com/doc/innodb_plugin-1.0/innodb-plugin-introduction.html#innodb-pluginintroduction-features
A complete, detailed rundown of all of the InnodDB Upgrades Uptime and Reliability related features and how to enable and use them with MySQL 5.1 can be found here:
http://www.innodb.com/doc/innodb_plugin-1.0/innodb-other-changes.html.
MySQL Enterprise Server Is the most up to date and secure version of MySQL. Enterprise subscribers have access to the most current bug fixes to MySQL and the InnoDB Upgrade for MySQL 5.1, quarterly service packs, and hot fix builds of MySQL if lightning truly strikes. MySQL Enterprise Monitor and Advisors with Query Analyzer Provides global monitoring of performance, replication, security, and application availability across all MySQL servers. The Enterprise Monitor ships with a set of automated MySQL Best Practice Advisors that collect, monitor, and advise on specific metrics around performance tuning, tightening security, optimal replication set up and synchronization, and more. Users can customize monitoring schedules, severity thresholds, and network and email alerts to best fit their specific development and production environments and processes. The Enterprise Monitor also includes a visual Query Analyzer feature that helps DBAs and Developers quickly find and fix the most expensive queries running in their MySQL environments. There is also an advanced Replication Monitor that autodetects replication topologies and monitors master/slave synchronization status regardless of configuration. MySQL Technical and Consultative Support Services MySQL Enterprise includes 24x7x365 production to help ensure business-critical applications are continuously available and running at their peak. MySQL Production Support Services include: o Online Self-Help Support The MySQL Knowledge Base is a self-help tool that provides users with access to 2,000+ technical articles on MySQL specific topics that help quickly answer questions and solve problems. o Problem Resolution Support Allows users to work directly with the Oracle MySQL Support team via phone, email or an online interface for quick resolution of technical problems. o Consultative Support Allows users to work with Oracle MySQL Support team on the proper installation, configuration and deployment of MySQL products (and storage engines) and their advanced feature sets, and on best practices around the design and tuning of schemas, queries and application specific code. o Advanced Support for MySQL High Availability and Scalability Solutions Provides full production support for advanced MySQL features and third-party solutions that scale MySQL database and application performance and availability.
5 Conclusion
The MySQL database server continues to raise the bar for open source database performance, reliability and ease of use. With that in mind, MySQL versions 5.1.38 and higher now ship with the new InnoDB Upgrade for MySQL 5.1, providing users with immediate access to performance and scalability gains. MySQL and the InnoDB Upgrade for MySQL 5.1 combination provides current 5.1
10
users with added ease of use, and higher performance and scalability, while sustaining the current production-ready and stable feature set of the MySQL 5.1 server. Given that InnoDB Upgrade for MySQL 5.1 now ships with MySQL 5.1.38 and can be quickly enabled, the move to the most current version of MySQL 5.1 is well worth the small effort.
6 Learn More
Technical and Consultative Support for MySQL and the InnoDB Upgrade for, MySQL 5.1 MySQL Enterprise Server, MySQL Enterprise Monitor and Query Analyzer: http://www.mysql.com/products/enterprise/ MySQL 5.1 Database Server Downloads Binary and Source: http://dev.mysql.com/downloads/mysql/5.1.html InnoDB Upgrade for MySQL 5.1 , Downloads and Documentation: http://www.innodb.com/products/innodb_plugin/ MySQL Performance Tuning and Optimization Resources: http://mysql.com/why-mysql/performance/index.html
11