Home Database Mysql Tutorial MySQL插件XtraDB

MySQL插件XtraDB

Jun 07, 2016 pm 04:31 PM
j2ee mysql enterprise application plug-in

在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 变成可以动态调整的参数,测试结果如图所示:http://www.68idc.cn/help/uploads/allimg/150207/0SH263N-0.png

测试结果中的CPU使用率,如图所示:

http://www.68idc.cn/help/uploads/allimg/150207/0SH2A47-1.png

磁盘的吞吐状态,如图所示:

disk_bo

看过资料后,还是想自己折腾一番,下载MySQL源码编译、安装,先不安装XtraDB,键入“show plugins” ,如图所示:

http://1aqpcg.bay.livefilestore.com/y1pvl450H4sAV2_W2guPsT71MeLMQAZYNGTEIuCiQJxA7HjhdzhJ0GtrEAA-XNvONxxrOPsvstv-RVi03qd-A2IIQZY9W8ebXrW/nox.png
查看大图请点击这里

在另外一台机器上安装XtraDB引擎后的效果,如图所示:
http://1aqpcg.bay.livefilestore.com/y1poygf8tU6sV0lc8jS6bkhXC2ntLTVkfI5r4ZGtG_-MBdIt9KJiuh5SHTV3Lt9TPfauGcyp0AH3kSQ4AeAmee9nHsaBnHpdZnE/yesx.png
从上图中可以看出多了不少栏目,查看大图请点击这里

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–

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1270
29
C# Tutorial
1249
24
Laravel Introduction Example Laravel Introduction Example Apr 18, 2025 pm 12:45 PM

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

MySQL vs. Other Programming Languages: A Comparison MySQL vs. Other Programming Languages: A Comparison Apr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Solve database connection problem: a practical case of using minii/db library Solve database connection problem: a practical case of using minii/db library Apr 18, 2025 am 07:09 AM

I encountered a tricky problem when developing a small application: the need to quickly integrate a lightweight database operation library. After trying multiple libraries, I found that they either have too much functionality or are not very compatible. Eventually, I found minii/db, a simplified version based on Yii2 that solved my problem perfectly.

Laravel framework installation method Laravel framework installation method Apr 18, 2025 pm 12:54 PM

Article summary: This article provides detailed step-by-step instructions to guide readers on how to easily install the Laravel framework. Laravel is a powerful PHP framework that speeds up the development process of web applications. This tutorial covers the installation process from system requirements to configuring databases and setting up routing. By following these steps, readers can quickly and efficiently lay a solid foundation for their Laravel project.

Solve MySQL mode problem: The experience of using the TheliaMySQLModesChecker module Solve MySQL mode problem: The experience of using the TheliaMySQLModesChecker module Apr 18, 2025 am 08:42 AM

When developing an e-commerce website using Thelia, I encountered a tricky problem: MySQL mode is not set properly, causing some features to not function properly. After some exploration, I found a module called TheliaMySQLModesChecker, which is able to automatically fix the MySQL pattern required by Thelia, completely solving my troubles.

MySQL: Structured Data and Relational Databases MySQL: Structured Data and Relational Databases Apr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities Explained MySQL: Key Features and Capabilities Explained Apr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

See all articles