Centos 7参考:https://segmentfault.com/a/1190000044812703
麒麟V10:安装步骤参考MogDB官网(建议安装推荐路径)https://docs.mogdb.io/zh/mogdb/v5.0/ptk-based-installation,sysbench安装参考上面的连接,麒麟x86的dep链接:https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/x86/openGauss-5.0.0-CentOS-64bit-Libpq.tar.gz。然后流程参考上面Centos的步骤。
注意:sysbench连接数据库出现none of the server's SASL authentication mechanisms are supported的情况,参考https://www.modb.pro/db/393744。
需要的MogDB的命令:
-
ALTER USER sysadmin IDENTIFIED BY 'newPassword' REPLACE 'oldPassword'; //修改密码
-
select rolpassword from pg_authid where rolname='userName; //查看用户的加密密码
-
gsql -d userName -p 26000 //进入数据库
-
SHOW password_policy; //查看已配置的加密算法,参考https://docs.mogdb.io/zh/mogdb/v5.0/2-managing-users-and-their-permissions
安装完毕后测试
2个表一千万条记录
sysbench oltp_read_only \
--db-driver=pgsql \
--pgsql-host=127.0.0.1 \
--pgsql-port=26000 \
--pgsql-user=xxxx \
--pgsql-password=xxxx \
--pgsql-db=postgres \
--threads=8 \
--table_size=10000000 \
--tables=2 \
prepare
只读场景测试
sysbench oltp_read_only \
--db-driver=pgsql \
--pgsql-host=127.0.0.1 \
--pgsql-port=26000 \
--pgsql-user=xxxx \
--pgsql-password=xxxx \
--pgsql-db=postgres \
--threads=128 \
--time=30 \
--tables=2 \
--threads=10 \
--table_size=10000000 \
--report-interval=2 \
run

只写场景测试
sysbench oltp_write_only \
--db-driver=pgsql \
--pgsql-host=127.0.0.1 \
--pgsql-port=26000 \
--pgsql-user=xxxx \
--pgsql-password=xxxx \
--pgsql-db=postgres \
--threads=128 \
--time=30 \
--tables=2 \
--threads=10 \
--table_size=100000000 \
--report-interval=2 \
run
混合读写场景测试
sysbench oltp_read_write \
--db-driver=pgsql \
--pgsql-host=127.0.0.1 \
--pgsql-port=26000 \
--pgsql-user=xxxx \
--pgsql-password=xxxx \
--pgsql-db=postgres \
--threads=128 \
--time=30 \
--tables=2 \
--threads=10 \
--table_size=100000000 \
--report-interval=2 \
run
30秒性能测试select_random_ranges
sysbench select_random_ranges --threads=8 --time=30 --report-interval=1 --db-driver=pgsql --pgsql-host=127.0.0.1 --pgsql-port=26000 --pgsql-user=xxxx --pgsql-password=xxxx --pgsql-db=postgres --tables=2 --table-size=100000000 run
网友评论