Browse Source

bench rerun

pull/55/head
yedf2 4 years ago
parent
commit
fec4957e99
  1. 2
      bench/http.go
  2. 1
      bench/run-dtm.sh
  3. 4
      bench/run-mysql.sh
  4. 3
      bench/setup.sh
  5. 2
      dtmsvr/trans.go

2
bench/http.go

@ -87,7 +87,7 @@ func StartSvr() {
}
func qsAdjustBalance(uid int, amount int, c *gin.Context) (interface{}, error) {
if strings.Contains(mode, "empty") {
if strings.Contains(mode, "empty") || sqls == 0 {
return dtmcli.MapSuccess, nil
}
tb := dtmimp.TransBaseFromQuery(c.Request.URL.Query())

1
bench/run-dtm.sh

@ -4,6 +4,7 @@
set -x
export TIME=10
export CONCURRENT=20
curl "http://127.0.0.1:8083/api/busi_bench/reloadData?m=dtm_tx&sqls=0" && ab -t $TIME -c $CONCURRENT "http://127.0.0.1:8083/api/busi_bench/bench"
curl "http://127.0.0.1:8083/api/busi_bench/reloadData?m=dtm_tx&sqls=5" && ab -t $TIME -c $CONCURRENT "http://127.0.0.1:8083/api/busi_bench/bench"
curl "http://127.0.0.1:8083/api/busi_bench/reloadData?m=dtm_barrier&sqls=5" && ab -t $TIME -c $CONCURRENT "http://127.0.0.1:8083/api/busi_bench/bench"
curl "http://127.0.0.1:8083/api/busi_bench/reloadData?m=raw_tx&sqls=5" && ab -t $TIME -c $CONCURRENT "http://127.0.0.1:8083/api/busi_bench/bench"

4
bench/run-mysql.sh

@ -1,6 +1,8 @@
# !/bin/bash
cd /usr/share/sysbench/
echo 'create database sbtest;' > mysql -h 127.0.0.1 -uroot
sysbench oltp_write_only.lua --time=60 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password= --mysql-db=sbtest --table-size=1000000 --tables=10 --threads=10 --events=999999999 --report-interval=10 prepare
sysbench oltp_write_only.lua --time=60 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password= --mysql-db=sbtest --table-size=1000000 --tables=10 --threads=10 --events=999999999 --report-interval=10 run
sysbench oltp_write_only.lua --time=60 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password= --mysql-db=sbtest --table-size=1000000 --tables=10 --threads=10 --events=999999999 --report-interval=10 run

3
bench/setup.sh

@ -1,6 +1,7 @@
# !/bin/bash
# install all commands needed
apt update
apt install -y git sysbench apache2-utils mysql-client-core-8.0
# install docker and docker-compose
@ -11,4 +12,4 @@ chmod +x /usr/local/bin/docker-compose
# install go
wget https://golang.org/dl/go1.17.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz && cp -f /usr/local/bin/go /usr/local/go/bin/go

2
dtmsvr/trans.go

@ -274,7 +274,7 @@ func (t *TransGlobal) execBranch(db *common.DB, branch *TransBranch) error {
t.touch(db, cronReset)
} else if err == dtmimp.ErrOngoing {
t.touch(db, cronKeep)
} else {
} else if err != nil {
t.touch(db, cronBackoff)
}
return err

Loading…
Cancel
Save