mysql ,tidb sysbench 測試結果記錄

e71hao發表於2022-11-10


機器:dell R730  , 磁碟是SEAGATE  12 Gbps SAS 15000轉 900G 8塊盤組成raid10 ,回寫,預讀設定。

一、 準備指令碼

create user test1@'%' identified WITH mysql_native_password  by '123456';

grant all  on  *.* to test1@'%' ;

create user test1@'localhost' identified WITH mysql_native_password  by '123456';

grant all  on  *.* to test1@'localhost' ;


create database  test1;

二、準備資料

sysbench /usr/share/sysbench/oltp_read_write.lua --db-driver=mysql --mysql-host=localhost --mysql-socket=/data/mp_mysql/p3400.sock   --mysql-port=3400  --mysql-db=test1 --mysql-user=test1 --mysql-password=123456 --table_size=10000000 --tables=10 --threads=300  --time=240 --report-interval=30 prepare

開始壓測

sysbench /usr/share/sysbench/oltp_read_write.lua --db-driver=mysql --mysql-host=localhost --mysql-socket=/data/mp_mysql/p3400.sock   --mysql-port=3400  --mysql-db=test1 --mysql-user=test1 --mysql-password=123456 --table_size=10000000 --tables=10 --threads=50  --time=240 --report-interval=30 run

[mysql@pro-pnh-310-db-tidb-mp-45 ~]$ sysbench /usr/share/sysbench/oltp_read_write.lua --db-driver=mysql --mysql-host=localhost --mysql-socket=/data/mp_mysql/p3400.sock   --mysql-port=3400  --mysql-db=test1 --mysql-user=test1 --mysql-password=123456 --table_size=10000000 --tables=10 --threads=50  --time=240 --report-interval=30 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 50
Report intermediate results every 30 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
[ 30s ] thds: 50 tps: 2311.68 qps: 46258.63 (r/w/o: 32386.82/9246.78/4625.02) lat (ms,95%): 26.68 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 50 tps: 1846.25 qps: 36924.91 (r/w/o: 25847.48/7384.93/3692.50) lat (ms,95%): 21.89 err/s: 0.00 reconn/s: 0.00
[ 90s ] thds: 50 tps: 2016.64 qps: 40332.82 (r/w/o: 28232.97/8066.56/4033.28) lat (ms,95%): 20.00 err/s: 0.00 reconn/s: 0.00
[ 120s ] thds: 50 tps: 2047.49 qps: 40954.04 (r/w/o: 28664.39/8194.67/4094.97) lat (ms,95%): 18.61 err/s: 0.00 reconn/s: 0.00
[ 150s ] thds: 50 tps: 2162.39 qps: 43243.99 (r/w/o: 30272.06/8647.14/4324.79) lat (ms,95%): 15.83 err/s: 0.00 reconn/s: 0.00
[ 180s ] thds: 50 tps: 2056.42 qps: 41128.26 (r/w/o: 28791.77/8223.65/4112.84) lat (ms,95%): 16.71 err/s: 0.00 reconn/s: 0.00
[ 210s ] thds: 50 tps: 2149.38 qps: 42987.44 (r/w/o: 30091.30/8597.38/4298.76) lat (ms,95%): 17.95 err/s: 0.00 reconn/s: 0.00
[ 240s ] thds: 50 tps: 2128.01 qps: 42560.36 (r/w/o: 29792.11/8512.23/4256.02) lat (ms,95%): 17.95 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            7019516
        write:                           2005576
        other:                           1002788
        total:                           10027880
    transactions:                        501394 (2088.21 per sec.)
    queries:                             10027880 (41764.22 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)
General statistics:
    total time:                          240.1032s
    total number of events:              501394
Latency (ms):
         min:                                    2.06
         avg:                                   23.94
         max:                                 2202.36
         95th percentile:                       18.95
         sum:                             12002836.79
Threads fairness:
    events (avg/stddev):           10027.8800/68.48
    execution time (avg/stddev):   240.0567/0.01
    
當時的iostat 
11/10/2022 04:30:17 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          17.10    0.00    4.32    4.50    0.00   74.08
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               4.20     2.20   14.40 8095.40   431.20 195452.40    48.31     4.51    0.57  123.19    0.35   0.12  97.80
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
11/10/2022 04:30:22 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          16.30    0.00    4.22    2.85    0.00   76.63
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               1.40     0.00    0.00 8577.00     0.00 202167.70    47.14     2.92    0.33    0.00    0.33   0.11  91.28



只讀測試

top - 16:41:44 up 9 days, 21:54,  5 users,  load average: 47.28, 17.59, 7.46
Tasks: 412 total,   1 running, 411 sleeping,   0 stopped,   0 zombie
%Cpu(s): 85.2 us, 14.8 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 19779680+total,   637728 free, 10403054+used, 93128536 buff/cache
KiB Swap: 16773116 total, 16423476 free,   349640 used. 92839872 avail Mem 
   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                                                                                                                                                            
150801 mysql     20   0  104.7g  97.5g  15344 S  3400 51.7   1850:26 /opt/mysql8/bin/mysqld --defaults-file=/etc/mp_mysql_3400.cnf --basedir=/opt/mysql8 --datadir=/data/mp_mysql --plugin-dir=/opt/mysql8/lib/plugin --log-error=/log/mp_mysql/alert_mp_mysql.log --open-files-limit=65535 --pid-file=pro-pnh-310-db-t+
 26151 mysql     20   0 3466268  42068   3716 S 592.1  0.0   9:59.88 sysbench /usr/share/sysbench/oltp_read_only.lua --db-driver=mysql --mysql-host=localhost --mysql-socket=/data/mp_mysql/p3400.sock --mysql-port=3400 --mysql-db=test1 --mysql-user=test1 --mysql-password=123456 --table_size=10000000 --tables=10 +
 26252 root      20   0  162384   2644   1572 R   0.3  0.0   0:00.16 top    
 
 
mysql> show processlist;
+-------+-----------------+-----------+-------+---------+-------+----------------------------+--------------------------------------------------------------------------------+
| Id    | User            | Host      | db    | Command | Time  | State                      | Info                                                                           |
+-------+-----------------+-----------+-------+---------+-------+----------------------------+--------------------------------------------------------------------------------+
|     5 | event_scheduler | localhost | NULL  | Daemon  | 23740 | Waiting on empty queue     | NULL                                                                           |
| 68264 | root            | localhost | NULL  | Query   |     0 | init                       | show processlist                                                               |
| 68301 | test1           | localhost | test1 | Execute |     0 | optimizing                 | SELECT c FROM sbtest2 WHERE id=4998480                                         |
| 68302 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest5 WHERE id=4042458                                         |
| 68303 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest10 WHERE id BETWEEN 5012834 AND 5012933 ORDER BY c         |
| 68304 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest9 WHERE id=5046220                                         |
| 68305 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT SUM(k) FROM sbtest6 WHERE id BETWEEN 5035761 AND 5035860                |
| 68306 | test1           | localhost | test1 | Sleep   |     0 | starting                   | NULL                                                                           |
| 68307 | test1           | localhost | test1 | Execute |     0 | Opening tables             | SELECT c FROM sbtest4 WHERE id=5320318                                         |
| 68308 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest7 WHERE id BETWEEN 5016096 AND 5016195 ORDER BY c          |
| 68309 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT SUM(k) FROM sbtest4 WHERE id BETWEEN 5049020 AND 5049119                |
| 68310 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT SUM(k) FROM sbtest4 WHERE id BETWEEN 5698470 AND 5698569                |
| 68311 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest8 WHERE id=5016095                                         |
| 68312 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest7 WHERE id=5013845                                         |
| 68313 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT c FROM sbtest1 WHERE id BETWEEN 4993253 AND 4993352                     |
| 68314 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest3 WHERE id BETWEEN 5019684 AND 5019783 ORDER BY c          |
| 68315 | test1           | localhost | test1 | Execute |     0 | init                       | SELECT c FROM sbtest1 WHERE id=4979576                                         |
| 68316 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT SUM(k) FROM sbtest6 WHERE id BETWEEN 5006278 AND 5006377                |
| 68317 | test1           | localhost | test1 | Execute |     0 | starting                   | NULL                                                                           |
| 68318 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest1 WHERE id=5039496                                         |
| 68319 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT c FROM sbtest1 WHERE id BETWEEN 5041205 AND 5041304 ORDER BY c          |
| 68320 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest10 WHERE id BETWEEN 6307358 AND 6307457 ORDER BY c         |
| 68321 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT c FROM sbtest7 WHERE id=5047091                                         |
| 68322 | test1           | localhost | test1 | Execute |     0 | closing tables             | SELECT c FROM sbtest6 WHERE id=4992048                                         |
| 68323 | test1           | localhost | test1 | Execute |     0 | Opening tables             | SELECT c FROM sbtest6 WHERE id=4252199                                         |
| 68324 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT SUM(k) FROM sbtest5 WHERE id BETWEEN 5007973 AND 5008072                |
| 68325 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT DISTINCT c FROM sbtest3 WHERE id BETWEEN 5419276 AND 5419375 ORDER BY c |
| 68326 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT DISTINCT c FROM sbtest1 WHERE id BETWEEN 5046962 AND 5047061 ORDER BY c |
| 68327 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT SUM(k) FROM sbtest6 WHERE id BETWEEN 4994565 AND 4994664                |
| 68328 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest10 WHERE id BETWEEN 5008260 AND 5008359                    |
| 68329 | test1           | localhost | test1 | Execute |     0 | closing tables             | SELECT c FROM sbtest10 WHERE id=4997951                                        |
| 68330 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest2 WHERE id BETWEEN 4918108 AND 4918207 ORDER BY c          |
| 68331 | test1           | localhost | test1 | Execute |     0 | System lock                | SELECT c FROM sbtest2 WHERE id=5048095                                         |   
11/10/2022 04:40:50 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          85.36    0.00   14.59    0.00    0.00    0.05
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.20    0.00  290.00     0.00  5817.60    40.12     0.02    0.06    0.00    0.06   0.04   1.20
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
11/10/2022 04:40:55 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          85.32    0.00   14.67    0.00    0.00    0.01
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.00    0.00  279.00     0.00  5675.70    40.69     0.02    0.07    0.00    0.07   0.04   1.18
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
[mysql@pro-pnh-310-db-tidb-mp-45 ~]$ sysbench /usr/share/sysbench/oltp_read_only.lua --db-driver=mysql --mysql-host=localhost --mysql-socket=/data/mp_mysql/p3400.sock   --mysql-port=3400  --mysql-db=test1 --mysql-user=test1 --mysql-password=123456 --table_size=10000000 --tables=10 --threads=50  --time=240 --report-interval=30 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 50
Report intermediate results every 30 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
[ 30s ] thds: 50 tps: 16823.29 qps: 269188.34 (r/w/o: 235540.13/0.00/33648.20) lat (ms,95%): 4.82 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 50 tps: 16933.25 qps: 270932.24 (r/w/o: 237065.75/0.00/33866.49) lat (ms,95%): 4.82 err/s: 0.00 reconn/s: 0.00
[ 90s ] thds: 50 tps: 16954.25 qps: 271268.81 (r/w/o: 237360.28/0.00/33908.54) lat (ms,95%): 4.82 err/s: 0.00 reconn/s: 0.00
[ 120s ] thds: 50 tps: 16976.17 qps: 271618.06 (r/w/o: 237665.79/0.00/33952.27) lat (ms,95%): 4.82 err/s: 0.00 reconn/s: 0.00
[ 150s ] thds: 50 tps: 16985.38 qps: 271765.98 (r/w/o: 237795.19/0.00/33970.79) lat (ms,95%): 4.82 err/s: 0.00 reconn/s: 0.00
[ 180s ] thds: 50 tps: 17010.77 qps: 272173.97 (r/w/o: 238152.45/0.00/34021.51) lat (ms,95%): 4.74 err/s: 0.00 reconn/s: 0.00
[ 210s ] thds: 50 tps: 17050.44 qps: 272806.39 (r/w/o: 238705.54/0.00/34100.85) lat (ms,95%): 4.74 err/s: 0.00 reconn/s: 0.00
[ 240s ] thds: 50 tps: 17055.89 qps: 272894.32 (r/w/o: 238782.56/0.00/34111.76) lat (ms,95%): 4.74 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            57032724
        write:                           0
        other:                           8147532
        total:                           65180256
    transactions:                        4073766 (16973.36 per sec.)
    queries:                             65180256 (271573.78 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)
General statistics:
    total time:                          240.0078s
    total number of events:              4073766
Latency (ms):
         min:                                    1.54
         avg:                                    2.94
         max:                                   54.92
         95th percentile:                        4.82
         sum:                             11991545.57
Threads fairness:
    events (avg/stddev):           81475.3200/2855.49
    execution time (avg/stddev):   239.8309/0.01


只寫測試

mysql> show processlist;
+-------+-----------------+-----------+-------+---------+-------+------------------------+------------------------------------------------------------------------------------------------------+
| Id    | User            | Host      | db    | Command | Time  | State                  | Info                                                                                                 |
+-------+-----------------+-----------+-------+---------+-------+------------------------+------------------------------------------------------------------------------------------------------+
|     5 | event_scheduler | localhost | NULL  | Daemon  | 24208 | Waiting on empty queue | NULL                                                                                                 |
| 68264 | root            | localhost | NULL  | Query   |     0 | init                   | show processlist                                                                                     |
| 68383 | test1           | localhost | test1 | Execute |     1 | update                 | INSERT INTO sbtest5 (id, k, c, pad) VALUES (4982565, 3651385, '99746080174-25674026407-16609090887-4 |
| 68384 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest2 SET k=k+1 WHERE id=4976414                                                            |
| 68385 | test1           | localhost | test1 | Execute |     1 | updating               | DELETE FROM sbtest7 WHERE id=5036739                                                                 |
| 68386 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest4 SET k=k+1 WHERE id=5017602                                                            |
| 68387 | test1           | localhost | test1 | Execute |     1 | update                 | INSERT INTO sbtest3 (id, k, c, pad) VALUES (5018672, 5035576, '03778115547-11859377930-75899849989-9 |
| 68388 | test1           | localhost | test1 | Execute |     1 | update                 | INSERT INTO sbtest5 (id, k, c, pad) VALUES (5011000, 5028113, '75169665249-15647596375-46984198980-3 |
| 68389 | test1           | localhost | test1 | Execute |     1 | update                 | INSERT INTO sbtest6 (id, k, c, pad) VALUES (5006752, 5014895, '15750466653-68049998383-25387699560-9 |
| 68390 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest7 SET k=k+1 WHERE id=4985295                                                            |
| 68391 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest9 SET k=k+1 WHERE id=5038298                                                            |
| 68392 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest7 SET k=k+1 WHERE id=4996521                                                            |
| 68393 | test1           | localhost | test1 | Execute |     1 | update                 | INSERT INTO sbtest1 (id, k, c, pad) VALUES (4196693, 5481851, '89462501076-61603799261-22386332421-2 |
| 68394 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest7 SET k=k+1 WHERE id=5027387                                                            |
| 68395 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest10 SET k=k+1 WHERE id=5525344                                                           |
| 68396 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest7 SET k=k+1 WHERE id=5345669                                                            |
| 68397 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest8 SET k=k+1 WHERE id=6059113                                                            |
| 68398 | test1           | localhost | test1 | Execute |     1 | update                 | INSERT INTO sbtest2 (id, k, c, pad) VALUES (4992024, 5044201, '31635432472-84818016260-68323153166-9 |
| 68399 | test1           | localhost | test1 | Execute |     1 | updating               | DELETE FROM sbtest4 WHERE id=4991726                                                                 |
| 68400 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest6 SET k=k+1 WHERE id=5001552                                                            |
| 68401 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest3 SET k=k+1 WHERE id=5029323                                                            |
| 68402 | test1           | localhost | test1 | Execute |     1 | updating               | DELETE FROM sbtest7 WHERE id=5032073                                                                 |
| 68403 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest10 SET k=k+1 WHERE id=4606198                                                           |
| 68404 | test1           | localhost | test1 | Execute |     1 | updating               | DELETE FROM sbtest10 WHERE id=4979556                                                                |
| 68405 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest1 SET k=k+1 WHERE id=5002795                                                            |
| 68406 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest9 SET k=k+1 WHERE id=5034141                                                            |
| 68407 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest3 SET k=k+1 WHERE id=5001885                                                            |
| 68408 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest4 SET c='52790156691-03310839528-69280160366-87501916637-76980677500-50442224198-273037 |
| 68409 | test1           | localhost | test1 | Execute |     1 | updating               | UPDATE sbtest8 SET k=k+1 WHERE id=5014751                                                            |
| 68410 | test1           | localhost | test1 | Execute |     1 | update                 | INSERT INTO sbtest7 (id, k, c, pad) VALUES (5043843, 5022685, '94850163247-22761473575-96466754491-3 |
11/10/2022 04:49:57 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           7.45    0.00    2.73    3.26    0.00   86.56
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.00    0.00 7924.20     0.00 200348.50    50.57     2.90    0.37    0.00    0.37   0.12  92.46
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
11/10/2022 04:50:02 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           6.80    0.00    2.68    3.78    0.00   86.74
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     1.20    0.00 8425.80     0.00 208034.90    49.38     3.22    0.33    0.00    0.33   0.11  93.52
[mysql@pro-pnh-310-db-tidb-mp-45 ~]$ sysbench /usr/share/sysbench/oltp_write_only.lua --db-driver=mysql --mysql-host=localhost --mysql-socket=/data/mp_mysql/p3400.sock   --mysql-port=3400  --mysql-db=test1 --mysql-user=test1 --mysql-password=123456 --table_size=10000000 --tables=10 --threads=50  --time=240 --report-interval=30 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 50
Report intermediate results every 30 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
[ 30s ] thds: 50 tps: 4153.11 qps: 24920.47 (r/w/o: 0.00/16612.58/8307.89) lat (ms,95%): 9.73 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 50 tps: 2381.69 qps: 14290.19 (r/w/o: 0.00/9526.81/4763.39) lat (ms,95%): 13.46 err/s: 0.00 reconn/s: 0.00
[ 90s ] thds: 50 tps: 2783.73 qps: 16702.42 (r/w/o: 0.00/11134.96/5567.46) lat (ms,95%): 12.98 err/s: 0.00 reconn/s: 0.00
[ 120s ] thds: 50 tps: 2522.77 qps: 15136.40 (r/w/o: 0.00/10090.87/5045.53) lat (ms,95%): 12.75 err/s: 0.00 reconn/s: 0.00
[ 150s ] thds: 50 tps: 2632.94 qps: 15797.65 (r/w/o: 0.00/10531.77/5265.88) lat (ms,95%): 12.52 err/s: 0.00 reconn/s: 0.00
[ 180s ] thds: 50 tps: 2681.39 qps: 16088.37 (r/w/o: 0.00/10725.58/5362.79) lat (ms,95%): 12.52 err/s: 0.00 reconn/s: 0.00
[ 210s ] thds: 50 tps: 2202.07 qps: 13212.44 (r/w/o: 0.00/8808.30/4404.15) lat (ms,95%): 15.55 err/s: 0.00 reconn/s: 0.00
[ 240s ] thds: 50 tps: 2532.94 qps: 15198.63 (r/w/o: 0.00/10132.75/5065.88) lat (ms,95%): 14.21 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            0
        write:                           2627164
        other:                           1313582
        total:                           3940746
    transactions:                        656791 (2734.14 per sec.)
    queries:                             3940746 (16404.83 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)
General statistics:
    total time:                          240.2158s
    total number of events:              656791
Latency (ms):
         min:                                    0.78
         avg:                                   18.28
         max:                                 1956.29
         95th percentile:                       12.75
         sum:                             12008847.76
Threads fairness:
    events (avg/stddev):           13135.8200/41.10
    execution time (avg/stddev):   240.1770/0.01


fileio 測試

[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ sysbench fileio --file-num=10 --file-total-size=50G prepare
sysbench 1.0.17 (using system LuaJIT 2.0.4)
10 files, 5242880Kb each, 51200Mb total
Creating files for the test...
Extra file open flags: (none)
Creating file test_file.0
Creating file test_file.1
Creating file test_file.2
Creating file test_file.3
Creating file test_file.4
Creating file test_file.5
Creating file test_file.6
Creating file test_file.7
Creating file test_file.8
Creating file test_file.9
53687091200 bytes written in 80.77 seconds (633.86 MiB/sec).
[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ ls -lh 
total 50G
-rw-------. 1 mysql mysql 5.0G Nov 10 17:47 test_file.0
-rw-------. 1 mysql mysql 5.0G Nov 10 17:48 test_file.1
-rw-------. 1 mysql mysql 5.0G Nov 10 17:48 test_file.2
-rw-------. 1 mysql mysql 5.0G Nov 10 17:48 test_file.3
-rw-------. 1 mysql mysql 5.0G Nov 10 17:48 test_file.4
-rw-------. 1 mysql mysql 5.0G Nov 10 17:48 test_file.5
-rw-------. 1 mysql mysql 5.0G Nov 10 17:48 test_file.6
-rw-------. 1 mysql mysql 5.0G Nov 10 17:48 test_file.7
-rw-------. 1 mysql mysql 5.0G Nov 10 17:49 test_file.8
-rw-------. 1 mysql mysql 5.0G Nov 10 17:49 test_file.9
[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ sysbench --events=5000  --threads=16 fileio  --file-num=10  --file-total-size=50G --file-test-mode=rndrw  --file-fsync-freq=0  --file-block-size=16384 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 16
Initializing random number generator from current time
Extra file open flags: (none)
10 files, 5GiB each
50GiB total file size
Block size 16KiB
Number of IO requests: 5000
Read/Write ratio for combined random IO test: 1.50
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...
Threads started!
File operations:
    reads/s:                      2548.06
    writes/s:                     1704.37
    fsyncs/s:                     136.08
Throughput:
    read, MiB/s:                  39.81
    written, MiB/s:               26.63
General statistics:
    total time:                          1.1718s
    total number of events:              5000
Latency (ms):
         min:                                    0.00
         avg:                                    3.25
         max:                                   57.93
         95th percentile:                       14.46
         sum:                                16271.66
Threads fairness:
    events (avg/stddev):           312.5000/31.76
    execution time (avg/stddev):   1.0170/0.01
[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ sysbench --events=5000  --threads=16 fileio  --file-num=10  --file-total-size=50G --file-test-mode=seqrd  --file-fsync-freq=0  --file-block-size=16384 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 16
Initializing random number generator from current time
Extra file open flags: (none)
10 files, 5GiB each
50GiB total file size
Block size 16KiB
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing sequential read test
Initializing worker threads...
Threads started!
File operations:
    reads/s:                      23390.70
    writes/s:                     0.00
    fsyncs/s:                     0.00
Throughput:
    read, MiB/s:                  365.48
    written, MiB/s:               0.00
General statistics:
    total time:                          0.2100s
    total number of events:              5000
Latency (ms):
         min:                                    0.00
         avg:                                    0.67
         max:                                   58.30
         95th percentile:                        0.54
         sum:                                 3346.34
Threads fairness:
    events (avg/stddev):           312.5000/450.45
    execution time (avg/stddev):   0.2091/0.00
[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ sysbench --events=5000  --threads=16 fileio  --file-num=10  --file-total-size=50G --file-test-mode=seqwr  --file-fsync-freq=0  --file-block-size=16384 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 16
Initializing random number generator from current time
Extra file open flags: (none)
10 files, 5GiB each
50GiB total file size
Block size 16KiB
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing sequential write (creation) test
Initializing worker threads...
Threads started!
File operations:
    reads/s:                      0.00
    writes/s:                     21575.95
    fsyncs/s:                     690.43
Throughput:
    read, MiB/s:                  0.00
    written, MiB/s:               337.12
General statistics:
    total time:                          0.2297s
    total number of events:              5000
Latency (ms):
         min:                                    0.01
         avg:                                    0.24
         max:                                   67.74
         95th percentile:                        0.25
         sum:                                 1177.22
Threads fairness:
    events (avg/stddev):           312.5000/72.48
    execution time (avg/stddev):   0.0736/0.00
[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ sysbench fileio --file-num=10 --file-total-size=50G prepare
sysbench 1.0.17 (using system LuaJIT 2.0.4)
10 files, 5242880Kb each, 51200Mb total
Creating files for the test...
Extra file open flags: (none)
Extending existing file test_file.0
Creating file test_file.1
Creating file test_file.2
Creating file test_file.3
Creating file test_file.4
Creating file test_file.5
Creating file test_file.6
Creating file test_file.7
Creating file test_file.8
Creating file test_file.9
53605171200 bytes written in 82.49 seconds (619.71 MiB/sec).
[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ sysbench --events=5000  --threads=16 fileio  --file-num=10  --file-total-size=50G --file-test-mode=rndwr  --file-fsync-freq=0  --file-block-size=16384 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 16
Initializing random number generator from current time
Extra file open flags: (none)
10 files, 5GiB each
50GiB total file size
Block size 16KiB
Number of IO requests: 5000
Read/Write ratio for combined random IO test: 1.50
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random write test
Initializing worker threads...
Threads started!
File operations:
    reads/s:                      0.00
    writes/s:                     12672.58
    fsyncs/s:                     405.52
Throughput:
    read, MiB/s:                  0.00
    written, MiB/s:               198.01
General statistics:
    total time:                          0.3906s
    total number of events:              5000
Latency (ms):
         min:                                    0.01
         avg:                                    0.04
         max:                                   17.52
         95th percentile:                        0.08
         sum:                                  199.00
Threads fairness:
    events (avg/stddev):           312.5000/36.64
    execution time (avg/stddev):   0.0124/0.00
[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ sysbench --events=5000  --threads=16 fileio  --file-num=10  --file-total-size=50G --file-test-mode=seqrewr  --file-fsync-freq=0  --file-block-size=16384 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 16
Initializing random number generator from current time
Extra file open flags: (none)
10 files, 5GiB each
50GiB total file size
Block size 16KiB
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing sequential rewrite test
Initializing worker threads...
Threads started!
File operations:
    reads/s:                      0.00
    writes/s:                     18804.84
    fsyncs/s:                     601.75
Throughput:
    read, MiB/s:                  0.00
    written, MiB/s:               293.83
General statistics:
    total time:                          0.2616s
    total number of events:              5000
Latency (ms):
         min:                                    0.01
         avg:                                    0.22
         max:                                   71.06
         95th percentile:                        0.03
         sum:                                 1110.85
Threads fairness:
    events (avg/stddev):           312.5000/784.89
    execution time (avg/stddev):   0.0694/0.00
[mysql@pro-pnh-310-db-tidb-mp-45 aa]$ ll


3000萬資料讀寫測試

mysql> show processlist;
+-------+-----------------+-----------+-------+---------+-------+----------------------------+-------------------------------------------------------------------------+
| Id    | User            | Host      | db    | Command | Time  | State                      | Info                                                                    |
+-------+-----------------+-----------+-------+---------+-------+----------------------------+-------------------------------------------------------------------------+
|     5 | event_scheduler | localhost | NULL  | Daemon  | 28737 | Waiting on empty queue     | NULL                                                                    |
| 68512 | root            | localhost | NULL  | Query   |     0 | init                       | show processlist                                                        |
| 69034 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest1 WHERE id=14990386                                 |
| 69035 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69036 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest6 WHERE id BETWEEN 15007211 AND 15007310            |
| 69037 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest2 WHERE id BETWEEN 15037841 AND 15037940            |
| 69038 | test1           | localhost | test1 | Sleep   |     0 | NULL                       | NULL                                                                    |
| 69039 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69040 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT c FROM sbtest4 WHERE id BETWEEN 15043958 AND 15044057            |
| 69041 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT c FROM sbtest1 WHERE id=8364261                                  |
| 69042 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest1 WHERE id BETWEEN 14989501 AND 14989600            |
| 69043 | test1           | localhost | test1 | Execute |     0 | System lock                | SELECT c FROM sbtest3 WHERE id BETWEEN 17960659 AND 17960758 ORDER BY c |
| 69044 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69045 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest2 WHERE id BETWEEN 14990406 AND 14990505            |
| 69046 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69047 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest9 WHERE id BETWEEN 16590115 AND 16590214 ORDER BY c |
| 69048 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69049 | test1           | localhost | test1 | Sleep   |     0 |                            | NULL                                                                    |
| 69050 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest6 WHERE id BETWEEN 15017964 AND 15018063            |
| 69051 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69052 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69053 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest6 WHERE id BETWEEN 15012206 AND 15012305            |
| 69054 | test1           | localhost | test1 | Sleep   |     0 |                            | NULL                                                                    |
| 69055 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69056 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest4 WHERE id BETWEEN 12995865 AND 12995964            |
| 69057 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest1 WHERE id BETWEEN 14955286 AND 14955385            |
| 69058 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT c FROM sbtest3 WHERE id=15028102                                 |
| 69059 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69060 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69061 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest1 WHERE id=13149515                                 |
| 69062 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest1 WHERE id BETWEEN 15123185 AND 15123284            |
| 69063 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest4 WHERE id BETWEEN 15121283 AND 15121382 ORDER BY c |
| 69064 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest10 WHERE id BETWEEN 14979563 AND 14979662           |
| 69065 | test1           | localhost | test1 | Sleep   |     0 | starting                   | NULL                                                                    |
| 69066 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest5 WHERE id=16460975                                 |
| 69067 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest2 WHERE id BETWEEN 15037307 AND 15037406            |
| 69068 | test1           | localhost | test1 | Execute |     0 | System lock                | SELECT c FROM sbtest5 WHERE id BETWEEN 15039032 AND 15039131            |
| 69069 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69070 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT SUM(k) FROM sbtest1 WHERE id BETWEEN 14966154 AND 14966253       |
| 69071 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69072 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69073 | test1           | localhost | test1 | Execute |     0 | Sending to client          | SELECT c FROM sbtest5 WHERE id=14952376                                 |
| 69074 | test1           | localhost | test1 | Execute |     0 | statistics                 | SELECT SUM(k) FROM sbtest8 WHERE id BETWEEN 15526169 AND 15526268       |
| 69075 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest2 WHERE id BETWEEN 14933141 AND 14933240            |
| 69076 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest7 WHERE id=14988372                                 |
| 69077 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest3 WHERE id BETWEEN 13375593 AND 13375692            |
| 69078 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest6 WHERE id BETWEEN 15039801 AND 15039900            |
| 69079 | test1           | localhost | test1 | Execute |     0 | executing                  | SELECT c FROM sbtest9 WHERE id BETWEEN 14961049 AND 14961148            |
| 69080 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69081 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69082 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | COMMIT                                                                  |
| 69083 | test1           | localhost | test1 | Execute |     0 | waiting for handler commit | SELECT c FROM sbtest6 WHERE id=10799324                                 |
+-------+-----------------+-----------+-------+---------+-------+----------------------------+-------------------------------------------------------------------------+
52 rows in set (0.00 sec)
11/10/2022 06:06:22 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           6.34    0.00    2.28    3.32    0.00   88.06
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               1.40     1.80    0.00 7532.40     0.00 190241.70    50.51     2.91    0.36    0.00    0.36   0.12  92.80
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
11/10/2022 06:06:27 PM
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          10.82    0.00    3.13    5.79    0.00   80.26
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               5.60     3.60    0.80 7985.40    25.60 189144.30    47.37     3.31    0.42 1309.25    0.29   0.12  92.84
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
[mysql@pro-pnh-310-db-tidb-mp-45 ~]$ sysbench /usr/share/sysbench/oltp_read_write.lua --db-driver=mysql --mysql-host=localhost --mysql-socket=/data/mp_mysql/p3400.sock   --mysql-port=3400  --mysql-db=test1 --mysql-user=test1 --mysql-password=123456 --table_size=30000000 --tables=10 --threads=50  --time=240 --report-interval=30 run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 50
Report intermediate results every 30 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
[ 30s ] thds: 50 tps: 1727.07 qps: 34568.59 (r/w/o: 24202.23/6910.57/3455.80) lat (ms,95%): 74.46 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 50 tps: 978.16 qps: 19561.52 (r/w/o: 13694.34/3910.85/1956.33) lat (ms,95%): 176.73 err/s: 0.00 reconn/s: 0.00
[ 90s ] thds: 50 tps: 848.73 qps: 16974.17 (r/w/o: 11880.73/3395.97/1697.46) lat (ms,95%): 314.45 err/s: 0.00 reconn/s: 0.00
[ 120s ] thds: 50 tps: 680.75 qps: 13617.16 (r/w/o: 9531.96/2723.70/1361.50) lat (ms,95%): 520.62 err/s: 0.00 reconn/s: 0.00
[ 150s ] thds: 50 tps: 525.26 qps: 10507.04 (r/w/o: 7352.76/2103.77/1050.52) lat (ms,95%): 623.33 err/s: 0.00 reconn/s: 0.00
[ 180s ] thds: 50 tps: 753.20 qps: 15061.78 (r/w/o: 10544.86/3010.52/1506.39) lat (ms,95%): 530.08 err/s: 0.00 reconn/s: 0.00
[ 210s ] thds: 50 tps: 564.60 qps: 11290.26 (r/w/o: 7905.21/2255.84/1129.21) lat (ms,95%): 634.66 err/s: 0.00 reconn/s: 0.00
[ 240s ] thds: 50 tps: 644.13 qps: 12882.59 (r/w/o: 9017.88/2576.44/1288.27) lat (ms,95%): 623.33 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            2824850
        write:                           807100
        other:                           403550
        total:                           4035500
    transactions:                        201775 (840.21 per sec.)
    queries:                             4035500 (16804.28 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)
General statistics:
    total time:                          240.1431s
    total number of events:              201775
Latency (ms):
         min:                                    2.06
         avg:                                   59.50
         max:                                 3597.48
         95th percentile:                      520.62
         sum:                             12005690.62
Threads fairness:
    events (avg/stddev):           4035.5000/77.83
    execution time (avg/stddev):   240.1138/0.00



四  tidb 壓測

tidb 單機版本安裝

##建立資料夾 

mkdir -p /opt/tidb

mkdir -p /data/tidbdata

groupadd tidb ; useradd -g tidb tidb

curl --proto '=https' --tlsv1.2 -sSf  | sh

source .bash_profile

##安裝 TiUP cluster 元件:

tiup cluster


到目前為止,在tidb使用者下安裝了tiup這個工具,tidb叢集單機部署

[root@pro-pnh-310-db-tidb-mp-45 ~]# cat tom.yaml 
# # Global variables are applied to all deployments and used as the default value of
# # the deployments if a specific deployment value is missing.
global:
 user: "tidb"
 ssh_port: 22
 deploy_dir: "/opt/tidb"
 data_dir: "/data/tidbdata"
# # Monitored variables are applied to all the machines.
monitored:
 node_exporter_port: 9200
 blackbox_exporter_port: 9215
server_configs:
 tidb:
   log.slow-threshold: 300
 tikv:
   readpool.storage.use-unified-pool: false
   readpool.coprocessor.use-unified-pool: true
 pd:
   replication.enable-placement-rules: true
   replication.location-labels: ["host"]
 tiflash:
   logger.level: "info"
pd_servers:
 - host: 10.34.255.45
tidb_servers:
 - host: 10.34.255.45
tikv_servers:
 - host: 10.34.255.45
   port: 20160
   status_port: 20180
   config:
     server.labels: { host: "logic-host-1" }
 - host: 10.34.255.45
   port: 20161
   status_port: 20181
   config:
     server.labels: { host: "logic-host-2" }
 - host: 10.34.255.45
   port: 20162
   status_port: 20182
   config:
     server.labels: { host: "logic-host-3" }
tiflash_servers:
 - host: 10.34.255.45
monitoring_servers:
 - host: 10.34.255.45
grafana_servers:
 - host: 10.34.255.45

部署起來後,開始準備資料:

準備資料的時候iops情況:
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00    11.40    0.00 3378.20     0.00 588738.00   348.55    68.10   20.15    0.00   20.15   0.28  95.20
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          23.47    0.00    3.82    6.53    0.00   66.18
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.00    0.00 3085.80     0.00 546986.40   354.52    64.44   20.74    0.00   20.74   0.31  95.26
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          19.79    0.00    3.86    4.30    0.00   72.05
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.00    0.00 2930.00     0.00 565817.90   386.22    60.64   20.86    0.00   20.86   0.33  97.10
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          18.01    0.00    3.80    5.22    0.00   72.97
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00     0.00    0.00 2691.80     0.00 534561.90   397.18    65.59   24.17    0.00   24.17   0.36  96.64
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
[tidb@pro-pnh-310-db-tidb-mp-45 ~]$ sysbench /usr/share/sysbench/oltp_read_write.lua --db-driver=mysql --mysql-host=10.34.255.45    --mysql-port=4000  --mysql-db=test1 --mysql-user=test1 --mysql-password=123456 --table_size=10000000 --tables=10 --threads=50  --time=240 --report-interval=30 prepare
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Initializing worker threads...
Creating table 'sbtest10'...
Creating table 'sbtest4'...
Creating table 'sbtest8'...
Creating table 'sbtest3'...Creating table 'sbtest6'...
Creating table 'sbtest1'...
Creating table 'sbtest2'...
Creating table 'sbtest9'...
Creating table 'sbtest7'...
Creating table 'sbtest5'...
Inserting 10000000 records into 'sbtest7'
Inserting 10000000 records into 'sbtest2'
Inserting 10000000 records into 'sbtest3'
Inserting 10000000 records into 'sbtest9'
Inserting 10000000 records into 'sbtest4'
Inserting 10000000 records into 'sbtest5'
Inserting 10000000 records into 'sbtest8'
Inserting 10000000 records into 'sbtest10'
Inserting 10000000 records into 'sbtest1'
Inserting 10000000 records into 'sbtest6'
Creating a secondary index on 'sbtest6'...
Creating a secondary index on 'sbtest7'...
Creating a secondary index on 'sbtest1'...
Creating a secondary index on 'sbtest5'...
Creating a secondary index on 'sbtest10'...
Creating a secondary index on 'sbtest2'...
Creating a secondary index on 'sbtest9'...
Creating a secondary index on 'sbtest4'...
Creating a secondary index on 'sbtest3'...
Creating a secondary index on 'sbtest8'...




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30393770/viewspace-2922818/,如需轉載,請註明出處,否則將追究法律責任。

相關文章