diff --git a/bench/main.go b/bench/main.go index 34bd859..f5793f9 100644 --- a/bench/main.go +++ b/bench/main.go @@ -34,13 +34,13 @@ func main() { logger.Infof("starting bench server") config.MustLoadConfig("") logger.InitLog(conf.LogLevel) - if busi.BusiConf.Driver != "" { - dtmcli.SetCurrentDBType(busi.BusiConf.Driver) - svr.PrepareBenchDB() - } registry.WaitStoreUp() dtmsvr.PopulateDB(false) if os.Args[1] == "db" { + if busi.BusiConf.Driver == "mysql" { + dtmcli.SetCurrentDBType(busi.BusiConf.Driver) + svr.PrepareBenchDB() + } busi.PopulateDB(false) } else if os.Args[1] == "redis" || os.Args[1] == "boltdb" { diff --git a/bench/test-flash-sales.sh b/bench/test-flash-sales.sh index d47e174..444aeef 100755 --- a/bench/test-flash-sales.sh +++ b/bench/test-flash-sales.sh @@ -6,9 +6,8 @@ export LOG_LEVEL=fatal export STORE_DRIVER=redis export STORE_HOST=localhost export STORE_PORT=6379 -go build ./bench redis & echo 'sleeping 3s for dtm bench to run up.' && sleep 3 curl "http://127.0.0.1:8083/api/busi_bench/benchFlashSalesReset" -ab -n 1000 -c 20 "http://127.0.0.1:8083/api/busi_bench/benchFlashSales" +ab -n 300000 -c 20 "http://127.0.0.1:8083/api/busi_bench/benchFlashSales" pkill bench