tiup bench tpcc 多线程报错并且 -H -P参数运行失败

【概述】

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
1 个赞
  1. 尝试下把大写的 -H 之类的替换为 --host 这类小写,看看报错是否一致
  2. 试试把warehouse 和 并发调小,比如先测试 1 个,看看是否会有报错,多谢。
  1. 改成 --host 依然报错一致:

    [tpcc@gausssingapore2-0002 ~]$ tiup bench tpcc run --max-procs 1 --warehouses 1 -T 1 --time 30s --host “192.168.0.60” --port 4000

    Starting component bench: /home/tpcc/.tiup/components/bench/v1.5.1/tiup-bench tpcc run --max-procs 1 --warehouses 1 -T 1 --time 30s --host 192.168.0.60 --port 4000

    panic: failed to connect to database when loading data

    goroutine 1 [running]:

    github.com/pingcap/go-tpc/tpcc.NewWorkloader(0x0, 0x557494e9c6c0, 0x14, 0xc0001c8000, 0xc000459cf8, 0x55749353ef6a)

    github.com/pingcap/go-tpc@v1.0.7/tpcc/workload.go:94 +0x809

    main.executeTpcc(0x557493d19fbb, 0x3)

    github.com/tiup/components/bench/tpcc.go:46 +0x2d7

    main.registerTpcc.func2(0xc000414c80, 0xc000444c00, 0x0, 0xc)

    github.com/tiup/components/bench/tpcc.go:87 +0x38

    github.com/spf13/cobra.(*Command).execute(0xc000414c80, 0xc000444b40, 0xc, 0xc, 0xc000414c80, 0xc000444b40)

    github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2

    github.com/spf13/cobra.(*Command).ExecuteC(0xc000193680, 0x557494715368, 0xc0001844e0, 0xc0006aa6a0)

    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/1) failed: exit status 2

  2. 单线程本地运行不会报错:

    [tpcc@gausssingapore2-0002 ~]$ tiup bench tpcc run --max-procs 1 --warehouses 1 -T 1 --time 30s

    Starting component bench: /home/tpcc/.tiup/components/bench/v1.5.1/tiup-bench tpcc run --max-procs 1 --warehouses 1 -T 1 --time 30s



    Finished

    [Summary] DELIVERY - Takes(s): 29.2, Count: 50, TPM: 102.7, Sum(ms): 3626.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] NEW_ORDER - Takes(s): 29.9, Count: 623, TPM: 1249.1, Sum(ms): 14320.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] ORDER_STATUS - Takes(s): 29.2, Count: 58, TPM: 119.4, Sum(ms): 349.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): 30.0, Count: 570, TPM: 1141.4, Sum(ms): 10983.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] PAYMENT_ERR - Takes(s): 30.0, Count: 1, TPM: 2.0, Sum(ms): 8.3, 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): 29.9, Count: 64, TPM: 128.2, Sum(ms): 606.3, 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: 1249.1, efficiency: 9712.8%

试下别 benchmark 测试,直接 mysql 客户端连接能成功吗? 再随便执行下sql查询

我们只想用tpcc基准测试… 能连客户端并且做sql查询

[tpcc@gausssingapore2-0002 ~]$ tiup client

Starting component `client`: /home/tpcc/.tiup/components/client/v1.5.1/tiup-client

Connected with driver mysql (5.7.25-TiDB-v5.2.0-alpha-88-ged52601e6)

Type "help" for help.

my:root@127.0.0.1:4000=> use test;

USE

my:root@127.0.0.1:4000=> show tables

my:root@127.0.0.1:4000-> ;

 Tables_in_test 

----------------

 customer 

 district 

 history 

 item 

 new_order 

 order_line 

 orders 

 stock 

 warehouse 

(9 rows)

my:root@127.0.0.1:4000=> select count(*) from warehouse;

 count(*) 

----------

5 

(1 row)

my:root@127.0.0.1:4000=> select * from new_order limit 5;
 no_o_id | no_d_id | no_w_id 
---------+---------+---------
    2164 |       1 |       1 
    2165 |       1 |       1 
    2166 |       1 |       1 
    2167 |       1 |       1 
    2168 |       1 |       1 
(5 rows)

我们正在尝试按照另一个官方帖子做tpcc测试(我们的是tidb5.0不过应该不要紧吧):https://docs.pingcap.com/zh/tidb/v4.0/benchmark-tidb-using-tpcc#如何对-tidb-进行-tpc-c-测试

不过这里安装依赖卡住了(OS版本是CentOS7.3):

ant-1.9.4-2.el7.noarch.rpm     FAILED                                          
https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/ant-1.9.4-2.el7.noarch.rpm: [Errno 12] Timeout on https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/ant-1.9.4-2.el7.noarch.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
xerces-j2-2.11.0-17.el7_0.noar FAILED                                          
https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: [Errno 12] Timeout on https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
ant-1.9.4-2.el7.noarch.rpm     FAILED                                                                                       ] 2.1 kB/s | 352 kB  00:22:21 ETA 
https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/ant-1.9.4-2.el7.noarch.rpm: [Errno 14] curl#18 - "transfer closed with 1693443 bytes remaining to read"
Trying other mirror.
xerces-j2-2.11.0-17.el7_0.noar FAILED                                          
https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: [Errno 12] Timeout on https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
xerces-j2-2.11.0-17.el7_0.noar FAILED                                          
https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: [Errno 12] Timeout on https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
xerces-j2-2.11.0-17.el7_0.noar FAILED                                          
https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: [Errno 12] Timeout on https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
xerces-j2-2.11.0-17.el7_0.noar FAILED                                          
https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: [Errno 12] Timeout on https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
xerces-j2-2.11.0-17.el7_0.noar FAILED                                          
https://repo.huaweicloud.com/centos/7/os/x86_64/Packages/xerces-j2-2.11.0-17.el7_0.noarch.rpm: [Errno 14] curl#18 - "transfer closed with 612999 bytes remaining to read"
Trying other mirror.


Error downloading packages:
  xerces-j2-2.11.0-17.el7_0.noarch: [Errno 256] No more mirrors to try.
  ant-1.9.4-2.el7.noarch: [Errno 256] No more mirrors to try.

手动下载即可。

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。