【概述】
1. 我们尝试做tpcc基准测试, 使用tiup bench tpcc run会遇到功能问题,有ERR:
[tpcc@gausssingapore2-0002 1000w]$ tiup bench tpcc run --max-procs 20 --warehouses 100 -T 20 --time 60s
Starting component `bench`: /home/tpcc/.tiup/components/bench/v1.5.1/tiup-bench tpcc run --max-procs 20 --warehouses 100 -T 20 --time 60s
[Current] DELIVERY - Takes(s): 9.8, Count: 180, TPM: 1098.8, Sum(ms): 20518.5, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
Finished
...
...
...
[Summary] DELIVERY - Takes(s): 59.8, Count: 1196, TPM: 1199.4, Sum(ms): 138749.6, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
[Summary] DELIVERY_ERR - Takes(s): 59.8, Count: 2, TPM: 2.0, Sum(ms): 209.9, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
[Summary] NEW_ORDER - Takes(s): 59.9, Count: 14268, TPM: 14283.7, Sum(ms): 577210.7, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
[Summary] NEW_ORDER_ERR - Takes(s): 59.9, Count: 10, TPM: 10.0, Sum(ms): 162.6, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
[Summary] ORDER_STATUS - Takes(s): 60.0, Count: 1242, TPM: 1242.6, Sum(ms): 8465.1, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
[Summary] PAYMENT - Takes(s): 60.0, Count: 13423, TPM: 13434.2, Sum(ms): 456029.9, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
[Summary] PAYMENT_ERR - Takes(s): 60.0, Count: 5, TPM: 5.0, Sum(ms): 51.2, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
[Summary] STOCK_LEVEL - Takes(s): 59.9, Count: 1273, TPM: 1274.5, Sum(ms): 16309.9, Avg(ms): 0.3, 50th(ms): 0.5, 90th(ms): 0.5, 95th(ms): 0.5, 99th(ms): 0.5, 99.9th(ms): 0.5, Max(ms): 0.5
tpmC: 14283.7, efficiency: 1110.7%
2. 另一方面,尝试加上-H 和 -P 命令参数想远程对已做prepare的db进程运行,结果直接失败:
[tpcc@gausssingapore2-0002 ~]$ tiup bench tpcc run --max-procs 10 --warehouses 100 -T 10 --time 60s -H 192.168.0.60 -P 4000
Starting component `bench`: /home/tpcc/.tiup/components/bench/v1.5.1/tiup-bench tpcc run --max-procs 10 --warehouses 100 -T 10 --time 60s -H 192.168.0.60 -P 4000
panic: failed to connect to database when loading data
goroutine 1 [running]:
github.com/pingcap/go-tpc/tpcc.NewWorkloader(0x0, 0x558ac07d36c0, 0x14, 0xc0005300b0, 0xc000159cf8, 0x558abee75f6a)
github.com/pingcap/go-tpc@v1.0.7/tpcc/workload.go:94 +0x809
main.executeTpcc(0x558abf650fbb, 0x3)
github.com/tiup/components/bench/tpcc.go:46 +0x2d7
main.registerTpcc.func2(0xc000365900, 0xc000396900, 0x0, 0xc)
github.com/tiup/components/bench/tpcc.go:87 +0x38
github.com/spf13/cobra.(*Command).execute(0xc000365900, 0xc000396840, 0xc, 0xc, 0xc000365900, 0xc000396840)
github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xc000697900, 0x558ac004c368, 0xc000356c60, 0xc00039f750)
github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.1.3/command.go:897
main.main()
github.com/tiup/components/bench/main.go:139 +0x8d4
Error: run `/home/tpcc/.tiup/components/bench/v1.5.1/tiup-bench` (wd:/home/tpcc/.tiup/data/10) failed: exit status 2