Skip to content

联盟链性能测试

linj edited this page Nov 23, 2022 · 1 revision

联盟链性能测试

不同的硬件配置情况下,联盟链的性能指标如下表所示(以下测试基于腾讯云服务器): 用户在部署区块链时,可以根据业务量选择对应的配置。 当业务量增长,区块链节点运行内存超过70%,硬盘使用空间超过70%,需要扩充服务器的配置。

+----------+---------+--------------------------------------------------------------+-----------------+
| 序号   | 节点数量   | 基础配置                                                      |TPS             |
+==========+=========+========+====================================+
| 1     | 4台共识节点 | 操作系统:Ubuntu18 CPU:2核,内存:4G,硬盘:500G, 腾讯云服务器  | 3000笔每秒      |
+----------+---------+--------+------------------------------------+
| 2     | 4台共识节点 | 操作系统:Ubuntu18 CPU:4核,内存:8G,硬盘:500G, 腾讯云服务器  | 10000笔每秒     |
+----------+---------+--------+------------------------------------+
| 3     | 4台共识节点 | 操作系统:Ubuntu18 CPU:8核,内存:16G,硬盘:500G, 腾讯云服务器 | 17000笔每秒     |
+----------+---------+--------+-----------------------------------------------------+-----------------+

联盟链部署

准备5台测试服务器,4台用于部署联盟链集群,1台用于部署发交易程序

压力测试(存证功能,go版本工具)

  • 下载批量发存证交易程序,在第5台服务器上操作
wget https://bty33.oss-cn-shanghai.aliyuncs.com/chain33Dev/sendtx-count
# 发交易程序的源码(可以根据需要自己修改)
https://github.com/caopingcp/plugin/blob/testp2p/plugin/consensus/tendermint/tools/nonePerf.go#L92  
  • 下载后执行发送命令
# 4个进程,一共发送20000*60*4= 4800000笔交易
nohup ./sendtx-count perf 172.27.0.2:8802 32 20000 1 60 >> send.out1&  
nohup ./sendtx-count perf 172.27.0.5:8802 32 20000 1 60 >> send.out2&  
nohup ./sendtx-count perf 172.27.0.9:8802 32 20000 1 60 >> send.out3&  
nohup ./sendtx-count perf 172.27.0.15:8802 32 20000 1 60 >> send.out4&  
#格式说明
sendtx-count perf [区块链节点的IP:grpc端口] [交易字节数] [发送多少笔] [每次发送时间间隔] [总共发送多长时间]
  • 交易发送发完成,执行以下命令查看平均TPS
./chain33-cli qbft perf_stat
Clone this wiki locally