MySQL插件XtraDB
在J2EE企业应用中,不仅仅需要考虑到系统的架构与设计,还需要关注存储系列的话题,存储包括硬件和软件,话题中数据库也算存储系列当中的重点。当前对与MySQL的使用越来越广泛,对MySQL的期望和要求也越来越多。记得在前几天我写过一篇文章,关于一个德国网
在J2EE企业应用中,不仅仅需要考虑到系统的架构与设计,还需要关注存储系列的话题,存储包括硬件和软件,话题中数据库也算存储系列当中的重点。当前对与MySQL的使用越来越广泛,对MySQL的期望和要求也越来越多。记得在前几天我写过一篇文章,关于一个德国网站的 架构,他们正在考虑将现在使用的MySQL引擎换掉,采用XtraDB数据库引擎,详见: 德国SNS交友/视频网站Poppen.de的技术架构分享。
最近看一个老外在Dell PowerEdge R900机器上做的MySQL测试,使用MySQL 5.1.42,分别采用3种不同的引擎进行比较,分别是MySQL自带的InnoDB,InnoDB-plugin 1.0.6、 XtraDB 1.0.6-9 ,测试数据90GB+索引。
Dell PowerEdge R900的机器配置如下:
* 4 QuadCore Intel(R) Xeon(R) CPU E7320 @ 2.13GHz (16 cores in total)
* 32GB of RAM
* RAID10 on 8 disks 2.5/15K RPMS
* FusionIO 160GB SLC
* FusionIO 320GB MLC
测试环境的InnoDB数据文件建立在FusionIO存储设备上,采用160GB SLC卡 和 320GB MLC卡配置的软RAID0 存储,而InnoDB 日志和 MySQL系统表建立在 RAID10 设备上,测试环境中的my.cnf配置文件清单如下:
* InnoDB
innodb_buffer_pool_size=26G
innodb_data_file_path=ibdata1:10M:autoextend
innodb_file_per_table=1
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=8M
innodb_log_files_in_group=3
innodb_log_file_size=512M
innodb_thread_concurrency=0
innodb_flush_method = O_DIRECT
max_connections=3000
query_cache_size=0
skip-name-resolve
skip-grant-table
table_cache=10000
* InnoDB-plugin / XtraDB
ignore-builtin-innodb
plugin-load=innodb=ha_innodb_plugin.so
innodb_buffer_pool_size=26G
innodb_data_file_path=ibdata1:10M:autoextend
innodb_file_per_table=1
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=8M
innodb_log_files_in_group=3
innodb_log_file_size=512M
innodb_thread_concurrency=0
innodb_flush_method= O_DIRECT
innodb_write_io_threads=8
innodb_read_io_threads=8
innodb_io_capacity=10000
口水:
文中提到的Fusion-io 是什么?Fusion-IO 是固态存储技术和高向能I/O解决方案的领先供应商。该公司的的固态存储技术弥补了处理能力和存储性能需求之间的差距,满足了企业对高性能的存储,详见:官方网站http://fusioniochina.com/
能看出InnoDB-plugin引擎比MySQL默认的 InnoDB引擎要好,他利用多线程I/O,满足更多的吞吐量,在多核CPU条件下运行的效率将会更高, 对内存也有更效的利用。
而XtraDB对MySQL很多方面也进行了改进和性能提高,并且增加监控参数,显示一些后台线程的统计信息,innodb默认开启4个IO线程,由参数innodb_file_io_threads控制,但在unix/linux平台该参数无效,而XtraDB/innodb plugin默认开启8个IO线程,并且读线程和写线程可以分别由参数innodb_read_io_threads和 innodb_write_io_threads控制。
在多核CPU环境中,如果CPU和磁盘本身没有成为瓶颈,开启更多线程应该对提升IO性能有很好的 作用。而读写线程的单独控制,则可以针对不同应用环境下的要求进行灵活配置。XtraDB更加详细的列出buffer pool中不同部分的详细信息,还有buffer pool的命中率和LRU的信息等,对内存的使用情况一目了然,之前innodb在代码里面写死了 innodb_io_capacity 为100,但是现在db服务器很多都是用多块硬盘做raid10,IOPS 一般都远不止100,因此这次改进之后 innodb_io_capacity 变成可以动态调整的参数,测试结果如图所示:
测试结果中的CPU使用率,如图所示:
磁盘的吞吐状态,如图所示:
看过资料后,还是想自己折腾一番,下载MySQL源码编译、安装,先不安装XtraDB,键入“show plugins” ,如图所示:
查看大图请点击这里
在另外一台机器上安装XtraDB引擎后的效果,如图所示:
从上图中可以看出多了不少栏目,查看大图请点击这里
BWT:MySQL、 xtradb 引擎软件下载
http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.44.tar.gz
http://launchpad.net/percona-xtradb/release-8/1.0.4-8/+download/percona-xtradb-1.0.4-8.tar.gz
2个不同的MySQL环境搭建好后,采用Apache 的AB压力测试工具对Java web工程测试,测试环境只有一张表操作表里面有100条数据,服务器是本地Tomcat6,修改代码中JDBC的url连接地址,依次测试,每台机器的配置基本相同CPU 1.6G,2G内存。
详细测试结果如下:
==========================Linux InnoDB(远程)==============================
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.5 0 7
Processing: 134 1516 604.3 1447 3553
Waiting: 133 1515 604.3 1447 3552
Total: 134 1518 604.4 1451 3559
Percentage of the requests served within a certain time (ms)
50% 1451
66% 1774
75% 1968
80% 2078
90% 2320
95% 2454
98% 2869
99% 3101
100% 3559 (longest request)
==========================Linux XtraDB(远程)==============================
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.1 0 6
Processing: 8 915 463.2 816 2360
Waiting: 8 915 463.1 816 2360
Total: 8 917 463.5 816 2365
Percentage of the requests served within a certain time (ms)
50% 816
66% 1038
75% 1251
80% 1359
90% 1541
95% 1716
98% 2014
99% 2130
100% 2365 (longest request)
===========================Windows InnoDB(本地)==============================
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.2 0 6
Processing: 155 3337 1617.2 3116 9243
Waiting: 154 3337 1617.2 3115 9243
Total: 155 3339 1616.7 3116 9243
Percentage of the requests served within a certain time (ms)
50% 3116
66% 3930
75% 4535
80% 4868
90% 5484
95% 6010
98% 6478
99% 7153
100% 9243 (longest request)
总结:
测试数据的多少暂时不是关注的重点,关键是相同的前置条件,相同的测试数据,在不同的MySQL引擎中测试得到的值,在2个不同的操作系统下,2种不同的 MySQL数据引擎,测试结果表名,XtraDB果然是表现最好的,其次是Linux 下MySQL默认的InnoDB引擎,最差的是Windows下的MySQL默认的InnoDB引擎,
–end–
原文地址:MySQL插件XtraDB, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

You can open phpMyAdmin through the following steps: 1. Log in to the website control panel; 2. Find and click the phpMyAdmin icon; 3. Enter MySQL credentials; 4. Click "Login".

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

Redis uses a single threaded architecture to provide high performance, simplicity, and consistency. It utilizes I/O multiplexing, event loops, non-blocking I/O, and shared memory to improve concurrency, but with limitations of concurrency limitations, single point of failure, and unsuitable for write-intensive workloads.

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

Building an SQL database involves 10 steps: selecting DBMS; installing DBMS; creating a database; creating a table; inserting data; retrieving data; updating data; deleting data; managing users; backing up the database.
