【SysBench】sysbench-1.20 命令速查表

2024-03-14 17:12
文章标签 命令 sysbench 1.20 速查表

本文主要是介绍【SysBench】sysbench-1.20 命令速查表,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1、通用语法

The general command line syntax for sysbench is:

	  sysbench [options]... [testname] [command] 
  • testname is an optional name of a built-in test (e.g. fileio,
    memory, cpu, etc.), or a name of one of the bundled Lua scripts
    (e.g. oltp_read_only), or a path to a custom Lua script. If no
    test name is specified on the command line (and thus, there is no
    command too, as in that case it would be parsed as a testname), or
    the test name is a dash (“-”), then sysbench expects a Lua script to
    execute on its standard input.

  • command is an optional argument that will be passed by sysbench to
    the built-in test or script specified with testname. command
    defines the action that must be performed by the test. The list of
    available commands depends on a particular test. Some tests also
    implement their own custom commands.

    Below is a description of typical test commands and their purpose:

    • prepare: performs preparative actions for those tests which need
      them, e.g. creating the necessary files on disk for the fileio
      test, or filling the test database for database benchmarks.
    • run: runs the actual test specified with the testname
      argument. This command is provided by all tests.
    • cleanup: removes temporary data after the test run in those
      tests which create one.
    • help: displays usage information for the test specified with the
      testname argument. This includes the full list of commands
      provided by the test, so it should be used to get the available
      commands.
  • options is a list of zero or more command line options starting with
    '--'. As with commands, the sysbench testname help command
    should be used to describe available options provided by a
    particular test.

You can use sysbench --help to display the general command line syntax
and options.

2、通用命令行选项

$ sysbench --help
Usage:sysbench [options]... [testname] [command]Commands implemented by most tests: prepare run cleanup helpGeneral 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 driverpgsql - PostgreSQL drivermysql 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 testcpu - CPU performance testmemory - Memory functions speed testthreads - Threads subsystem performance testmutex - Mutex performance testSee 'sysbench <testname> help' for a list of options for each test.

以下为 sysbench 编译时内置的测试模块,包括 CPU、文件 I/O、内存、线程、互斥(Mutex)。

2、CPU

$ sysbench cpu help
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)cpu options:--cpu-max-prime=N upper limit for primes generator [10000]

3、文件 I/O

$ sysbench fileio help
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)fileio options:--file-num=N                  number of files to create [128]--file-block-size=N           block size to use in all IO operations [16384]--file-total-size=SIZE        total size of files to create [2G]--file-test-mode=STRING       test mode {seqwr, seqrewr, seqrd, rndrd, rndwr, rndrw}--file-io-mode=STRING         file operations mode {sync,async,mmap} [sync]--file-async-backlog=N        number of asynchronous operatons to queue per thread [128]--file-extra-flags=[LIST,...] list of additional flags to use to open files {sync,dsync,direct} []--file-fsync-freq=N           do fsync() after this number of requests (0 - don't use fsync()) [100]--file-fsync-all[=on|off]     do fsync() after each write operation [off]--file-fsync-end[=on|off]     do fsync() at the end of test [on]--file-fsync-mode=STRING      which method to use for synchronization {fsync, fdatasync} [fsync]--file-merged-requests=N      merge at most this number of IO requests if possible (0 - don't merge) [0]--file-rw-ratio=N             reads/writes ratio for combined test [1.5]

4、内存

$ sysbench memory help
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)memory options:--memory-block-size=SIZE    size of memory block for test [1K]--memory-total-size=SIZE    total size of data to transfer [100G]--memory-scope=STRING       memory access scope {global,local} [global]--memory-hugetlb[=on|off]   allocate memory from HugeTLB pool [off]--memory-oper=STRING        type of memory operations {read, write, none} [write]--memory-access-mode=STRING memory access mode {seq,rnd} [seq]

5、线程

$ sysbench threads help
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)threads options:--thread-yields=N number of yields to do per request [1000]--thread-locks=N  number of locks per thread [8]

6、互斥(Mutex)

$ sysbench mutex help
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)mutex options:--mutex-num=N   total size of mutex array [4096]--mutex-locks=N number of mutex locks to do per thread [50000]--mutex-loops=N number of empty loops to do outside mutex lock [10000]

7、OLTP 数据库基准测试 Lua 脚本

$ ls -1 /usr/local/share/sysbench
bulk_insert.lua
oltp_common.lua
oltp_delete.lua
oltp_insert.lua
oltp_point_select.lua
oltp_read_only.lua
oltp_read_write.lua
oltp_update_index.lua
oltp_update_non_index.lua
oltp_write_only.lua
select_random_points.lua
select_random_ranges.lua

这篇关于【SysBench】sysbench-1.20 命令速查表的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/809117

相关文章

Linux使用dd命令来复制和转换数据的操作方法

《Linux使用dd命令来复制和转换数据的操作方法》Linux中的dd命令是一个功能强大的数据复制和转换实用程序,它以较低级别运行,通常用于创建可启动的USB驱动器、克隆磁盘和生成随机数据等任务,本文... 目录简介功能和能力语法常用选项示例用法基础用法创建可启动www.chinasem.cn的 USB 驱动

关于Maven生命周期相关命令演示

《关于Maven生命周期相关命令演示》Maven的生命周期分为Clean、Default和Site三个主要阶段,每个阶段包含多个关键步骤,如清理、编译、测试、打包等,通过执行相应的Maven命令,可以... 目录1. Maven 生命周期概述1.1 Clean Lifecycle1.2 Default Li

windows系统下shutdown重启关机命令超详细教程

《windows系统下shutdown重启关机命令超详细教程》shutdown命令是一个强大的工具,允许你通过命令行快速完成关机、重启或注销操作,本文将为你详细解析shutdown命令的使用方法,并提... 目录一、shutdown 命令简介二、shutdown 命令的基本用法三、远程关机与重启四、实际应用

Linux使用nohup命令在后台运行脚本

《Linux使用nohup命令在后台运行脚本》在Linux或类Unix系统中,后台运行脚本是一项非常实用的技能,尤其适用于需要长时间运行的任务或服务,本文我们来看看如何使用nohup命令在后台... 目录nohup 命令简介基本用法输出重定向& 符号的作用后台进程的特点注意事项实际应用场景长时间运行的任务服

Redis的Hash类型及相关命令小结

《Redis的Hash类型及相关命令小结》edisHash是一种数据结构,用于存储字段和值的映射关系,本文就来介绍一下Redis的Hash类型及相关命令小结,具有一定的参考价值,感兴趣的可以了解一下... 目录HSETHGETHEXISTSHDELHKEYSHVALSHGETALLHMGETHLENHSET

如何使用 Bash 脚本中的time命令来统计命令执行时间(中英双语)

《如何使用Bash脚本中的time命令来统计命令执行时间(中英双语)》本文介绍了如何在Bash脚本中使用`time`命令来测量命令执行时间,包括`real`、`user`和`sys`三个时间指标,... 使用 Bash 脚本中的 time 命令来统计命令执行时间在日常的开发和运维过程中,性能监控和优化是不

PHP执行php.exe -v命令报错的解决方案

《PHP执行php.exe-v命令报错的解决方案》:本文主要介绍PHP执行php.exe-v命令报错的解决方案,文中通过图文讲解的非常详细,对大家的学习或工作有一定的帮助,需要的朋友可以参考下... 目录执行phpandroid.exe -v命令报错解决方案执行php.exe -v命令报错-PHP War

CentOS系统使用yum命令报错问题及解决

《CentOS系统使用yum命令报错问题及解决》文章主要讲述了在CentOS系统中使用yum命令时遇到的错误,并提供了个人解决方法,希望对大家有所帮助,并鼓励大家支持脚本之家... 目录Centos系统使用yum命令报错找到文件替换源文件为总结CentOS系统使用yum命令报错http://www.cppc

零基础学习Redis(10) -- zset类型命令使用

zset是有序集合,内部除了存储元素外,还会存储一个score,存储在zset中的元素会按照score的大小升序排列,不同元素的score可以重复,score相同的元素会按照元素的字典序排列。 1. zset常用命令 1.1 zadd  zadd key [NX | XX] [GT | LT]   [CH] [INCR] score member [score member ...]

30常用 Maven 命令

Maven 是一个强大的项目管理和构建工具,它广泛用于 Java 项目的依赖管理、构建流程和插件集成。Maven 的命令行工具提供了大量的命令来帮助开发人员管理项目的生命周期、依赖和插件。以下是 常用 Maven 命令的使用场景及其详细解释。 1. mvn clean 使用场景:清理项目的生成目录,通常用于删除项目中自动生成的文件(如 target/ 目录)。共性规律:清理操作