【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

相关文章

基于Python实现一个Windows Tree命令工具

《基于Python实现一个WindowsTree命令工具》今天想要在Windows平台的CMD命令终端窗口中使用像Linux下的tree命令,打印一下目录结构层级树,然而还真有tree命令,但是发现... 目录引言实现代码使用说明可用选项示例用法功能特点添加到环境变量方法一:创建批处理文件并添加到PATH1

Java -jar命令如何运行外部依赖JAR包

《Java-jar命令如何运行外部依赖JAR包》在Java应用部署中,java-jar命令是启动可执行JAR包的标准方式,但当应用需要依赖外部JAR文件时,直接使用java-jar会面临类加载困... 目录引言:外部依赖JAR的必要性一、问题本质:类加载机制的限制1. Java -jar的默认行为2. 类加

git stash命令基本用法详解

《gitstash命令基本用法详解》gitstash是Git中一个非常有用的命令,它可以临时保存当前工作区的修改,让你可以切换到其他分支或者处理其他任务,而不需要提交这些还未完成的修改,这篇文章主要... 目录一、基本用法1. 保存当前修改(包括暂存区和工作区的内容)2. 查看保存了哪些 stash3. 恢

java -jar命令运行 jar包时运行外部依赖jar包的场景分析

《java-jar命令运行jar包时运行外部依赖jar包的场景分析》:本文主要介绍java-jar命令运行jar包时运行外部依赖jar包的场景分析,本文给大家介绍的非常详细,对大家的学习或工作... 目录Java -jar命令运行 jar包时如何运行外部依赖jar包场景:解决:方法一、启动参数添加: -Xb

Linux基础命令@grep、wc、管道符的使用详解

《Linux基础命令@grep、wc、管道符的使用详解》:本文主要介绍Linux基础命令@grep、wc、管道符的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录grep概念语法作用演示一演示二演示三,带选项 -nwc概念语法作用wc,不带选项-c,统计字节数-

MySQL的ALTER TABLE命令的使用解读

《MySQL的ALTERTABLE命令的使用解读》:本文主要介绍MySQL的ALTERTABLE命令的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、查看所建表的编China编程码格式2、修改表的编码格式3、修改列队数据类型4、添加列5、修改列的位置5.1、把列

Linux命令之firewalld的用法

《Linux命令之firewalld的用法》:本文主要介绍Linux命令之firewalld的用法,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux命令之firewalld1、程序包2、启动firewalld3、配置文件4、firewalld规则定义的九大

Linux之计划任务和调度命令at/cron详解

《Linux之计划任务和调度命令at/cron详解》:本文主要介绍Linux之计划任务和调度命令at/cron的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux计划任务和调度命令at/cron一、计划任务二、命令{at}介绍三、命令语法及功能 :at

Linux ls命令操作详解

《Linuxls命令操作详解》通过ls命令,我们可以查看指定目录下的文件和子目录,并结合不同的选项获取详细的文件信息,如权限、大小、修改时间等,:本文主要介绍Linuxls命令详解,需要的朋友可... 目录1. 命令简介2. 命令的基本语法和用法2.1 语法格式2.2 使用示例2.2.1 列出当前目录下的文

Spring Boot项目部署命令java -jar的各种参数及作用详解

《SpringBoot项目部署命令java-jar的各种参数及作用详解》:本文主要介绍SpringBoot项目部署命令java-jar的各种参数及作用的相关资料,包括设置内存大小、垃圾回收... 目录前言一、基础命令结构二、常见的 Java 命令参数1. 设置内存大小2. 配置垃圾回收器3. 配置线程栈大小