简介云数据库 TiDB 试用体验

网友投稿 412 2024-04-26



1、部署

按照图形化操作,部署完成后,登录控制台。建议可以按照组件筛选,这样可以快速登录具体的组件

简介云数据库 TiDB 试用体验

1、查看集群的名称

2、查看集群的相关组件

建议:

1、PD的leader和UI放在一起,这样可能会影响主节点的性能,建议分布在不同的PD

2、完成部署后没有发现tiflash 的节点,需要自己手工的扩容,建议在部署时增加这样的选项,不用部署完成后在扩容

2、测试

1、压测

建议:简要的说明一下这两个地址的区别。用户该怎么选择这两个地址

1、本地到云上网络延迟太大,压不上去,而且也是连的外网地址

[tidb@vm115 ~]$ sysbench oltp_read_write --mysql-host=139.196.170.29 --mysql-port=4000 --mysql-user=root --mysql-password=QAZwsx1234 --mysql-db=sbtest --db-driver=mysql --tables=10 --table-size=100000 --report-interval=1 --time=3300 --threads=16 --mysql-ignore-errors run sysbench 1.0.14 (using bundled LuaJIT 2.1.0-beta2)Running thetest with following options: Number of threads: 16 Report intermediate results every 1 second(s) Initializing random number generator from current time Initializing worker threads... Threads started! [ 1s ] thds: 16 tps: 15.97 qps: 508.93 (r/w/o: 397.16/63.87/47.90) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00 [ 2s ] thds: 16 tps: 32.01 qps: 515.21 (r/w/o: 323.13/128.05/64.03) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00 [ 3s ] thds: 16 tps: 19.00 qps: 515.01 (r/w/o: 386.01/93.00/36.00) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00 [ 4s ] thds: 16 tps: 29.00 qps: 520.95 (r/w/o: 361.97/98.99/59.99) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00 [ 5s ] thds: 16 tps: 25.00 qps: 517.04 (r/w/o: 359.03/109.01/49.00) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00 [ 6s ] thds: 16 tps: 27.00 qps: 513.00 (r/w/o: 353.00/107.00/53.00) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00 [ 7s ] thds: 16 tps: 23.00 qps: 518.01 (r/w/o: 373.01/97.00/48.00) lat (ms,95%): 646.19 err/s: 0.00reconn/s:0.00 [ 8s ] thds: 16 tps: 28.00 qps: 518.97 (r/w/o: 359.98/102.99/56.00) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00 [ 9s ] thds: 16 tps: 27.00 qps: 515.05 (r/w/o: 350.03/113.01/52.01) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00 [ 10s ] thds: 16 tps: 23.00 qps: 517.00 (r/w/o: 377.00/93.00/47.00) lat (ms,95%): 646.19 err/s: 0.00 reconn/s: 0.00

2、把sysbench部署到tikv 节点压测,TPS 稍微好一点

root@iZuf621zhzo1v33dr3dwxvZ bin]# ./sysbench oltp_read_write --mysql-host=139.196.170.29 --mysql-port=4000 --mysql-user=root --mysql-password=QAZwsx1234 --mysql-db=sbtest --db-driver=mysql --tables=10 --table-size=100000 --report-interval=1 --time=3300 --threads=16 --mysql-ignore-errors run sysbench 1.1.0-df89d34 (using bundled LuaJIT 2.1.0-beta3) Running the test with following options: Number of threads: 16 Report intermediate results every 1 second(s) Initializing random number generator from current time Initializing worker threads... Threads started! [ 1s ] thds: 16 tps: 116.79 qps: 2498.45 (r/w/o: 1778.76/470.14/249.55) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00 [ 2s ] thds: 16 tps: 125.04 qps: 2517.79 (r/w/o: 1761.55/504.16/252.08) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00 [ 3s ] thds: 16 tps: 129.00 qps: 2531.99 (r/w/o: 1766.00/510.00/256.00) lat (ms,95%): 134.90err/s:0.00 reconn/s: 0.00 [ 4s ] thds: 16 tps: 127.00 qps: 2538.98 (r/w/o: 1776.99/504.00/258.00) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00 [ 5s ] thds: 16 tps: 127.00 qps: 2536.03 (r/w/o: 1773.02/510.01/253.00) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00 [ 6s ] thds: 16 tps: 125.99 qps: 2535.86 (r/w/o: 1773.90/507.97/253.99) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00 [ 7s ] thds: 16 tps: 126.01 qps: 2544.13 (r/w/o: 1786.09/504.03/254.01) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00 [ 8s ] thds: 16 tps: 128.00 qps: 2539.03 (r/w/o: 1771.02/511.01/257.00) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00 [ 9s ] thds: 16 tps: 126.00 qps: 2539.95 (r/w/o: 1779.97/506.99/253.00) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00 [ 10s ] thds: 16 tps: 129.00 qps: 2538.02 (r/w/o: 1777.01/504.00/257.00) lat (ms,95%): 134.90 err/s: 0.00 reconn/s: 0.00

3、换成内网slb后,TPS高提升有8倍

[root@iZuf621zhzo1v33dr3dwxvZ bin]# ./sysbench oltp_read_write --mysql-host=192.168.184.224 --mysql-port=4000 --mysql-user=root --mysql-password=QAZwsx1234 --mysql-db=sbtest --db-driver=mysql --tables=10 --table-size=100000 --report-interval=1 --time=3300 --threads=16 --mysql-ignore-errors run sysbench 1.1.0-df89d34 (using bundled LuaJIT 2.1.0-beta3) Running the test with following options: Number of threads: 16Report intermediate results every1 second(s) Initializing random number generator from current time Initializing worker threads... Threads started! [ 1s ] thds: 16 tps: 888.30 qps: 17971.60 (r/w/o: 12614.86/3565.18/1791.57) lat (ms,95%): 20.37 err/s: 0.00 reconn/s: 0.00 [ 2s ] thds: 16 tps: 894.19 qps: 17889.74 (r/w/o: 12514.62/3585.75/1789.37) lat (ms,95%): 20.37 err/s: 0.00 reconn/s: 0.00 [ 3s ] thds: 16 tps: 911.03 qps: 18204.52 (r/w/o: 12745.36/3637.10/1822.05) lat (ms,95%): 19.65 err/s: 0.00 reconn/s: 0.00 [ 4s ] thds: 16 tps: 868.05 qps: 17328.01 (r/w/o: 12124.71/3467.20/1736.10) lat (ms,95%): 24.83 err/s: 0.00 reconn/s: 0.00 [ 5s ] thds: 16 tps: 897.97 qps: 18012.36 (r/w/o:12619.55/3596.87/1795.94) lat (ms,95%): 20.37 err/s: 0.00 reconn/s: 0.00 [ 6s ] thds: 16 tps: 940.66 qps: 18771.29 (r/w/o: 13131.30/3758.66/1881.33) lat (ms,95%): 18.95 err/s: 0.00 reconn/s: 0.00 [ 7s ] thds: 16 tps: 899.40 qps: 17993.92 (r/w/o: 12605.55/3589.58/1798.79) lat (ms,95%): 25.28 err/s: 0.00 reconn/s: 0.00 [ 8s ] thds: 16 tps: 904.94qps:18115.86 (r/w/o: 12674.20/3631.77/1809.89) lat (ms,95%): 22.28 err/s: 0.00 reconn/s: 0.00 [ 9s ] thds: 16 tps: 947.00 qps: 18927.93 (r/w/o: 13238.95/3795.99/1892.99) lat (ms,95%): 18.61 err/s: 0.00 reconn/s: 0.00 [ 10s ] thds: 16 tps: 911.95 qps: 18215.10 (r/w/o: 12752.37/3639.82/1822.91) lat (ms,95%): 24.83 err/s: 0.00 reconn/s: 0.00 [ 11s ]thds:16 tps: 942.03 qps: 18774.52 (r/w/o: 13131.37/3758.11/1885.05) lat (ms,95%): 19.29 err/s: 0.00 reconn/s: 0.00 [ 12s ] thds: 16 tps: 939.97 qps: 18924.43 (r/w/o: 13266.60/3777.89/1879.94) lat (ms,95%): 18.61 err/s: 0.00 reconn/s: 0.00 [ 13s ] thds: 16 tps: 913.98 qps: 18271.63 (r/w/o: 12794.74/3647.93/1828.96) lat (ms,95%): 24.38 err/s: 0.00reconn/s:0.00 [ 14s ] thds: 16 tps: 952.99 qps: 19036.86 (r/w/o: 13316.91/3813.97/1905.99) lat (ms,95%): 18.28 err/s: 0.00 reconn/s: 0.00 ^C [root@iZuf621zhzo1v33dr3dwxvZ bin]#

2、扩容

扩容完成后,新的扩容tidb-server 没有负载,应该是负载均衡的问题

扩容tidb server前。起了64 个压测现场,扩容后再起64个线程。

扩容完成后,负载均衡也没有起到均衡的作用,只是单纯的把线程分配给tidb server ,没有关注tidb server 已经有的线程

建议:如果是这个逻辑,应用大部分都是连接池,长连接,扩容后,可能不能立即起到负载均衡的作用。需要和负载均衡的厂商确认这点

3、缩容

在缩容tidb server 时,出现sysbench 突然TPS,连接数全部掉0的情况

1、sysbench 压测

2、进行缩容

3、监控看到的连接数

经验证,上述问题是sysbench 遇到报错后,自动停止了。

单独起一个sysbench 任务直连tidb server ,在缩容的过程中,压测程序正常

ecs-assist-user@iZuf621zhzo1v33dr3dwxvZ ~]$ sudo -i c[root@iZuf621zhzo1v33dr3dwxvZ ~]# cd /usr/local/sysbench/bin/ [root@iZuf621zhzo1v33dr3dwxvZ bin]# ./sysbench oltp_read_write --mysql-host=192.168.184.233 --mysql-port=4000 --mysql-user=root --mysql-password=QAZwsx1234 --mysql-db=sbtest --db-driver=mysql --tables=10 --table-size=100000 --report-interval=1 --time=3300 --threads=4 --mysql-ignore-errors run sysbench 1.1.0-df89d34 (using bundled LuaJIT 2.1.0-beta3) Running the test with following options: Number of threads: 4 Report intermediate results every 1 second(s) Initializing random number generator from current timeInitializing worker threads... Threads started! [ 1s ] thds: 4 tps: 101.79 qps: 2059.70 (r/w/o: 1444.98/407.15/207.57) lat (ms,95%): 44.17 err/s: 0.00 reconn/s: 0.00 [ 2s ] thds: 4 tps: 91.04 qps: 1839.89 (r/w/o: 1290.62/368.18/181.09) lat (ms,95%): 62.19 err/s: 0.00 reconn/s: 0.00 [ 3s ] thds: 4 tps: 99.00 qps: 1987.02 (r/w/o: 1388.01/400.00/199.00)lat(ms,95%): 51.02 err/s: 0.00 reconn/s: 0.00 [ 4s ] thds: 4 tps: 88.00 qps: 1740.95 (r/w/o: 1220.97/343.99/176.00) lat (ms,95%): 71.83 err/s: 0.00 reconn/s: 0.00 [ 5s ] thds: 4 tps: 102.00 qps: 2031.03 (r/w/o: 1420.02/408.01/203.00) lat (ms,95%): 48.34 err/s: 0.00 reconn/s: 0.00 [ 6s ] thds: 4 tps: 96.00 qps: 1941.98 (r/w/o: 1360.98/388.00/193.00) lat (ms,95%): 62.19 err/s: 0.00 reconn/s: 0.00 [ 7s ] thds: 4 tps: 94.99 qps: 1883.85 (r/w/o: 1317.89/376.97/188.98) lat (ms,95%): 66.84 err/s: 0.00 reconn/s: 0.00 [ 8s ] thds: 4 tps: 100.99 qps: 2028.82 (r/w/o: 1421.87/404.96/201.98) lat (ms,95%): 48.34 err/s: 0.00 reconn/s: 0.00 [ 9s ] thds: 4 tps: 86.00 qps: 1738.07 (r/w/o: 1219.05/346.01/173.01) lat (ms,95%): 70.55 err/s: 0.00 reconn/s: 0.00 [ 10s ] thds: 4 tps: 102.01 qps: 2028.12 (r/w/o: 1420.08/404.02/204.01) lat (ms,95%): 49.21 err/s: 0.00 reconn/s: 0.00 [ 11s ] thds: 4 tps: 91.00 qps: 1827.04 (r/w/o: 1273.03/372.01/182.00) lat (ms,95%): 65.65 err/s: 0.00 reconn/s: 0.00 [ 12s ] thds: 4 tps: 102.00 qps: 2025.00 (r/w/o: 1421.00/401.00/203.00) lat (ms,95%): 48.34 err/s: 0.00 reconn/s: 0.00 [ 13s ] thds: 4 tps: 105.00 qps: 2096.99 (r/w/o: 1462.99/423.00/211.00) lat (ms,95%): 44.98 err/s: 0.00 reconn/s: 0.00 [ 14s ] thds: 4 tps: 90.00 qps: 1832.99 (r/w/o: 1288.99/364.00/180.00) lat (ms,95%): 65.65 err/s: 0.00 reconn/s: 0.00 [ 15s ] thds: 4 tps: 101.00 qps: 1990.01 (r/w/o: 1391.01/397.00/202.00)lat(ms,95%): 51.02 err/s: 0.00 reconn/s: 0.00 [ 16s ] thds: 4 tps: 88.00 qps: 1769.98 (r/w/o: 1242.98/352.00/175.00) lat (ms,95%): 65.65 err/s: 0.00 reconn/s: 0.00 [ 17s ] thds: 4 tps: 102.99 qps: 2054.90 (r/w/o: 1433.93/414.98/205.99) lat (ms,95%): 45.79 err/s: 0.00 reconn/s: 0.00 [ 18s ] thds: 4 tps: 103.01 qps: 2061.12 (r/w/o: 1446.08/408.02/207.01)lat(ms,95%): 43.39 err/s: 0.00 reconn/s: 0.00 [ 19s ] thds: 4 tps: 93.00 qps: 1854.94 (r/w/o: 1293.96/375.99/184.99) lat (ms,95%): 70.55 err/s: 0.00 reconn/s: 0.00 [ 20s ] thds: 4 tps: 104.00 qps: 2074.99 (r/w/o: 1453.99/412.00/209.00) lat (ms,95%): 44.17 err/s: 0.00 reconn/s: 0.00 [ 21s ] thds: 4 tps: 92.00 qps: 1822.09 (r/w/o: 1271.06/368.02/183.01) lat (ms,95%): 66.84 err/s: 0.00 reconn/s: 0.00 [ 22s ] thds: 4 tps: 103.00 qps: 2092.93 (r/w/o: 1473.95/411.99/206.99) lat (ms,95%): 44.17 err/s: 0.00 reconn/s: 0.00 [ 23s ] thds: 4 tps: 94.00 qps: 1880.01 (r/w/o: 1313.01/380.00/187.00) lat (ms,95%): 63.32 err/s: 0.00 reconn/s: 0.00 [ 24s ] thds: 4 tps: 98.00 qps: 1951.05 (r/w/o: 1366.03/388.01/197.00) lat (ms,95%): 59.99 err/s: 0.00 reconn/s: 0.00 [ 25s ] thds: 4 tps: 103.00 qps: 2041.10 (r/w/o: 1424.07/412.02/205.01) lat (ms,95%): 46.63 err/s: 0.00 reconn/s: 0.00 [ 26s ] thds: 4 tps: 90.00 qps: 1822.93 (r/w/o: 1281.95/359.99/180.99) lat (ms,95%): 65.65 err/s: 0.00 reconn/s: 0.00 [ 27s ] thds: 4 tps: 105.01 qps: 2090.12 (r/w/o: 1456.09/424.02/210.01) lat (ms,95%): 43.39 err/s: 0.00 reconn/s: 0.00 [ 28s ] thds: 4 tps: 89.00 qps: 1780.93 (r/w/o: 1250.95/351.99/177.99) lat (ms,95%): 64.47 err/s: 0.00 reconn/s: 0.00 [ 29s ] thds: 4 tps: 105.00 qps: 2091.96 (r/w/o: 1461.97/419.99/210.00) lat (ms,95%): 44.17 err/s: 0.00 reconn/s: 0.00 [ 30s ] thds: 4 tps: 100.99 qps: 2044.86 (r/w/o: 1438.90/403.97/201.99) lat (ms,95%): 46.63 err/s: 0.00 reconn/s: 0.00 [ 31s ] thds: 4 tps: 93.00 qps: 1860.92 (r/w/o: 1302.94/371.98/185.99) lat (ms,95%): 65.65 err/s: 0.00 reconn/s: 0.00 [ 32s ] thds: 4 tps: 106.01 qps: 2107.16 (r/w/o: 1471.11/424.03/212.02) lat (ms,95%): 43.39 err/s: 0.00 reconn/s: 0.00 [ 33s ] thds: 4 tps: 87.00 qps: 1760.92 (r/w/o: 1231.94/354.98/173.99) lat (ms,95%): 68.05 err/s: 0.00 reconn/s: 0.00 [ 34s ] thds: 4 tps: 103.99 qps: 2048.76 (r/w/o: 1431.83/408.95/207.98) lat (ms,95%): 47.47 err/s: 0.00 reconn/s: 0.00 [ 35s ] thds: 4 tps: 92.01 qps: 1889.27 (r/w/o: 1321.19/384.06/184.03) lat (ms,95%): 62.19 err/s: 0.00 reconn/s: 0.00 [ 36s ] thds: 4 tps: 101.00 qps: 1988.00 (r/w/o: 1390.00/396.00/202.00) lat (ms,95%): 62.19 err/s: 0.00 reconn/s: 0.00 [ 37s ] thds: 4 tps: 101.00 qps: 2028.04 (r/w/o: 1430.03/396.01/202.00) lat (ms,95%): 49.21 err/s: 0.00 reconn/s: 0.00 [ 38s ] thds: 4 tps: 93.00 qps: 1838.03 (r/w/o: 1277.02/376.01/185.00) lat (ms,95%): 64.47 err/s: 0.00 reconn/s: 0.00 [ 39

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:简介 DR Auto-Sync 的 ACID 恢复功能与断网应急处理方案
下一篇:统计信息十问 不为人知的细节
相关文章