- 下载安装 tiup : curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
- 环境变量声明: source ~/.profile
- 运行单机版tidb:tiup playground
- Sysbench下载:https://github.com/akopytov/sysbench/releases/tag/1.0.14
- 配置文件:
mysql-host=127.0.0.1
mysql-port=4000
mysql-user=root
mysql-password=
mysql-db=sbtest
time=600
#{8, 16, 32, 64, 128, 256}
threads= 8
report-interval=10
db-driver=mysql
5. install&make sysbench
- 方法1:直接安装on mac:
brew install sysbench
方法2:下载并编译:onmac 2 failed:
``` shell
./autogen.sh
# Add --with-pgsql to build with PostgreSQL support
./configure
make -j
make install
6. 测试:
cd src
./sysbench --config-file=../config/sbtest.conf oltp_point_select --tables=1 --table-size=100000 prepare
./sysbench --config-file=../config/sbtest.conf oltp_point_select --tables=1 --table-size=100000 run
[ 10s ] thds: 8 tps: 15620.58 qps: 15620.58 (r/w/o: 15620.58/0.00/0.00) lat (ms,95%): 0.73 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 8 tps: 16198.56 qps: 16198.56 (r/w/o: 16198.56/0.00/0.00) lat (ms,95%): 0.67 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 8 tps: 11561.28 qps: 11561.28 (r/w/o: 11561.28/0.00/0.00) lat (ms,95%): 1.32 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 8 tps: 8949.16 qps: 8949.16 (r/w/o: 8949.16/0.00/0.00) lat (ms,95%): 1.79 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 8 tps: 7298.05 qps: 7298.05 (r/w/o: 7298.05/0.00/0.00) lat (ms,95%): 2.48 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 8 tps: 9586.48 qps: 9586.48 (r/w/o: 9586.48/0.00/0.00) lat (ms,95%): 1.61 err/s: 0.00 reconn/s: 0.00
[ 70s ] thds: 8 tps: 8549.69 qps: 8549.79 (r/w/o: 8549.79/0.00/0.00) lat (ms,95%): 1.96 err/s: 0.00 reconn/s: 0.00
[ 80s ] thds: 8 tps: 8473.01 qps: 8472.91 (r/w/o: 8472.91/0.00/0.00) lat (ms,95%): 1.79 err/s: 0.00 reconn/s: 0.00
[ 90s ] thds: 8 tps: 11032.92 qps: 11032.92 (r/w/o: 11032.92/0.00/0.00) lat (ms,95%): 1.47 err/s: 0.00 reconn/s: 0.00
[ 100s ] thds: 8 tps: 10381.83 qps: 10381.83 (r/w/o: 10381.83/0.00/0.00) lat (ms,95%): 1.50 err/s: 0.00 reconn/s: 0.00
[ 110s ] thds: 8 tps: 8461.31 qps: 8461.31 (r/w/o: 8461.31/0.00/0.00) lat (ms,95%): 1.64 err/s: 0.00 reconn/s: 0.00
[ 120s ] thds: 8 tps: 10324.90 qps: 10324.90 (r/w/o: 10324.90/0.00/0.00) lat (ms,95%): 1.67 err/s: 0.00 reconn/s: 0.00
[ 130s ] thds: 8 tps: 12018.93 qps: 12018.93 (r/w/o: 12018.93/0.00/0.00) lat (ms,95%): 1.32 err/s: 0.00 reconn/s: 0.00
[ 140s ] thds: 8 tps: 14871.79 qps: 14871.79 (r/w/o: 14871.79/0.00/0.00) lat (ms,95%): 0.73 err/s: 0.00 reconn/s: 0.00
[ 150s ] thds: 8 tps: 11398.92 qps: 11398.92 (r/w/o: 11398.92/0.00/0.00) lat (ms,95%): 1.55 err/s: 0.00 reconn/s: 0.00
[ 160s ] thds: 8 tps: 11694.87 qps: 11694.87 (r/w/o: 11694.87/0.00/0.00) lat (ms,95%): 1.39 err/s: 0.00 reconn/s: 0.00
7. QA:
错误0:mysql安装失败:
升级brew或者使用pip install mysqlclient;
错误1:编译失败automake 1.10.x (aclocal) wasn't found, exiting
解决方法:brew install automake
错误2:configure.ac:314: the top level
configure:15527: error: pkg-config has to be installed to build sysbench
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
Can't execute autoconf
解决方法::brew install pkg-config
错误3:LUAJIT链接失败
.\configure&make :clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64:
"__Unwind_DeleteException", referenced from:
_lj_err_unwind_dwarf in libluajit.a(lj_err.o)
"__Unwind_GetCFA", referenced from:
_lj_err_unwind_dwarf in libluajit.a(lj_err.o)
"__Unwind_RaiseException", referenced from:
_lj_err_throw in libluajit.a(lj_err.o)
"__Unwind_SetGR", referenced from:
_lj_err_unwind_dwarf in libluajit.a(lj_err.o)
"__Unwind_SetIP", referenced from:
_lj_err_unwind_dwarf in libluajit.a(lj_err.o)
ld: symbol(s) not found for architecture x86_64
解决方法:
check the version of mac: sw_vers
ProductName: macOS
ProductVersion: 12.2.1
BuildVersion: 21D62
export MACOSX_DEPLOYMENT_TARGET=12.2.1