sysbench压力测试工具mysql以及postgresql

sysbench压力测试工具mysql以及postgresql

sysbench工具安装

[postgres@oradb sysbench-1.0.20]$ ./autogen.sh 
./autogen.sh: running `libtoolize --copy --force' 
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
./autogen.sh: running `aclocal -I m4' 
./autogen.sh: running `autoheader' 
./autogen.sh: running `automake -c --foreign --add-missing' 
configure.ac:59: installing 'config/ar-lib'
configure.ac:45: installing 'config/compile'
configure.ac:27: installing 'config/config.guess'
configure.ac:27: installing 'config/config.sub'
configure.ac:32: installing 'config/install-sh'
configure.ac:32: installing 'config/missing'
src/Makefile.am: installing 'config/depcomp'
parallel-tests: installing 'config/test-driver'
./autogen.sh: running `autoconf' 
Libtoolized with: libtoolize (GNU libtool) 2.4.2
Automade with: automake (GNU automake) 1.13.4
Configured with: autoconf (GNU Autoconf) 2.69
[postgres@oradb sysbench-1.0.20]$ 

yum install automake

yum install libtool.x86_64

yum -y install postgresql-devel

[postgres@oradb sysbench-1.0.20]$ yum list |grep automake
automake.noarch                         1.13.4-3.el7                   @anaconda
[postgres@oradb sysbench-1.0.20]$ 
[postgres@oradb sysbench-1.0.20]$ yum list |grep libtool
libtool.x86_64                          2.4.2-22.el7_3                 @anaconda
libtool-ltdl.x86_64                     2.4.2-22.el7_3                 @anaconda
[postgres@oradb sysbench-1.0.20]$ yum list |grep postgresql-devel
postgresql-devel.x86_64                 9.2.24-2.el7                   locao    
[postgres@oradb sysbench-1.0.20]$ yum install -y postgresql-devel

./configure --prefix=/opt/sysbench --without-mysql --with-pgsql

make

make install

[postgres@oradb sysbench-1.0.20]$ ./configure --prefix=/opt/sysbench --without-mysql --with-pgsql
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking how to run the C preprocessor... gcc -E
checking whether gcc -std=gnu99 and cc understand -c and -o together... yes
checking for a sed that does not truncate output... /bin/sed
checking for C compiler vendor... gnu
checking for gcc architecture flag... 
checking for x86 cpuid 0 output... 16:756e6547:6c65746e:49656e69
checking for x86 cpuid 1 output... 906e9:10800:defa220b:178bfbff
checking whether C compiler accepts -march=core2... yes
checking for gcc architecture flag... -march=core2
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... no
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for pkg-config... yes
checking for C compiler vendor... (cached) gnu
checking whether to compile with MySQL support... no
checking whether to compile with Drizzle support... no
checking whether to compile with libattachsql support... no
checking whether to compile with Oracle support... no
checking whether to compile with PostgreSQL support... yes
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether to build with system or bundled LuaJIT... bundled
checking whether to build with system or bundled Concurrency Kit... bundled
checking whether SHM_HUGETLB is declared... yes
checking whether O_SYNC is declared... yes
checking for xsltproc... xsltproc
checking whether xsltproc works... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for sqrt in -lm... yes
checking for ld used by GCC... /bin/ld -m elf_x86_64
checking if the linker (/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for pg_config... /usr/local/pgsql/bin/pg_config
checking PostgreSQL C flags... -I/usr/local/pgsql/include
checking PostgreSQL linker flags... -L/usr/local/pgsql/lib -lpq
checking libaio.h usability... yes
checking libaio.h presence... yes
checking for libaio.h... yes
checking for io_queue_init in -laio... yes
checking if io_getevents() has an old interface... no
checking for malloc in -lumem... no
checking for malloc in -lmtmalloc... no
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/aio.h usability... no
checking sys/aio.h presence... no
checking for sys/aio.h... no
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking thread.h usability... no
checking thread.h presence... no
checking for thread.h... no
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking for off_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for thread local storage (TLS) class... __thread
checking for __attribute__((format))... yes
checking for __attribute__((unused))... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of size_t... 8
checking size of bool... 1
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking for library containing clock_gettime... none required
checking for alarm... yes
checking for clock_gettime... yes
checking for directio... no
checking for fdatasync... yes
checking for gettimeofday... yes
checking for isatty... yes
checking for memalign... yes
checking for memset... yes
checking for posix_memalign... yes
checking for pthread_yield... yes
checking for setvbuf... yes
checking for sqrt... yes
checking for strdup... yes
checking for thr_setconcurrency... no
checking for valloc... yes
checking for pthread_once... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/xsl/Makefile
config.status: creating doc/xsl/catalog.xml
config.status: creating doc/Makefile
config.status: creating third_party/luajit/Makefile
config.status: creating third_party/concurrency_kit/Makefile
config.status: creating src/Makefile
config.status: creating src/drivers/Makefile
config.status: creating src/drivers/mysql/Makefile
config.status: creating src/drivers/drizzle/Makefile
config.status: creating src/drivers/oracle/Makefile
config.status: creating src/drivers/pgsql/Makefile
config.status: creating src/drivers/attachsql/Makefile
config.status: creating src/tests/Makefile
config.status: creating src/tests/cpu/Makefile
config.status: creating src/tests/fileio/Makefile
config.status: creating src/tests/memory/Makefile
config.status: creating src/tests/threads/Makefile
config.status: creating src/tests/mutex/Makefile
config.status: creating src/lua/Makefile
config.status: creating src/lua/internal/Makefile
config.status: creating tests/Makefile
config.status: creating tests/include/config.sh
config.status: creating snap/snapcraft.yaml
config.status: creating config/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
===============================================================================
sysbench version   : 1.0.20
CC                 : gcc -std=gnu99
CFLAGS             : -O2 -funroll-loops  -Wall -Wextra -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wnested-externs -Wno-format-zero-length -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align -Wvla   -pthread
CPPFLAGS           : -D_GNU_SOURCE   -I$(top_srcdir)/src -I$(abs_top_builddir)/third_party/luajit/inc -I$(abs_top_builddir)/third_party/concurrency_kit/include
LDFLAGS            :  
LIBS               : -laio -lm 
EXTRA_LDFLAGS      : 

prefix             : /opt/sysbench
bindir             : ${prefix}/bin
libexecdir         : ${prefix}/libexec
mandir             : ${prefix}/share/man
datadir            : ${prefix}/share

MySQL support      : no
Drizzle support    : no
AttachSQL support  : no
Oracle support     : no
PostgreSQL support : yes

LuaJIT             : bundled
LUAJIT_CFLAGS      : -I$(abs_top_builddir)/third_party/luajit/inc
LUAJIT_LIBS        : $(abs_top_builddir)/third_party/luajit/lib/libluajit-5.1.a -ldl
LUAJIT_LDFLAGS     : -rdynamic

Concurrency Kit    : bundled
CK_CFLAGS          : -I$(abs_top_builddir)/third_party/concurrency_kit/include
CK_LIBS            : $(abs_top_builddir)/third_party/concurrency_kit/lib/libck.a
configure flags    : 
===============================================================================
[postgres@oradb sysbench-1.0.20]$ 

安装完成确认

[postgres@oradb bin]$ ./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)
  --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:
  pgsql - PostgreSQL driver

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.

[postgres@oradb bin]$ 


[postgres@oradb bin]$ ./sysbench --version
sysbench 1.0.20
[postgres@oradb bin]$ 

安装完成后检查确认,安装后的目录/opt/sysbench/bin,/opt/sysbench/share,

其中bin目录下是可执行文件,share目录下是一些自定义的lua脚本

[postgres@oradb sysbench]$ ll
total 0
drwxrwxr-x 2 postgres postgres 22 Jan 26 15:09 bin
drwxrwxr-x 4 postgres postgres 33 Jan 26 15:09 share

[postgres@oradb sysbench]$ ll
total 0
drwxrwxr-x 2 postgres postgres 22 Jan 26 15:09 bin
drwxrwxr-x 4 postgres postgres 33 Jan 26 15:09 share
[postgres@oradb sysbench]$ cd share/
[postgres@oradb share]$ ll
total 4
drwxrwxr-x 3 postgres postgres   22 Jan 26 15:09 doc
drwxrwxr-x 3 postgres postgres 4096 Jan 26 15:09 sysbench
[postgres@oradb share]$ cd sysbench/
[postgres@oradb sysbench]$ ll
total 60
-rwxr-xr-x 1 postgres postgres  1452 Jan 26 15:09 bulk_insert.lua
-rw-r--r-- 1 postgres postgres 14369 Jan 26 15:09 oltp_common.lua
-rwxr-xr-x 1 postgres postgres  1290 Jan 26 15:09 oltp_delete.lua
-rwxr-xr-x 1 postgres postgres  2415 Jan 26 15:09 oltp_insert.lua
-rwxr-xr-x 1 postgres postgres  1265 Jan 26 15:09 oltp_point_select.lua
-rwxr-xr-x 1 postgres postgres  1649 Jan 26 15:09 oltp_read_only.lua
-rwxr-xr-x 1 postgres postgres  1824 Jan 26 15:09 oltp_read_write.lua
-rwxr-xr-x 1 postgres postgres  1118 Jan 26 15:09 oltp_update_index.lua
-rwxr-xr-x 1 postgres postgres  1127 Jan 26 15:09 oltp_update_non_index.lua
-rwxr-xr-x 1 postgres postgres  1440 Jan 26 15:09 oltp_write_only.lua
-rwxr-xr-x 1 postgres postgres  1919 Jan 26 15:09 select_random_points.lua
-rwxr-xr-x 1 postgres postgres  2118 Jan 26 15:09 select_random_ranges.lua
drwxr-xr-x 4 postgres postgres    49 Jan 26 15:09 tests

模拟测试

./sysbench \
--db-driver=pgsql \
--pgsql-host=127.0.0.1 \
--pgsql-port=5432 \
--pgsql-user=postgres \
--pgsql-password=postgres \
--pgsql-db=test_db \
--tables=4 \
--table-size=100000 \
--threads=50 \
--time=60 \
--events=0 \
--report-interval=10 \
--percentile=99 \
/opt/sysbench/share/sysbench/oltp_read_write.lua \
prepare


## --db-driver=pgsql : 设置pgsql驱动
## --tables=4 :设置为N个table的测试
## --table-size=100000 :每张table的生成测试数据条数,有的版本设置参数为  --oltp-table-size=100000
## --threads=50 :压测发起线程数(并发连接)
## --time=60 : 压测时长,单位秒 , 如果设置events,则无需设置该时间
## --events=0:压测时设置的总请求书,因为上面已经定义了总执行时长,所以总请求数可以设定为 0;也可以只设定总请求数,不设定最大执行时长
## --report-interval=10 :表示每10秒输出一次测试进度报告,输出对应下面的,压测中的测试报告
## --percentile=99  表示设定采样比例,默认是 95%,即丢弃1%的长请求,在剩余的99%里取最大值,根据需要设定


[postgres@oradb bin]$ ./sysbench --db-driver=pgsql --pgsql-host=127.0.0.1 --pgsql-port=5432 --pgsql-user=postgres --pgsql-password=postgres --pgsql-db=test_db --tables=4 --table-size=100000 --threads=50 --time=60 --events=0 --report-interval=10 --percentile=99 /opt/sysbench/share/sysbench/oltp_read_write.lua prepare
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Initializing worker threads...

Creating table 'sbtest2'...
Creating table 'sbtest3'...
Creating table 'sbtest1'...
Creating table 'sbtest4'...
Inserting 100000 records into 'sbtest4'
Inserting 100000 records into 'sbtest2'
Inserting 100000 records into 'sbtest3'
Inserting 100000 records into 'sbtest1'
Creating a secondary index on 'sbtest2'...
Creating a secondary index on 'sbtest4'...
Creating a secondary index on 'sbtest1'...
Creating a secondary index on 'sbtest3'...
[postgres@oradb bin]$ 




./sysbench \
--db-driver=pgsql \
--pgsql-host=127.0.0.1 \
--pgsql-port=5432 \
--pgsql-user=postgres \
--pgsql-password=postgres \
--pgsql-db=test_db \
--tables=4 \
--table-size=10000000 \
--threads=50 \
--time=60 \
--events=0 \
--report-interval=10 \
--percentile=99 \
/opt/sysbench/share/sysbench/oltp_read_write.lua \
run



[postgres@oradb bin]$ ./sysbench \
> --db-driver=pgsql \
> --pgsql-host=127.0.0.1 \
> --pgsql-port=5432 \
> --pgsql-user=postgres \
> --pgsql-password=postgres \
> --pgsql-db=test_db \
> --tables=4 \
> --table-size=10000000 \
> --threads=50 \
> --time=60 \
> --events=0 \
> --report-interval=10 \
> --percentile=99 \
> /opt/sysbench/share/sysbench/oltp_read_write.lua \
> run
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

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


Initializing worker threads...

Threads started!

[ 10s ] thds: 50 tps: 531.59 qps: 10688.54 (r/w/o: 7490.91/541.39/2656.24) lat (ms,99%): 267.41 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 50 tps: 564.62 qps: 11294.86 (r/w/o: 7907.22/594.12/2793.51) lat (ms,99%): 147.61 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 50 tps: 492.70 qps: 9847.37 (r/w/o: 6891.55/530.89/2424.93) lat (ms,99%): 219.36 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 50 tps: 530.54 qps: 10616.09 (r/w/o: 7433.75/586.42/2595.92) lat (ms,99%): 337.94 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 50 tps: 546.21 qps: 10929.92 (r/w/o: 7650.79/624.86/2654.27) lat (ms,99%): 227.40 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 50 tps: 489.99 qps: 9790.48 (r/w/o: 6853.25/570.69/2366.55) lat (ms,99%): 320.17 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            442484
        write:                           34537
        other:                           155099
        total:                           632120
    transactions:                        31606  (525.82 per sec.)
    queries:                             632120 (10516.34 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          60.1069s
    total number of events:              31606

Latency (ms):
         min:                                    2.37
         avg:                                   95.02
         max:                                 1281.30
         99th percentile:                      253.35
         sum:                              3003184.77

Threads fairness:
    events (avg/stddev):           632.1200/11.06
    execution time (avg/stddev):   60.0637/0.03

[postgres@oradb bin]$ 

清理测试数据

[postgres@oradb bin]$ ./sysbench \
> --db-driver=pgsql \
> --pgsql-host=127.0.0.1 \
> --pgsql-port=5432 \
> --pgsql-user=postgres \
> --pgsql-password=postgres \
> --pgsql-db=test_db \
> --tables=4 \
> --table-size=10000000 \
> --threads=50 \
> --time=60 \
> --events=0 \
> --report-interval=10 \
> --percentile=99 \
> /opt/sysbench/share/sysbench/oltp_read_write.lua \
> cleanup
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Dropping table 'sbtest1'...
Dropping table 'sbtest2'...
Dropping table 'sbtest3'...
Dropping table 'sbtest4'...
[postgres@oradb bin]$ 
[postgres@oradb bin]$ 
相关推荐
Allen_LVyingbo2 小时前
DRG/DIP 2.0时代下基于PostgreSQL的成本管理实践与探索(上)
postgresql·健康医疗
boonya3 小时前
Yearning开源MySQL SQL审核平台
数据库·mysql·开源
CPU NULL4 小时前
新版IDEA创建数据库表
java·数据库·spring boot·sql·学习·mysql·intellij-idea
J不A秃V头A4 小时前
MySQL 中开启二进制日志(Binlog)
数据库·mysql
V+zmm101347 小时前
食堂订餐小程序ssm+论文源码调试讲解
java·数据库·微信小程序·小程序·毕业设计
lingllllove8 小时前
解决MySQL删除/var/lib/mysql下的所有文件后无法启动的问题
数据库·mysql·adb
Zda天天爱打卡8 小时前
【趣学SQL】第四章:高级 SQL 功能 4.1 触发器与存储过程——数据库的“自动机器人“和“万能工具箱“
数据库·sql·oracle
小Tomkk11 小时前
oracle 分区表介绍
数据库·oracle
yaoxin52112311 小时前
第七章 C - D 开头的术语
数据库·oracle
跳跳的向阳花11 小时前
06、Redis相关概念:缓存击穿、雪崩、穿透、预热、降级、一致性等
数据库·redis·缓存