当前位置: 首页 > article >正文

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}/shareMySQL support      : no
Drizzle support    : no
AttachSQL support  : no
Oracle support     : no
PostgreSQL support : yesLuaJIT             : 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     : -rdynamicConcurrency 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 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)--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 driverpgsql 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.[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 timeInitializing 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:                            442484write:                           34537other:                           155099total:                           632120transactions:                        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.1069stotal number of events:              31606Latency (ms):min:                                    2.37avg:                                   95.02max:                                 1281.3099th percentile:                      253.35sum:                              3003184.77Threads fairness:events (avg/stddev):           632.1200/11.06execution 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]$ 

相关文章:

sysbench压力测试工具mysql以及postgresql

sysbench压力测试工具mysql以及postgresql sysbench工具安装 [postgresoradb 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/ltm…...

9.中断系统、EXTI外部中断

中断系统原理 中断 中断系统是管理和执行中断的逻辑结构&#xff0c;外部中断是众多能产生中断的外设之一&#xff0c;所以本节我们就借助外部中断来学习一下中断系统。在以后学习其它外设的时候&#xff0c;也是会经常和中断打交道的。 中断&#xff1a;在主程序运行过程中…...

Oracle 12c 中的 CDB和PDB的启动和关闭

一、简介 Oracle 12c引入了多租户架构&#xff0c;允许一个容器数据库&#xff08;Container Database, CDB&#xff09;托管多个独立的可插拔数据库&#xff08;Pluggable Database, PDB&#xff09;。本文档旨在详细描述如何启动和关闭CDB及PDB。 二、容器数据库 (CDB) 2.1…...

RocketMQ原理—4.消息读写的性能优化

大纲 1.Producer基于队列的消息分发机制 2.Producer基于Hash的有序消息分发 3.Broker如何实现高并发消息数据写入 4.RocketMQ读写队列的运作原理分析 5.Consumer拉取消息的流程原理分析 6.ConsumeQueue的随机位置读取需求分析 7.ConsumeQueue的物理存储结构设计 8.Cons…...

【C++动态规划 网格】2328. 网格图中递增路径的数目|2001

本文涉及知识点 C动态规划 LeetCode2328. 网格图中递增路径的数目 给你一个 m x n 的整数网格图 grid &#xff0c;你可以从一个格子移动到 4 个方向相邻的任意一个格子。 请你返回在网格图中从 任意 格子出发&#xff0c;达到 任意 格子&#xff0c;且路径中的数字是 严格递…...

Web3.0时代的挑战与机遇:以开源2+1链动模式AI智能名片S2B2C商城小程序为例的深度探讨

摘要&#xff1a;Web3.0作为互联网的下一代形态&#xff0c;承载着去中心化、开放性和安全性的重要愿景。然而&#xff0c;其高门槛、用户体验差等问题阻碍了Web3.0的主流化进程。本文旨在深入探讨Web3.0面临的挑战&#xff0c;并提出利用开源21链动模式、AI智能名片及S2B2C商城…...

MySQL(高级特性篇) 12 章——数据库其它调优策略

一、数据库调优的措施 &#xff08;1&#xff09;调优的目标 尽可能节省系统资源&#xff0c;以便系统可以提供更大负荷的服务&#xff08;吞吐量最大&#xff09;合理的结构设计和参数调整&#xff0c;以提高用户操作的响应速度&#xff08;响应速度更快&#xff09;减少系统…...

单片机基础模块学习——DS18B20温度传感器芯片

不知道该往哪走的时候&#xff0c;就往前走。 一、DS18B20芯片原理图 该芯片共有三个引脚&#xff0c;分别为 GND——接地引脚DQ——数据通信引脚VDD——正电源 数据通信用到的是1-Wier协议 优点&#xff1a;占用端口少&#xff0c;电路设计方便 同时该协议要求通过上拉电阻…...

掌握长尾关键词优化技巧提升SEO效果与流量增长策略

内容概要 长尾关键词是指由三个或更多个词组成的关键词&#xff0c;这类关键词通常搜索量相对较低&#xff0c;但在搜索引擎优化&#xff08;SEO&#xff09;中的作用却不可忽视。它们能够精确定位用户的需求&#xff0c;因为长尾关键词往往反映了用户更具体的搜索意图。掌握长…...

AAAI2024论文解读|HGPROMPT Bridging Homogeneous and Heterogeneous Graphs

论文标题 HGPROMPT: Bridging Homogeneous and Heterogeneous Graphs for Few-shot Prompt Learning 跨同构异构图的小样本提示学习 论文链接 HGPROMPT: Bridging Homogeneous and Heterogeneous Graphs for Few-shot Prompt Learning论文下载 论文作者 Xingtong Yu, Yuan…...

高频 SQL 50 题(基础版)_620. 有趣的电影

高频 SQL 50 题&#xff08;基础版&#xff09;_620. 有趣的电影 一级目录 表&#xff1a;cinema id 是该表的主键(具有唯一值的列)。 每行包含有关电影名称、类型和评级的信息。 评级为 [0,10] 范围内的小数点后 2 位浮点数。 编写解决方案&#xff0c;找出所有影片描述为 …...

git的理解与使用

本地的git git除了最经典的add commit push用来做版本管理&#xff0c;其实他的分支管理也非常强大 可以说你学好了分支管理&#xff0c;就可以完成团队的配合协作了 git仓库 我们可以使用git init来初始化一个git仓库&#xff0c;只要能看见.git文件夹&#xff0c;就代表这…...

Java进阶(一)

目录 一.Java注解 什么是注解&#xff1f; 内置注解 元注解 二.对象克隆 什么是对象克隆? 为什么用到对象克隆 三.浅克隆深克隆 一.Java注解 什么是注解&#xff1f; java中注解(Annotation)又称java标注&#xff0c;是一种特殊的注释。 可以添加在包&#xff0c;类&…...

zookeeper的介绍和简单使用

1 zookerper介绍 zookeeper是一个开源的分布式协调服务&#xff0c;由Apache软件基金会提供&#xff0c;主要用于解决分布式应用中的数据管理、状态同步和集群协调等问题。通过提供一个高性能、高可用的协调服务&#xff0c;帮助构建可靠的分布式系统。 Zookeeper的特点和功能…...

【学习笔记】深度学习网络-深度前馈网络(MLP)

作者选择了由 Ian Goodfellow、Yoshua Bengio 和 Aaron Courville 三位大佬撰写的《Deep Learning》(人工智能领域的经典教程&#xff0c;深度学习领域研究生必读教材),开始深度学习领域学习&#xff0c;深入全面的理解深度学习的理论知识。 在之前的文章中介绍了深度学习中用…...

使用Java技术开发软件详细流程

1. 需求分析 与客户沟通&#xff1a;与客户或项目负责人交流&#xff0c;了解需要开发的软件目标、功能需求、性能要求、使用场景等。例如&#xff0c;如果要开发一个在线购物系统&#xff0c;需要明确用户是否可以浏览商品、添加到购物车、下单支付等功能。收集和整理需求&am…...

Kubectl 与 Helm 详解

在 Kubernetes 生态中,kubectl 和 Helm 是两个核心工具,分别用于直接管理 Kubernetes 资源和简化应用的部署与管理。本文将深入探讨 kubectl 和 Helm 的功能、使用场景、部署与更新方式,并对比它们的优缺点。 1. Kubectl 详解 1.1 什么是 Kubectl? kubectl 是 Kubernetes…...

uni-app 程序打包 Android apk、安卓夜神模拟器调试运行

1、打包思路 云端打包方案&#xff08;每天免费次数限制5&#xff0c;最简单&#xff0c;可以先打包尝试一下你的程序打包后是否能用&#xff09;&#xff1a; HBuilderX 发行App-Android云打包 选择Android、使用云端证书、快速安心打包本地打包&#xff1a; HBuilderX …...

全面评测 DOCA 开发环境下的 DPU:性能表现、机器学习与金融高频交易下的计算能力分析

本文介绍了我在 DOCA 开发环境下对 DPU 进行测评和计算能力测试的一些真实体验和记录。在测评过程中&#xff0c;我主要关注了 DPU 在高并发数据传输和深度学习场景下的表现&#xff0c;以及基本的系统性能指标&#xff0c;包括 CPU 计算、内存带宽、多线程/多进程能力和 I/O 性…...

AI学习(vscode+deepseek+cline)

1、网页生成不成功时&#xff0c;直接根据提示让模型替你解决问题 2、http://localhost:3000 拒绝链接时&#xff0c;cmd输入命令InetMgr&#xff0c;网站右键新建-配置你的网页代码物理地址&#xff0c;这里我还输入本机登录名及密码了&#xff0c;并把端口地址由默认80修改为…...

速通 AI+Web3 开发技能: 免费课程+前沿洞察

AI 正以前所未有的速度重塑各行各业&#xff0c;从生成式模型到大规模数据处理&#xff0c;AI 逐渐成为核心驱动力。与此同时&#xff0c;Web3 去中心化技术也在重新定义信任、交易和协作方式。当这两大前沿技术相遇&#xff0c;AI Web3 的融合已不再是理论&#xff0c;而是未…...

使用LPT wiggler jtag自制三星单片机(sam88 core)编程器-S3F9454

写在前面 新年好&#xff0c;各位&#xff0c;今天来分享制作一个三星单片机的编程器 嘿嘿&#xff0c;x鱼垃圾佬元件库有些三星单片机s3f9454&#xff0c;编程器不想买&#xff0c;基本拿来拆件玩的。但&#xff0c;前些时候csdn下载到它的编程时序&#xff0c;自己来做个编程…...

【Unity3D】《跳舞的线》游戏的方块单方向拉伸实现案例

通过网盘分享的文件&#xff1a;CubeMoveMusic.unitypackage 链接: https://pan.baidu.com/s/1Rq-HH4H9qzVNtpQ84WXyUA?pwda7xn 提取码: a7xn 运行游戏点击空格动态创建拉伸的方块&#xff0c;由Speed控制速度&#xff0c;新方向是随机上下左右生成。 using System.Collect…...

Chameleon(变色龙) 跨平台编译C文件,并一次性生成多个平台的可执行文件

地址:https://github.com/MartinxMax/Chameleon Chameleon 跨平台编译C文件&#xff0c;并一次性生成多个平台的可执行文件。可以通过编译Chameleon自带的.C文件反向Shell生成不同平台攻击载荷。 登录 & 代理设置 按照以下步骤设置 Docker 的代理&#xff1a; 创建配置目…...

解读2025年生物医药创新技术:展览会与论坛的重要性

2025生物医药创新技术与应用发展展览会暨论坛&#xff0c;由天津市生物医药行业协会、BIO CHINA生物发酵展组委会携手主办&#xff0c;山东信世会展服务有限公司承办&#xff0c;定于2025年3月3日至5日在济南黄河国际会展中心盛大开幕。展会规模60000平方米、800参展商、35场会…...

WPF基础 | WPF 布局系统深度剖析:从 Grid 到 StackPanel

WPF基础 | WPF 布局系统深度剖析&#xff1a;从 Grid 到 StackPanel 一、前言二、Grid 布局&#xff1a;万能的布局王者2.1 Grid 布局基础&#xff1a;构建网格世界2.2 子元素定位与跨行列&#xff1a;布局的精细操控2.3 自适应布局&#xff1a;灵活应变的秘诀 三、StackPanel…...

Python从0到100(八十五):神经网络与迁移学习在猫狗分类中的应用

在人工智能的浩瀚宇宙中&#xff0c;深度学习犹如一颗璀璨的星辰&#xff0c;引领着机器学习和计算机视觉领域的前沿探索。而神经网络&#xff0c;作为深度学习的核心架构&#xff0c;更是以其强大的数据建模能力&#xff0c;成为解决复杂问题的重要工具。今天&#xff0c;我们…...

git常用命令学习

目录 文章目录 目录第一章 git简介1.Git 与SVN2.Git 工作区、暂存区和版本库 第二章 git常用命令学习1.ssh设置2.设置用户信息3.常用命令设置1.初始化本地仓库init2.克隆clone3.查看状态 git status4.添加add命令5.添加评论6.分支操作1.创建分支2.查看分支3.切换分支4.删除分支…...

vue中使用jquery 实现table 拖动改变尺寸

使用 CDN , 降低打包文件的大小在index.html中 <script src"https://.../cdns/jquery-1.12.4.min.js"></script>在 Vue 中使用 jQuery 一旦你引入 jQuery&#xff0c;你可以在 Vue 实例中使用它。有两种主要方式&#xff1a; 1. 使用全局变量 $ jQue…...

Linux的基本指令(上)

1.ls指令 语法&#xff1a;ls [选项] [目录或文件] 功能&#xff1a;对于⽬录&#xff0c;该命令列出该⽬录下的所有⼦⽬录与⽂件。对于⽂件&#xff0c;将列出⽂件名以及其他信息。 常用选项&#xff1a; -a 列出⽬录下的所有⽂件&#xff0c;包括以 . 开头的隐含⽂件。 -d 将…...