#!/bin/bash
thread_num=(50 250 500 1000 1500 2000)
lua_name=(oltp_read_write oltp_read_only oltp_point_select oltp_update_index oltp_update_non_index oltp_insert oltp_delete)
length=${#lua_name[@]}
for arg in `seq 1 $length`
do
for num in ${thread_num[*]};
do
cur_dateTime="`date +%Y-%m-%d,%H:%m:%s`"
echo "=================================" >> test_oltp.log
echo "thread_num:"$num >> test_oltp.log
echo "start_time:"$cur_dateTime >> test_oltp.log
echo "test_scene:"${lua_name[$arg]} >> test_oltp.log
sysbench --pgsql-host=xxxx --pgsql-port=xxxx --pgsql-user=root --pgsql-db=jingjing --db-driver=pgsql --test=/paic/app/base/sysbench/share/sysbench/${lua_name[$arg]}.lua --tables=10 --table-size=1000000 --threads=$num run >> ${lua_name[$arg]}_$num.out
end_datetime="`date +%Y-%m-%d,%H:%m:%s`"
echo "end_time:"$end_datetime >> test_oltp.log
echo "=================================" >> test_oltp.log
done;
done;
sysbench --pgsql-host=xxx --pgsql-port=xxx --pgsql-user=root --pgsql-db=jingjing --db-driver=pgsql --test=/paic/app/base/sysbench/share/sysbench/${lua_name[$arg]}.lua --tables=10 --table-size=1000000 --threads=$num run >> ${lua_name[$arg]}_$num.out
sysbench --pgsql-host=10.11.96.27 /paic/app/base/sysbench/share/sysbench/oltp_read_write.lua--pgsql-port=6627 --pgsql-user=benchopr --pgsql-db=sysbench--pgsql-password=pass1234 --db-driver=pgsql --db-ps-mode=disable--report-interval=60 --tables=32 --threads=2000 --sum_ranges=1000 --distinct_ranges=1000 --range_size=100--table_size=10000000 --simple_ranges=1000 --order_ranges=1000 run