来源:http://www.mysqlperformanceblog.com/2007/01/08/innodb-vs-myisam-vs-falcon-benchmarks-part-1/
Several days ago MySQL AB made new storage engine Falcon available for wide auditory. We cannot miss this event and executed several benchmarks to see how Falcon performs in comparison to InnoDB and MyISAM.
The second goal of benchmark was a popular myth that MyISAM is faster than InnoDB in reads, as InnoDB is transactional, supports Foreign Key and has an operational overhead. As you will see it is not always true.
For benchmarks I used our PHPTestSuite which allows to test wide range tables and queries.
The script and instruction are available here:
http://www.mysqlperformanceblog.com/files/benchmarks/phptestsuite.stable.tar.gz
We used table "normal" table structure which corresponds to typical structure you would see in OLTP or Web applications - medium size rows, auto increment primary key and couple of extra indexes.
-
CREATE TABLE IF NOT EXISTS `$tableName` (
-
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-
`name` varchar(64) NOT NULL DEFAULT '',
-
`email` varchar(64) NOT NULL DEFAULT '',
-
`password` varchar(64) NOT NULL DEFAULT '',
-
`dob` date DEFAULT NULL,
-
`address` varchar(128) NOT NULL DEFAULT '',
-
`city` varchar(64) NOT NULL DEFAULT '',
-
`state_id` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
-
`zip` varchar(8) NOT NULL DEFAULT '',
-
`country_id` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
-
PRIMARY KEY (`id`),
-
UNIQUE KEY `email` (`email`),
-
KEY `country_id` (`country_id`,`state_id`,`city`)
-
)
In this benchmark we used only read (SELECT) queries with different typical data access patterns:
primary key single row lookup, primary key range lookup, same access types for primary key and full table scans.
To highlight different properties of storage engines we tested ranges with and without LIMIT clause, and tested queries which
need to read the data or can only be satisfied by reading the index.
This benchmark is so called "micro" benchmark which concentrates on particular simple storage engine functions and we use it to see performance and scalability in this simple cases. We also use CPU bound workload in this case (no disk IO) to see how efficient storage engines are in terms of CPU usage. In real life workload results are likely to be very different.
The schema and queries are described here
Used hardware
CentOS release 4.4 (Final)
2 х Dual Core Intel XEON 5130model name : Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
stepping : 6
cpu MHz : 1995.004
cache size : 4096 KB16GB of RAM
MySQL version
We used MySQL 5.1.14-beta sources for MyISAM / InnoDB
and MySQL 5.1.14-falcon bitkeeper tree
bk://mysql.bkbits.net/mysql-5.1-falcon for Falcon
(Please note this is a first release of Falcon and it is still in alpha stage and performance parameters may vary a lot in next releases)
Compilation parameters:
-
For MyISAM / InnoDB
-
./configure --prefix=/usr/local/mysqltest/mysql-<RELEASE> --with-innodb
-
For Falcon
-
./configure --prefix=/usr/local/mysqltest/mysql-<RELEASE> --with-falcon
mysqld startup params:
-
Falcon:
-
libexec/mysqld --no-defaults --user=root --falcon_min_record_memory=1G --falcon_max_record_memory=2GB --falcon_page_cache_size=1500M --max-connections=1500 --table-cache=512 --net_read_timeout=30 --net_write_timeout=30 --backlog=128
-
MyISAM / InnoDB:
-
libexec/mysqld --no-defaults --user=root --key-buffer-size=1500M --innodb-buffer-pool-size=1500M --innodb-log-file-size=100M --innodb-thread-concurrency=8 --max-connections=1500 --table-cache=512 --net_read_timeout=30 --net_write_timeout=30 --back_log=128
Method of benchmark:
1. Prepare table with 1,000,000 records (about 350Mb of data on disk)
2. Run each query for 1, 4, 16, 64, 128, 256 concurrent threads.
3. For each thread perform a warm-up run (duration 180 sec), and then
run three effective runs (duration of each is 60 sec).
As the final result we get a maximal result of three runs.
The raw numbers are available here:
http://www.mysqlperformanceblog.com/files/benchmarks/innodb-myisam-falcon.html
(Note: This benchmark is synthetic micro benchmarks focusing on particular simple data access patterns. Results for your workload are likely to be different.)
There are interesting results I want to show graphics with comments
READ_PK_POINT
Query: SELECT name FROM $tableName WHERE id = %d
The very common query with access by primary key.
InnoDB is faster than MyISAM by 6-9%.
Falcon shows very bad scalabilty.
READ_KEY_POINT
Query: SELECT name FROM $tableName WHERE country_id = %d
In this case Falcon is the best, because Falcon uses a tricky technic to retrieve rows (more
details with Jim Starkey's comments in Part 2).
There MyISAM shows bad scalability with increasing count of thread. I think the reason is pread system
call MyISAM uses to access data and retrieving from OS cache is not scaled.
READ_KEY_POINT_LIMIT
Query: SELECT name FROM $tableName WHERE country_id = %d LIMIT 5
The same query as previous but with LIMIT clause.
Due to Falcon's way of key access Falcon cannot handle LIMIT properly and that is why
we see bad performance. We hope the performance of LIMIT queries will be fixed before release.
MyISAM shows stable result.
InnoDB is better than MyISAM by 58% in case with 4 threads, but does not scale good enough.
Perhaps there is still a problem with InnoDB mutexes.
READ_KEY_POINT_NO_DATA
Query: SELECT state_id FROM $tableName WHERE country_id = %d
This query is similar to previous READ_KEY_POINT with only different the values of accessed column is stored in key. MyISAM and InnoDB handle this case and retrive the value only from key.
InnoDB is better by 25-30%.
Falcon needs an access to data beside key access, and most likely this will not be fixed, as this is
specific Falcon's way to handle multi-versioning. I think this is a big weakness of Falcon, as 'using index' is very common optimization we use in our practice.
READ_KEY_POINT_NO_DATA_LIMIT
Query: SELECT state_id FROM $tableName WHERE country_id = %d LIMIT 5
The previous query but with LIMIT.
Again the LIMIT is bad for Falcon.
InnoDB is better than MyISAM by 87% in case with 4 threads but drops down very fast.
READ_PK_POINT_INDEX
Query: SELECT id FROM $tableName WHERE id = %d
Simple but very quick query to retrieve value from PK.
The results for InnoDB and MyISAM are comparable and I think this shows both engines are maximally optimized and the result is maximal that can be reached for this query.
Falcon scales pretty bad and there is a big room for optimization.
READ_PK_RANGE
Query: SELECT min(dob) FROM $tableName WHERE id between %d and %d
Access by range of PK values.
MyISAM scales very bad, and reason is the same as for READ_KEY_POINT queries.
InnoDB is better than MyISAM by 2-26 times
and than Falcon by 1.64 - 3.85 times.
READ_PK_RANGE_INDEX
Query: SELECT count(id) FROM $tableName WHERE id between %d and %d
MyISAM scales good here, because of access only to key column and 'pread' syscall is not used.
READ_KEY_RANGE
Query: SELECT name FROM $tableName WHERE country_id = %d and state_id between %d and %d
As in case with READ_KEY_RANGE Falcon is the best here.
Falcon's resuts better than InnoDB by 10-30%
MyISAM drops down with 128-256 threads
READ_KEY_RANGE_LIMIT
Query: SELECT name FROM $tableName WHERE country_id = %d and state_id between %d and %d LIMIT 50
Again Falcon does not hanle LIMIT and the results are much worse.
READ_KEY_RANGE_NO_DATA
Query: SELECT city FROM $tableName WHERE country_id = %d and state_id between %d and %d
READ_KEY_RANGE_NO_DATA_LIMIT
Query: SELECT city FROM $tableName WHERE country_id = %d and state_id between %d and %d LIMIT 50
READ_FTS
Query: SELECT min(dob) FROM $tableName
The hardest query performs a scan of all million rows.
InnoDB is better than MyISAM by ~30% with 4-16 threads, but MyISAM scales a bit better in this case.
InnoDB is better than Falcon by 2-3 times.
相关推荐
本教程介绍了 Rust 的基础语法、所有权模型、函数与模块设计,以及高级特性(如错误处理、闭包和并发编程)。通过提供实用的练习和答案,帮助您快速掌握 Rust 的核心概念,为系统级编程打下扎实基础。
基于springboot+Web的毕业设计选题系统源码数据库文档.zip
# 基于Spring和MyBatis的疫情防控管理系统 ## 项目简介 本项目是一个基于Spring和MyBatis框架的疫情防控管理系统,旨在实现数据在管理员、医务人员、患者和数据上报者之间的流转。系统涵盖了用户登录、注册、信息管理、预约管理、检测结果管理等功能,支持多角色的权限管理和数据操作。 ## 项目的主要特性和功能 1. 用户管理 用户登录、注册和登出功能。 用户个人信息管理,包括核酸检测记录和预约记录。 2. 管理员管理 管理员列表管理,支持增删改查操作。 医院信息管理,支持增删改查操作。 3. 医务人员管理 核酸预约和疫苗接种预约管理。 核酸检测结果和疫苗接种结果管理。 患者信息管理。 4. 数据上报者管理 风险区域数据上报。 患者信息上报。 5. 系统安全 通过拦截器实现用户登录状态检查,未登录用户将被重定向到登录页面。
对数据集进行二分类,有数据集和源码以及模型,二分类是识别猫和不是猫的情况,可做毕业设计。
最新完美版积分商城系统,网购商城系统源码,是更新的奇偶商城系统源码, 它拥有独立代理后台,而且内附搭建教程。 企业猫搭建了下,感觉这个源码很新颖的,购买商品后可以选择直接发货还是拆红包升级购买的商品升级成别的商品。
编译好的Linux版网络调试助手,方便直接使用,免得每次都需要重新编译
office使用软件
# 基于Python和Flask的博客管理系统 ## 项目简介 本项目是一个基于Python和Flask框架的博客管理系统,旨在为用户提供一个简单易用的博客平台。用户可以注册、登录、发布博客、管理博客内容以及评论等功能。 ## 项目的主要特性和功能 1. 用户管理 用户注册和登录功能。 用户个人信息管理。 2. 博客管理 发布、编辑和删除博客文章。 博客分类和标签管理。 3. 评论系统 用户可以对博客文章进行评论。 评论的查看和管理。 4. 权限管理 管理员可以管理用户和博客内容。 普通用户只能管理自己的博客和评论。 ## 安装使用步骤 1. 环境准备 确保已安装Python 3.x。 安装Flask框架pip install Flask。 2. 数据库配置 在config.py文件中配置数据库连接信息。
基于springboot+vue的实践性教学系统源码数据库文档.zip
基于springboot二手物品交易系统源码数据库文档.zip
基于springboot餐品美食论坛源码数据库文档.zip
人工智能开发项目深度学习项目源码带指导视频词云提取方式是百度网盘分享地址
基于springboot企业员工薪酬管理系统源码数据库文档.zip
基于springboot+JavaWeb图书管理系统源码数据库文档.zip
数据库设计管理课程设计系统设计报告(powerdesign+sql+DreamweaverCS)销售管理系统设计与开发提取方式是百度网盘分享地址
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
基于springboot的小说阅读平台源码数据库文档.zip
# 基于PaddleDetection框架的人流量统计系统 ## 项目简介 本项目是一个基于PaddleDetection框架的人流量统计系统,专注于静态和动态场景下的人员计数和行人检测。项目涵盖了从数据准备、模型选择、训练、评估、优化到预测和部署的完整流程,旨在提供高效、准确的人流量统计解决方案。 ## 主要特性和功能 多模型支持支持多种模型选择,如DeepSORT、JDE和FairMOT,适用于多目标追踪场景。 模型优化提供多种优化策略,包括数据增强、可变形卷积、syncbn+ema、attention和GIoU Loss,以提升模型精度。 性能加速支持TensorRT推理加速,显著提升模型性能。 数据增强提供多种数据增强方式,如cutmix、syncbn和ema,进一步优化模型性能。 模型导出支持模型导出,便于模型部署和上线。 ## 安装使用步骤 1. 安装PaddleDetection框架 bash
基于springboot的银行信用卡额度管理系统源码数据库文档.zip
# 基于Arduino的蒸发冷却系统 ## 项目简介 本项目旨在创建一个蒸发冷却系统(即沼泽冷却器),这是一种在干燥炎热气候下提供能源效率替代空调的系统。该系统使用Arduino 2560和各种传感器来监控和控制冷却过程。 ## 项目的主要特性和功能 水位监控通过水位传感器监控水箱中的水位,并在水位过低时发出警报。 温度和湿度显示在LCD屏幕上显示空气温度和湿度。 风扇控制根据温度范围控制风扇电机。 系统开关通过用户按钮控制系统的开关。 日志记录记录电机激活和停用的时间和日期。 ## 安装使用步骤 2. 硬件连接按照项目文档中的电路图连接所有硬件组件,包括水位传感器、LCD显示屏、实时时钟模块、DHT11传感器和风扇电机。 3. 上传代码将下载的代码上传到Arduino 2560开发板。 4. 启动系统通过用户按钮启动系统,观察LCD屏幕上的温度和湿度显示,并监控水位传感器的状态。