Klustron(原KunlunBase) 与 TiDB 的 sysbench 性能对比测试结果汇总
Klustron(原KunlunBase) 与 TiDB 的 sysbench 性能对比测试结果汇总
Klustron团队以友好交流学习借鉴的宗旨,在每个版本发布后我们会拿Klustron与当前业界其他几个常见的分布式数据库系统做一系列性能对比,供业内人士参考借鉴。我们近期会陆续发布各个产品的对比结果。欢迎大家阅读对比和亲自验证,如有任何疑问请在我司官网论坛提问。
具体来说,我们会用 Klustron 与 TiDB, CockroachDB, OceanBase 对比sysbench, TPC-C, TPC-H, TPC-DS 的性能,与 greenplum 对比 TPC-H 和 TPC-DS 的性能。同时,我们会用 Klustron-storage(也就是 Klustron 的存储节点)与 Percona-MySQL, PostgreSQL, OpenGauss 做 sysbench 和 TPC-C 的性能对比。欢迎大家持续关注、转发、评论。
Klustron 与 TiDB 的 sysbench 性能对比测试
机器信息
本次演示测试所使用的机器,全部来自于阿里云的 ECS。具体的机器信息为:
机器IP | ECS实例类型 | vCPUs | 内存 | 数据盘 | 角色 |
---|---|---|---|---|---|
172.22.161.13 | ecs.i2.2xlarge | 8 | 64GB | 本地盘存储:1788 GiB | 计算节点+存储节点+元数据节点 |
172.22.161.14 | ecs.i2.2xlarge | 8 | 64GB | 本地盘存储:1788 GiB | 计算节点+存储节点+元数据节点 |
172.22.161.15 | ecs.i2.2xlarge | 8 | 64GB | 本地盘存储:1788 GiB | 计算节点+存储节点+元数据节点 |
172.22.161.16 | ecs.c7.2xlarge | 8 | 16GB | 无 | Sysbench客户端 |
注:
- 对于 Klustron, 计算节点指 Klustron-server, 存储节点指 Klustron-storage, 元数据节点指 Kunlun-Meta;
- 对于 TiDB, 计算节点指 TiDB, 存储节点指 TiKV, 元数据节点指 PD;
- 下文会分布使用这 4 台机器的ip地址的最后一节,即 13,14,15,16 作为机器的 ID 来指代这台服务器。
测试数据信息
测试数据统一使用 sysbench 1.0.17 进行数据灌入,产生 16 各表,每个表都灌入 1000万 行数据。 数据总量为 0.2K * 10000000 * 16 字节,接近 32GB。其中,表定义为:
产品和集群信息
Klustron
Klustron 使用的也是当前最新发布的正式版 1.0.2, 集群三台机器中,每台机器上部署一个元数据节点,一个计算节点和两个存储节点。
六个存储节点构成两个数据分片。 由于当前未打开读写分离功能, 所以每个分片只有主节点直接参与读写操作。
两个主节点的缓存大小都设置为16GB, 于是缓存使用总内存为: 16 x 2 = 32 GB。
TiDB
TiDB使用当前最新发布的正式版 6.1.1, 集群三台机器中, 每台机器部署一个PD, 一个 TiKV,一个 TiDB 节点。
TiDB 默认使用机器内存的 40% 作为缓存, 所以每台机器使用 25.6GB 作为缓存。使用的总缓存为 25.6 x 3 = 76.8 GB。
测试情况及结果
本次测试,对比了五种操作,即点查(oltp_point_select),更新索引字段(oltp_update_index),更新非索引字段(oltp_update_non_index),混合读写(oltp_read_write),以及复合查询(oltp_read_only)。
每种操作,都同时运行三个测试流,同时对三台机器上的三个计算节点进行压力测试。
每个测试流使用 100 个线程,为节省演示时间,运行 60秒。
对于oltp_point_select, 对应的命令为:
Klustron: sysbench oltp_point_select --tables=16 --table-size=10000000 --db-driver=pgsql --pgsql-host=172.22.161.13/14/15 --pgsql-port=47001 --pgsql-user=abc --pgsql-password=abc --pgsql-db=test --threads=100 --report-interval=5 --time=60 run
TiDB: sysbench oltp_point_select --tables=16 --table-size=10000000 --db-driver=mysql --mysql-host=172.22.161.13/14/15 --mysql-port=40002 --mysql-user=root --mysql-password=root --mysql-db=test --threads=100 --report-interval=5 --time=60 run
对于oltp_update_index, 对应的命令为:
Klustron: sysbench oltp_update_index --tables=16 --table-size=10000000 --db-driver=pgsql --pgsql-host=172.22.161.13/14/15 --pgsql-port=47001 --pgsql-user=abc --pgsql-password=abc --pgsql-db=test --threads=100 --report-interval=5 --time=60 run
TiDB: sysbench oltp_update_index --tables=16 --table-size=10000000 --db-driver=mysql --mysql-host=172.22.161.13/14/15 --mysql-port=40002 --mysql-user=root --mysql-password=root --mysql-db=test --threads=100 --report-interval=5 --time=60 run
对于oltp_update_non_index, 对应的命令为:
Klustron: sysbench oltp_update_non_index --tables=16 --table-size=10000000 --db-driver=pgsql --pgsql-host=172.22.161.13/14/15 --pgsql-port=47001 --pgsql-user=abc --pgsql-password=abc --pgsql-db=test --threads=100 --report-interval=5 --time=60 run
TiDB: sysbench oltp_update_non_index --tables=16 --table-size=10000000 --db-driver=mysql --mysql-host=172.22.161.13/14/15 --mysql-port=40002 --mysql-user=root --mysql-password=root --mysql-db=test --threads=100 --report-interval=5 --time=60 run
对于oltp_read_write, 对应的命令为:
Klustron: sysbench oltp_read_write --tables=16 --table-size=10000000 --db-driver=pgsql --pgsql-host=172.22.161.13/14/15 --pgsql-port=47001 --pgsql-user=abc --pgsql-password=abc --pgsql-db=test --threads=100 --report-interval=5 --time=60 run
TiDB: sysbench oltp_read_write --tables=16 --table-size=10000000 --db-driver=mysql --mysql-host=172.22.161.13/14/15 --mysql-port=40002 --mysql-user=root --mysql-password=root --mysql-db=test --threads=100 --report-interval=5 --time=60 run
对于oltp_read_only, 对应的命令为:
Klustron: sysbench oltp_read_only --tables=16 --table-size=10000000 --db-driver=pgsql --pgsql-host=172.22.161.13/14/15 --pgsql-port=47001 --pgsql-user=abc --pgsql-password=abc --pgsql-db=test --threads=100 --report-interval=5 --time=60 run
TiDB: sysbench oltp_read_only --tables=16 --table-size=10000000 --db-driver=mysql --mysql-host=172.22.161.13/14/15 --mysql-port=40002 --mysql-user=root --mysql-password=root --mysql-db=test --threads=100 --report-interval=5 --time=60 run
每个操作的三个执行流汇总后的结果为:
Klustron:
注: ms表示毫秒, 延时指整个事务的执行时间
TiDB: 注: ms表示毫秒, 延时指整个事务的执行时间
资源使用信息
当前使用了 iostat, mpstat 等工具对 cpu, io 等信息等进行了采集,最后总结结果为: