大家都知道MariaDB是MySQL源代码的一个分支,但是他们两个之间有什么不能呢?本篇文章重点为大家分享一下MYSQL5.7与MariaDB10.3区别。
创新互联公司10多年企业网站制作服务;为您提供网站建设,网站制作,网页设计及高端网站定制服务,企业网站制作及推广,对发电机维修等多个方面拥有多年的营销推广经验的网站建设公司。
二者基础架构是一样的,默认变量参数数据也大同小异
mysql> SHOW VARIABLES LIKE 'max_con%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_connect_errors | 100 |
| max_connections | 151 |
+--------------------+-------+
2 rows in set (0.01 sec)
因为初始连接值太低,不适合高并发能力,所以提高到2000来做测试,这时候就有差异了
必须修改linux系统本身的ulimit参数 / 系统默认参数
[root@Centos7 ~]# ulimit -a | grep open
open files (-n) 1024
/修改limit参数
vim /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
/ 修改MYsql配置文件
vim /etc/my.cnf
[mysqld]
max_connections=2000
systemctl restart mysqld
/ 查看变量,修改成功
mysql> SHOW VARIABLES LIKE 'max_con%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_connect_errors | 100 |
| max_connections | 2000 |
+--------------------+-------+
2 rows in set (0.03 sec)
直接修改参数重启即可 / 修改MYsql配置文件
vim /etc/my.cnf
[mysqld]
max_connections=2000
systemctl restart mysqld
/ 查看变量,修改成功
mysql> SHOW VARIABLES LIKE 'max_con%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_connect_errors | 100 |
| max_connections | 2000 |
+--------------------+-------+
2 rows in set (0.03 sec)
mysqlsap工具 同时并发1000个连接 分别并发1000个连接 同时并发1000个连接
/ mysql的并发
[root@Centos7 ~]# mysqlslap -a -c 1000
Benchmark
Average number of seconds to run all queries: 40.796 seconds
Minimum number of seconds to run all queries: 40.796 seconds
Maximum number of seconds to run all queries: 40.796 seconds
Number of clients running queries: 1000
Average number of queries per client: 0
/ MariaDB的并发
[root@Centos7 ~]# mysqlslap -a -c 1000
Benchmark
Average number of seconds to run all queries: 19.427 seconds
Minimum number of seconds to run all queries: 19.427 seconds
Maximum number of seconds to run all queries: 19.427 seconds
Number of clients running queries: 1000
Average number of queries per client: 0
分别并发1000个连接
/ Mysql先并发1000个连接
[root@Centos7 ~]# mysqlslap -a -c 1000
Benchmark
Average number of seconds to run all queries: 28.096 seconds
Minimum number of seconds to run all queries: 28.096 seconds
Maximum number of seconds to run all queries: 28.096 seconds
Number of clients running queries: 1000
Average number of queries per client: 0
/ MariaDB 后续并发1000个连接
[root@Centos7 ~]# mysqlslap -a -c 1000
Benchmark
Average number of seconds to run all queries: 14.042 seconds
Minimum number of seconds to run all queries: 14.042 seconds
Maximum number of seconds to run all queries: 14.042 seconds
Number of clients running queries: 1000
Average number of queries per client: 0
总结:由此比对得出同时并发时,mysql跟MariaDB差距太大,可以达到2倍差距,分开并发MariaDB比mysql提高60%性能
当前名称:MYSQL5.7与MariaDB10.3区别
文章分享:http://www.csdahua.cn/qtweb/news16/552366.html
成都网站优化推广公司_创新互联,为您提供品牌网站设计、全网营销推广、响应式网站、商城网站、企业建站、网站导航
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 快上网