TokuDB6.5与InnoDB(1.1.18)性能对比测试
最近测了一下TokuDB6.5与InnoDB1.1.18的性能对比测试,下面分享一下测试过程和测试结果,希望对以后可能需要用的TokuDB的朋友有点
大家对MySQL存储引擎最熟悉的恐怕就是InnoDB了,InnoDB的性能还算不错,尤其适用互联网应用。但是InnoDB也不能称作完美,尤其是单实例MySQL的性能那还真不敢恭维,,现在大多数互联网公司都是通过优秀的架构来弥补这点吧。今天说到的这个MySQL存储引擎单实例性能在特定情况下确实比InnoDB强很多,普通情况下也不差-----TokuDB------完美兼容MySQL。TokuDB是一个比较牛逼的引擎,它不是用常规数据库所用的B+树存储数据,而是采用所谓的分形树来存储,这种特殊的数据结构就使得TokuDB的读写性能很强(尤其是写,是InnoDB的许多倍吧)。最近测了一下TokuDB6.5与InnoDB1.1.18的性能对比测试,下面分享一下测试过程和测试结果,希望对以后可能需要用的TokuDB的朋友有点帮助(TokuDB数据文件在50G以内是免费的,超过就要收费,具体google tokudb既可找到,又是收费!!)。
首先简单介绍一下TokuDB,它是基于MySQL的存储引擎,采用分形数的数据结构做存储,最典型的几个特征就是插入速度极快,压缩效率高。官方给的它与InnoDB对比图如下:
TokuDB支持事务,MVCC等等一系列功能,看上图确实比InnoDB有很多优势,但是似乎在备份工具上面没有很好的支持(不知道是否有较好的收费版本)。关于TokuDB的功能基本上了解了,那接下来看看我们的具体测试结果。
测试工具:sysbench0.5。
测试方法:sysbench初始化一部分数据,然后跑脚本测试,测试过程中记录OS的相关数据。
sysbench测试脚本(没用热点数据模式,随机初始化数据):
sysbench --test=/home/zbs/sysbench-0.5/sysbench/tests/db/parallel_prepare.lua --oltp_tables_count=1 --oltp-table-size=$records --rand-init=on --num-threads=$thds --oltp-read-only=off --report-interval=10 --rand-type=uniform --mysql-table-engine=$type --max-time=8000 --mysql-host=$host --mysql-port=$port --mysql-user=test --mysql-password=test --mysql-db=test1 --max-requests=0 prepare >$log 2>&1
sysbench --test=/home/zbs/sysbench-0.5/sysbench/tests/db/oltp.lua --oltp_tables_count=1 --oltp-table-size=$records --rand-init=on --num-threads=$thds --oltp-read-only=off --report-interval=10 --rand-type=uniform --mysql-table-engine=$type --max-time=8000 --mysql-host=$host --mysql-port=$port --mysql-user=test --mysql-password=test --mysql-db=test1 --max-requests=0 run >$log 2>&1
第一次测试出来之后,TPS出乎我们的意料,见下图:
你会发现TokuDB6竟然比InnoDB和TokuDB5.0好这么多倍(测试TokuDB时iostat的%util列10%以下,vmstat的r列较高)。这个结果很吓人,但明眼人都不会相信这个结果(实际上TokuDB官方给的结果也是两者几乎差不多,TokuDB稍好),因为如果世上有一个这么好的存储引擎,那InnoDB就不要混了。带着怀疑的态度进行了第二次测试(第一次测试虽然表的规模很大,但是没有指定--rand-init=on,导致初始化的数据大多数行的内容相同,而此时TokuDB的压缩能力显现出来了,比InnoDB数据文件大概小了20倍左右),第二次测试了好几种数据规模情况(数据随机初始化,非热点数据模式)。

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

InnoDB is a storage engine that stores data in tables on disk, so our data will still exist even after shutdown and restart. The actual process of processing data occurs in memory, so the data in the disk needs to be loaded into the memory. If it is processing a write or modification request, the contents in the memory also need to be refreshed to the disk. And we know that the speed of reading and writing to disk is very slow, which is several orders of magnitude different from reading and writing in memory. So when we want to get certain records from the table, does the InnoDB storage engine need to read the records from the disk one by one? The method adopted by InnoDB is to divide the data into several pages, and use pages as the basic unit of interaction between disk and memory. The size of a page in InnoDB is generally 16

InnoDB is one of the database engines of MySQL. It is now the default storage engine of MySQL and one of the standards for binary releases by MySQL AB. InnoDB adopts a dual-track authorization system, one is GPL authorization and the other is proprietary software authorization. InnoDB is the preferred engine for transactional databases and supports transaction security tables (ACID); InnoDB supports row-level locks, which can support concurrency to the greatest extent. Row-level locks are implemented by the storage engine layer.

1. Mysql transaction isolation level These four isolation levels, when there are multiple transaction concurrency conflicts, some problems of dirty reading, non-repeatable reading, and phantom reading may occur, and innoDB solves them in the repeatable read isolation level mode. A problem of phantom reading, 2. What is phantom reading? Phantom reading means that in the same transaction, the results obtained when querying the same range twice before and after are inconsistent as shown in the figure. In the first transaction, we execute a range query. At this time, there is only one piece of data that meets the conditions. In the second transaction, it inserts a row of data and submits it. When the first transaction queries again, the result obtained is one more than the result of the first query. Data, note that the first and second queries of the first transaction are both in the same

1. Roll back and reinstall mysql. In order to avoid the trouble of importing this data from other places, first make a backup of the database file of the current library (/var/lib/mysql/location). Next, I uninstalled the Perconaserver 5.7 package, reinstalled the original 5.1.71 package, started the mysql service, and it prompted Unknown/unsupportedtabletype:innodb and could not start normally. 11050912:04:27InnoDB:Initializingbufferpool,size=384.0M11050912:04:27InnoDB:Complete

MySQL storage engine selection comparison: InnoDB, MyISAM and Memory performance index evaluation Introduction: In the MySQL database, the choice of storage engine plays a vital role in system performance and data integrity. MySQL provides a variety of storage engines, the most commonly used engines include InnoDB, MyISAM and Memory. This article will evaluate the performance indicators of these three storage engines and compare them through code examples. 1. InnoDB engine InnoDB is My

MySQL is a widely used database management system, and different storage engines have different impacts on database performance. MyISAM and InnoDB are the two most commonly used storage engines in MySQL. They have different characteristics and improper use may affect the performance of the database. This article will introduce how to use these two storage engines to optimize MySQL performance. 1. MyISAM storage engine MyISAM is the most commonly used storage engine for MySQL. Its advantages are fast speed and small storage space. MyISA

Tips and strategies to improve the read performance of MySQL storage engine: Comparative analysis of MyISAM and InnoDB Introduction: MySQL is one of the most commonly used open source relational database management systems, mainly used to store and manage large amounts of structured data. In applications, the read performance of the database is often very important, because read operations are the main type of operations in most applications. This article will focus on how to improve the read performance of the MySQL storage engine, focusing on a comparative analysis of MyISAM and InnoDB, two commonly used storage engines.

MySQL storage engine supporting GIS data: Spatial index optimization in InnoDB Abstract: In modern database applications, geographic information system (GIS) data plays an increasingly important role. GIS data processing is complex and dynamic, and traditional relational databases are not good at processing this type of data. However, MySQL provides a storage engine, InnoDB, that can optimize the processing of GIS data. This article will introduce how to use spatial indexes on the InnoDB storage engine to optimize GIS data.
