百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 热门文章 > 正文

OceanBase sysbench压力测试

bigegpt 2024-08-10 12:06 14 浏览

OceanBase Sysbench Test

root@dbabackup:/data/tools/sysbench# cat /etc/issue
Ubuntu 20.04.4 LTS \n \l

(1)下载安装:

 #apt -y install make automake libtool pkg-config libaio-dev
 # For MySQL support
 apt -y install libmysqlclient-dev libssl-dev
 # For PostgreSQL support
 apt -y install libpq-dev

#curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash

#sudo apt -y install sysbench

(2)测试加载库是否正常

root@dbabackup:/data/tools# ldd /usr/bin/sysbench
linux-vdso.so.1 (0x00007fffe0564000)
libmysqlclient.so.21 => /lib/x86_64-linux-gnu/libmysqlclient.so.21 (0x00007f969653f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f969651c000)
libpq.so.5 => /data/pgsqlbase/lib/libpq.so.5 (0x00007f96964d3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f96964cd000)
libaio.so.1 => /lib/x86_64-linux-gnu/libaio.so.1 (0x00007f96964c8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9696377000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f969635c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f969616a000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f969614e000)
libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f96960bb000)
libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f9695de5000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f9695dc7000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9695be5000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9696f2f000)

root@dbabackup:/data/tools# sysbench --help
Usage:
sysbench [options]... [testname] [command]

Commands implemented by most tests: prepare run cleanup help

General options:
--threads=N number of threads to use [1]
--events=N limit for total number of events [0]
--time=N limit for total execution time in seconds [10]
--forced-shutdown=STRING number of seconds to wait after the --time limit before forcing shutdown, or 'off' to disable [off]
--thread-stack-size=SIZE size of stack per thread [64K]
--rate=N average transactions rate. 0 for unlimited rate [0]
--report-interval=N periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]
--report-checkpoints=[LIST,...] dump full statistics and reset all counters at specified points in time. The argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint(s) must be performed. Report checkpoints are off by default. []
--debug[=on|off] print more debugging info [off]
--validate[=on|off] perform validation checks where possible [off]
--help[=on|off] print help and exit [off]
--version[=on|off] print version and exit [off]
--config-file=FILENAME File containing command line options
--tx-rate=N deprecated alias for --rate [0]
--max-requests=N deprecated alias for --events [0]
--max-time=N deprecated alias for --time [0]
--num-threads=N deprecated alias for --threads [1]

Pseudo-Random Numbers Generator options:
--rand-type=STRING random numbers distribution {uniform,gaussian,special,pareto} [special]
--rand-spec-iter=N number of iterations used for numbers generation [12]
--rand-spec-pct=N percentage of values to be treated as 'special' (for special distribution) [1]
--rand-spec-res=N percentage of 'special' values to use (for special distribution) [75]
--rand-seed=N seed for random number generator. When 0, the current time is used as a RNG seed. [0]
--rand-pareto-h=N parameter h for pareto distribution [0.2]

Log options:
--verbosity=N verbosity level {5 - debug, 0 - only critical messages} [3]

--percentile=N percentile to calculate in latency statistics (1-100). Use the special value of 0 to disable percentile calculations [95]
--histogram[=on|off] print latency histogram in report [off]

General database options:

--db-driver=STRING specifies database driver to use ('help' to get list of available drivers) [mysql]
--db-ps-mode=STRING prepared statements usage mode {auto, disable} [auto]
--db-debug[=on|off] print database-specific debug information [off]


Compiled-in database drivers:
mysql - MySQL driver
pgsql - PostgreSQL driver

mysql options:
--mysql-host=[LIST,...] MySQL server host [localhost]
--mysql-port=[LIST,...] MySQL server port [3306]
--mysql-socket=[LIST,...] MySQL socket
--mysql-user=STRING MySQL user [sbtest]
--mysql-password=STRING MySQL password []
--mysql-db=STRING MySQL database name [sbtest]
--mysql-ssl[=on|off] use SSL connections, if available in the client library [off]
--mysql-ssl-cipher=STRING use specific cipher for SSL connections []
--mysql-compression[=on|off] use compression, if available in the client library [off]
--mysql-debug[=on|off] trace all client library calls [off]
--mysql-ignore-errors=[LIST,...] list of errors to ignore, or "all" [1213,1020,1205]
--mysql-dry-run[=on|off] Dry run, pretend that all MySQL client API calls are successful without executing them [off]


pgsql options:
--pgsql-host=STRING PostgreSQL server host [localhost]
--pgsql-port=N PostgreSQL server port [5432]
--pgsql-user=STRING PostgreSQL user [sbtest]
--pgsql-password=STRING PostgreSQL password []
--pgsql-db=STRING PostgreSQL database name [sbtest]

Compiled-in tests:
fileio - File I/O test
cpu - CPU performance test
memory - Memory functions speed test
threads - Threads subsystem performance test
mutex - Mutex performance test

See 'sysbench <testname> help' for a list of options for each test.

root@dbabackup:/data/tools# sysbench --mysql-host=fdfasdfadfa.com --mysql-port=3306 --mysql-user=ec_mkl --mysql-db=test --table_size=1000000 --tables=30 --threads=32 --report-interval=10 --time=60 --db-ps-mode=disable --mysql-password=xxxxxxxxxx
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)


Reading the script from the standard input:

操作步聚(我的IOPS是1000):

一、运行以下命令,初始化数据库:

root@dbabackup:/usr/share/sysbench# sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host='tfffffffuncs.com' --mysql-port=3306 --mysql-user='ec_mkl' --mysql-db='test' --table_size=1000000 --tables=30 --threads=32 --report-interval=10 --time=60 --mysql-password='UxxxxxxxxhOVvUlffH' cleanup
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Dropping table 'sbtest1'...
Dropping table 'sbtest2'...
Dropping table 'sbtest3'...
Dropping table 'sbtest4'...
Dropping table 'sbtest5'...
Dropping table 'sbtest6'...
Dropping table 'sbtest7'...
Dropping table 'sbtest8'...
Dropping table 'sbtest9'...
Dropping table 'sbtest10'...
Dropping table 'sbtest11'...
Dropping table 'sbtest12'...
Dropping table 'sbtest13'...
Dropping table 'sbtest14'...
Dropping table 'sbtest15'...
Dropping table 'sbtest16'...
Dropping table 'sbtest17'...
Dropping table 'sbtest18'...
Dropping table 'sbtest19'...
Dropping table 'sbtest20'...
Dropping table 'sbtest21'...
Dropping table 'sbtest22'...
Dropping table 'sbtest23'...
Dropping table 'sbtest24'...
Dropping table 'sbtest25'...
Dropping table 'sbtest26'...
Dropping table 'sbtest27'...
Dropping table 'sbtest28'...
Dropping table 'sbtest29'...
Dropping table 'sbtest30'...

二、以下命令,新建表

root@dbabackup:/usr/share/sysbench# sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host='ssssfwfw.com' --mysql-port=3306 --mysql-user='ec_mkl' --mysql-db='test' --table_size=1000000 --tables=30 --threads=32 --report-interval=10 --time=60 --mysql-password='vfdsfsdaf' prepare
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Initializing worker threads...

Creating table 'sbtest11'...
Creating table 'sbtest6'...
Creating table 'sbtest19'...
Creating table 'sbtest1'...
Creating table 'sbtest23'...
Creating table 'sbtest24'...
Creating table 'sbtest17'...
Creating table 'sbtest3'...
Creating table 'sbtest25'...
Creating table 'sbtest5'...
Creating table 'sbtest14'...
Creating table 'sbtest7'...
Creating table 'sbtest13'...
Creating table 'sbtest8'...
Creating table 'sbtest26'...
Creating table 'sbtest16'...
Creating table 'sbtest21'...
Creating table 'sbtest9'...
Creating table 'sbtest10'...
Creating table 'sbtest15'...
Creating table 'sbtest22'...
Creating table 'sbtest12'...
Creating table 'sbtest4'...
Creating table 'sbtest18'...
Creating table 'sbtest27'...
Creating table 'sbtest29'...
Creating table 'sbtest2'...
Creating table 'sbtest28'...
Creating table 'sbtest30'...
Creating table 'sbtest20'...
Inserting 1000000 records into 'sbtest11'
Inserting 1000000 records into 'sbtest19'
Inserting 1000000 records into 'sbtest3'
Inserting 1000000 records into 'sbtest1'
Inserting 1000000 records into 'sbtest25'
Inserting 1000000 records into 'sbtest6'
Inserting 1000000 records into 'sbtest24'
Inserting 1000000 records into 'sbtest17'
Inserting 1000000 records into 'sbtest23'
Inserting 1000000 records into 'sbtest5'
Inserting 1000000 records into 'sbtest4'
Inserting 1000000 records into 'sbtest13'
Inserting 1000000 records into 'sbtest10'
Inserting 1000000 records into 'sbtest8'
Inserting 1000000 records into 'sbtest16'
Inserting 1000000 records into 'sbtest14'
Inserting 1000000 records into 'sbtest15'
Inserting 1000000 records into 'sbtest21'
Inserting 1000000 records into 'sbtest26'
Inserting 1000000 records into 'sbtest7'
Inserting 1000000 records into 'sbtest9'
Inserting 1000000 records into 'sbtest12'
Inserting 1000000 records into 'sbtest18'
Inserting 1000000 records into 'sbtest29'
Inserting 1000000 records into 'sbtest22'
Inserting 1000000 records into 'sbtest27'
Inserting 1000000 records into 'sbtest2'
Inserting 1000000 records into 'sbtest30'
Inserting 1000000 records into 'sbtest28'
Inserting 1000000 records into 'sbtest20'


Creating a secondary index on 'sbtest28'...
Creating a secondary index on 'sbtest12'...
Creating a secondary index on 'sbtest27'...
Creating a secondary index on 'sbtest20'...
Creating a secondary index on 'sbtest7'...
Creating a secondary index on 'sbtest30'...
Creating a secondary index on 'sbtest26'...
Creating a secondary index on 'sbtest25'...
Creating a secondary index on 'sbtest2'...
Creating a secondary index on 'sbtest22'...
Creating a secondary index on 'sbtest29'...
Creating a secondary index on 'sbtest13'...
Creating a secondary index on 'sbtest21'...
Creating a secondary index on 'sbtest9'...
Creating a secondary index on 'sbtest8'...
Creating a secondary index on 'sbtest18'...
Creating a secondary index on 'sbtest23'...
Creating a secondary index on 'sbtest16'...
Creating a secondary index on 'sbtest1'...
Creating a secondary index on 'sbtest24'...
Creating a secondary index on 'sbtest11'...
Creating a secondary index on 'sbtest3'...
Creating a secondary index on 'sbtest14'...
Creating a secondary index on 'sbtest17'...
Creating a secondary index on 'sbtest10'...
Creating a secondary index on 'sbtest4'...
Creating a secondary index on 'sbtest15'...
Creating a secondary index on 'sbtest5'...
Creating a secondary index on 'sbtest19'...
Creating a secondary index on 'sbtest6'...


(3)运行以下命令,执行测试:

root@dbabackup:/usr/share/sysbench# sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host='xxxxx' --mysql-port=3306 --mysql-user='ec_mkl' --mysql-db='test' --table_size=10000000 --tables=30 --threads=150 --report-interval=10 --time=60 --mysql-password='xfsfadf' --db-ps-mode=disable run
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 150
Report intermediate results every 10 second(s)
Initializing random number generator from current time


Initializing worker threads...

Threads started!

[ 10s ] thds: 150 tps: 792.32 qps: 16000.59 (r/w/o: 11222.49/3179.07/1599.03) lat (ms,95%): 227.40 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 150 tps: 849.11 qps: 16979.14 (r/w/o: 11884.57/3396.35/1698.22) lat (ms,95%): 196.89 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 150 tps: 815.81 qps: 16303.61 (r/w/o: 11410.38/3262.02/1631.21) lat (ms,95%): 211.60 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 150 tps: 794.71 qps: 15911.52 (r/w/o: 11141.79/3179.62/1590.11) lat (ms,95%): 211.60 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 150 tps: 793.19 qps: 15850.38 (r/w/o: 11092.34/3172.16/1585.88) lat (ms,95%): 215.44 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 150 tps: 782.29 qps: 15651.71 (r/w/o: 10957.20/3129.94/1564.57) lat (ms,95%): 376.49 err/s: 0.00 reconn/s: 0.00
SQL statistics:
queries performed:
read: 677992
write: 193712
other: 96856
total: 968560
transactions: 48428 (801.01 per sec.)
queries: 968560 (16020.27 per sec.)
ignored errors: 0 (0.00 per sec.)
reconnects: 0 (0.00 per sec.)

General statistics:
total time: 60.4540s
total number of events: 48428

Latency (ms):
min: 126.72
avg: 186.22
max: 1046.07
95th percentile: 215.44
sum: 9018164.46

Threads fairness:
events (avg/stddev): 322.8533/24.77
execution time (avg/stddev): 60.1211/0.09



总结:

因我的是企业版v2.2.77版本,通过外网访问,后续生产中会打标最新的v3.2.30版本,给的IOPS才1000,只是完成了简单的测试过程,不代表业务真实环境。

以下是2022年08月09日 oceanbase3.2.3.1版本的压力测试 配置大小是16C70G1-1-1多区。

--table_size=1000000 --tables=30 --threads=32 --report-interval=10 --time=60

以下是2022年08月09日polardb-mysql生产库8C32G的

=================================================--table_size=10000000 --tables=30 --threads=100 --report-interval=10 --time=60 =========================================================================

相关推荐

5分钟调色大片的方法(5分钟调色大片的方法有哪些)

哈喽大家好。在大家印象中一定觉得ps非常难学非常难。大家不要着急,小编的教学都是针对ps零基础的同学的,而且非常实用哦。只要大家跟着图文练习一两遍,保证大家立马学会~!好了,废话少说,下面开始我们今天...

闪白特效原来是这么用的(闪白特效怎么使用)

作者|高艳侠订阅|010-86092062闪白特效是影视作品中应用比较多的效果之一,那么具体该在哪些场景使用闪白特效?具体该如何操作?下面就以AdobePremiere(以下简称PR)为例,...

ppt常用小图标去哪里找?3个矢量素材网站推荐!

ppt是一个注重可视化表达的演示载体,除了高清图片,ppt中另一类常用的素材是各种小图标,也叫矢量图标,巧妙运用小图标能提升整体美观度和表现力,那么ppt常用小图标去哪里找呢?为方便各位快速找到合适的...

有什么好用的截图录屏工具?试试这9款

经常有朋友反馈苦于缺乏截屏和录屏的趁手工具,本期我们分享几个相当好用的截屏和录屏工具,希望能帮到大家。ScreenToGifScreenToGif是一款免费且开源的录屏工具。此款工具最大的特点是可以...

配色苦手福音!专业快速色环配色PS插件

今天橘子老师给的大家介绍的是一款快速配色的插件,非常强大配色苦手福音来啦!(获取方式见文末)【插件介绍】配色在后期设计中占有主导地位,好的配色能让作品更加抢眼Coolorus这款专业的配色插件,能够...

如何用PS抠主体?(ps怎么抠主体)

1.主体法抠图-抠花苞和花梗导入一张荷花苞的照片,点击上图中顶部“选择”菜单栏,下拉单击“主体”。可以看到,只有花苞被选中,但是花梗并没有被选中。接下来单击上图中左侧工具栏的“快速选择工具”,上图中顶...

2799元的4K电视,有保障吗?(买4k电视机哪个品牌好)

在上一期《电脑报》的3·15专题报道中,我们揭露了一款不靠谱的42英寸4K智能电视——TCLD42A561U。这款售价2699元的4K智能电视不仅4K画质方面存在严重问题,而且各种功能和应用体验也不理...

苹果电脑的Touch Bar推出一段时间了 这款工具可以帮你开发适用于它的APP

距离苹果推出带有TouchBar的MacBookPro已经有一段时间了,除了那些像Adobe、Google和Microsoft大公司在开发适用于TouchBar的应用之外,其实还有很多独立的开...

如魔法般吸取颜色的桌灯(如魔法般吸取颜色的桌灯叫什么)

色彩为生活带来的感官刺激,逐渐被视为理所当然。一盏桌灯运用它的神奇力量,将隐藏于物件中的颜色逐一释放,成为装点环境的空间魔法师。ColorUp是一款可以改变颜色的吸色台灯,沿用传统灯泡的造型,融入了拾...

一篇文章带你用jquery mobile设计颜色拾取器

【一、项目背景】现实生活中,我们经常会遇到配色的问题,这个时候去百度一下RGB表。而RGB表只提供相对于的颜色的RGB值而没有可以验证的模块。我们可以通过jquerymobile去设计颜色的拾取器...

ps拾色器快捷键是什么?(ps2019拾色器快捷键)

ps拾色器快捷键是什么?文章末尾有获取方式,按照以下步骤就能自动获得!学会制作PS特效需要一定程度的耐心和毅力。初学者可以从基本的工具和技术开始学习,逐渐提高他们的技能水平。同时,观看更多优秀的特效作...

免费开源的 Windows 截图录屏工具,支持 OCR 识别和滚动截图等

功能很强大、安装很小巧的免费截图、录屏工具,提供很多使用的工具来帮我么能解决问题,推荐给大家。关于ShareXShareX是一款免费的windows工具,起初是一个小巧的截图工具,经过多年的迭...

入门到精通系列PS教程:第13篇 · 拾色器、颜色问题说明及补充

入门到精通系列PS教程:第13篇·拾色器、颜色问题说明及补充作者|侯潇问题说明我的第12篇教程里,有个小问题没有说清楚。要说是错误,又不算是错误,只是没有说准确。写完那篇教程后,因为已经到了深...

PS冷知识:用吸管工具吸取屏幕上的任意颜色

今天,我们给大家介绍PS中的一个冷知识:用吸管工具可以吸取屏幕上的任意颜色。其实,操作起来是非常简单的。大多数情况下,我们认为,PS的吸管工具只能吸取PS软件作图区域范围内的颜色,最多加上画布四周的...

Windows 11 将提供内置颜色选择器工具

Windows11内置了颜色选择器,可以扫描并识别屏幕上的颜色并生成颜色代码。此外,微软还利用人工智能技术,让屏幕上的文本扫描和选择变得更加便捷。这两项功能均已在SnippingToolv1...