searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

SysBench性能测试工具

2023-12-13 06:29:50
5
0

SysBench 是一个基于 LuaJIT 的可编写多线程基准测试工具。它最常用于数据库基准测试,但也可用于创建不涉及数据库服务器的任意复杂工作负载。

特性:

  • 提供大量的速率和延迟的统计数据,包括延迟的百分比和柱状图。
  • 即使有成千上万的并发线程,开销也很低。sysbench 能够每秒产生和跟踪数以亿计的事件。
  • 通过在用户提供的 Lua 脚本中实现预定义的钩子,可以轻松创建新的基准。
  • 也可以作为一个通用的 Lua 解释器,只需在你的脚本中用#!/usr/bin/sysbench 替换#!/usr/bin/lua

 

sysbench的基本命令格式为:

sysbench –test=< test-name> [options]… < command>
sysbench [general-options]... --test=<test-name> [test-options]... command

General options: #通用选项

--num-threads=N         number of threads to use [1] #创建测试线程的数目。默认为1.

--max-requests=N         limit for total number of requests [10000] #请求的最大数目。默认为10000,0代表不限制。

--max-time=N         limit for total execution time in seconds [0] #最大执行时间,单位是s。默认是0,不限制。

--forced-shutdown=STRING         amount of time to wait after --max-time before forcing shutdown [off] #超过max-time强制中断。默认是off。

--thread-stack-size=SIZE         size of stack per thread [32K] #每个线程的堆栈大小。默认是32K。

--init-rng=[on|off]                 initialize random number generator [off] #在测试开始时是否初始化随机数发生器。默认是off。

--test=STRING         test to run #指定测试类型。

fileio

cpu

memory

threads

mutex

--debug=[on|off]         print more debugging info [off] #是否显示更多的调试信息。默认是off。 --validate=[on|off]         perform validation checks where possible [off] #在可能情况下执行验证检查。默认是off。

--help=[on|off]         print help and exit #帮助信息。 --version=[on|off] print version and exit #版本信息。

--report-interval         --指定每多少秒在屏幕上输出一次结果

--日志选项

--verbosity=N         --日志级别,默认为3,5=debug,0=只包含重要信息

Compiled-in tests: #测试项目

fileio - File I/O test #IO

cpu - CPU performance test #CPU

memory - Memory functions speed test #内存

threads - Threads subsystem performance test #线程

mutex - Mutex performance test #互斥性能测试

oltp - OLTP test # 数据库,事务处理

Commands:

测试的步骤

prepare:测试前准备工作(生成测试需要的数据);

run:进行性能测试

cleanup:测试后删掉测试数据

help version

See 'sysbench --test=<name> help' for a list of options for each test. #查看每个测试项目的更多选项列表

0条评论
0 / 1000
2****m
2文章数
0粉丝数
2****m
2 文章 | 0 粉丝
2****m
2文章数
0粉丝数
2****m
2 文章 | 0 粉丝
原创

SysBench性能测试工具

2023-12-13 06:29:50
5
0

SysBench 是一个基于 LuaJIT 的可编写多线程基准测试工具。它最常用于数据库基准测试,但也可用于创建不涉及数据库服务器的任意复杂工作负载。

特性:

  • 提供大量的速率和延迟的统计数据,包括延迟的百分比和柱状图。
  • 即使有成千上万的并发线程,开销也很低。sysbench 能够每秒产生和跟踪数以亿计的事件。
  • 通过在用户提供的 Lua 脚本中实现预定义的钩子,可以轻松创建新的基准。
  • 也可以作为一个通用的 Lua 解释器,只需在你的脚本中用#!/usr/bin/sysbench 替换#!/usr/bin/lua

 

sysbench的基本命令格式为:

sysbench –test=< test-name> [options]… < command>
sysbench [general-options]... --test=<test-name> [test-options]... command

General options: #通用选项

--num-threads=N         number of threads to use [1] #创建测试线程的数目。默认为1.

--max-requests=N         limit for total number of requests [10000] #请求的最大数目。默认为10000,0代表不限制。

--max-time=N         limit for total execution time in seconds [0] #最大执行时间,单位是s。默认是0,不限制。

--forced-shutdown=STRING         amount of time to wait after --max-time before forcing shutdown [off] #超过max-time强制中断。默认是off。

--thread-stack-size=SIZE         size of stack per thread [32K] #每个线程的堆栈大小。默认是32K。

--init-rng=[on|off]                 initialize random number generator [off] #在测试开始时是否初始化随机数发生器。默认是off。

--test=STRING         test to run #指定测试类型。

fileio

cpu

memory

threads

mutex

--debug=[on|off]         print more debugging info [off] #是否显示更多的调试信息。默认是off。 --validate=[on|off]         perform validation checks where possible [off] #在可能情况下执行验证检查。默认是off。

--help=[on|off]         print help and exit #帮助信息。 --version=[on|off] print version and exit #版本信息。

--report-interval         --指定每多少秒在屏幕上输出一次结果

--日志选项

--verbosity=N         --日志级别,默认为3,5=debug,0=只包含重要信息

Compiled-in tests: #测试项目

fileio - File I/O test #IO

cpu - CPU performance test #CPU

memory - Memory functions speed test #内存

threads - Threads subsystem performance test #线程

mutex - Mutex performance test #互斥性能测试

oltp - OLTP test # 数据库,事务处理

Commands:

测试的步骤

prepare:测试前准备工作(生成测试需要的数据);

run:进行性能测试

cleanup:测试后删掉测试数据

help version

See 'sysbench --test=<name> help' for a list of options for each test. #查看每个测试项目的更多选项列表

文章来自个人专栏
2569538687
2 文章 | 1 订阅
0条评论
0 / 1000
请输入你的评论
0
0