测试方式:
https://blog.csdn.net/oe1019/article/details/105982128
结果:
1) 为了更好的测试性能我在java端采用了stringbuffer
2) 为了测试并发的错误率我加入了随机a=90, b=210的检测
Round 1:
Label | # Samples | Average | Median | 90% Line | 95% Line | 99% Line | Min | Max | Error % | Throughput | Received KB/sec | Sent KB/sec |
---|---|---|---|---|---|---|---|---|---|---|---|---|
gatewaypool | 19299 | 14 | 14 | 17 | 18 | 21 | 8 | 122 | 0.078% | 643.14993 | 120.78 | 81.65 |
TOTAL | 19299 | 14 | 14 | 17 | 18 | 21 | 8 | 122 | 0.078% | 643.14993 | 120.78 | 81.65 |
Round 2:
Label | # Samples | Average | Median | 90% Line | 95% Line | 99% Line | Min | Max | Error % | Throughput | Received KB/sec | Sent KB/sec |
---|---|---|---|---|---|---|---|---|---|---|---|---|
gatewaypool | 19452 | 14 | 14 | 17 | 18 | 21 | 7 | 1238 | 0.093% | 648.24874 | 121.74 | 82.30 |
TOTAL | 19452 | 14 | 14 | 17 | 18 | 21 | 7 | 1238 | 0.093% | 648.24874 | 121.74 | 82.30 |
Round 3:
Label | # Samples | Average | Median | 90% Line | 95% Line | 99% Line | Min | Max | Error % | Throughput | Received KB/sec | Sent KB/sec |
---|---|---|---|---|---|---|---|---|---|---|---|---|
gatewaypool | 19358 | 14 | 14 | 17 | 18 | 21 | 6 | 91 | 0.041% | 645.07314 | 121.12 | 81.89 |
TOTAL | 19358 | 14 | 14 | 17 | 18 | 21 | 6 | 91 | 0.041% | 645.07314 | 121.12 | 81.89 |
fabric gateway java
Round 1:
Label | # Samples | Average | Median | 90% Line | 95% Line | 99% Line | Min | Max | Error % | Throughput | Received KB/sec | Sent KB/sec |
---|---|---|---|---|---|---|---|---|---|---|---|---|
gateway | 20898 | 13 | 13 | 16 | 17 | 19 | 8 | 53 | 0.206% | 696.55356 | 130.88 | 85.71 |
TOTAL | 20898 | 13 | 13 | 16 | 17 | 19 | 8 | 53 | 0.206% | 696.55356 | 130.88 | 85.71 |
Round 2:
Label | # Samples | Average | Median | 90% Line | 95% Line | 99% Line | Min | Max | Error % | Throughput | Received KB/sec | Sent KB/sec |
---|---|---|---|---|---|---|---|---|---|---|---|---|
gateway | 21120 | 12 | 13 | 16 | 17 | 19 | 7 | 31 | 0.189% | 703.85923 | 132.24 | 86.61 |
TOTAL | 21120 | 12 | 13 | 16 | 17 | 19 | 7 | 31 | 0.189% | 703.85923 | 132.24 | 86.61 |
Round 3:
Label | # Samples | Average | Median | 90% Line | 95% Line | 99% Line | Min | Max | Error % | Throughput | Received KB/sec | Sent KB/sec |
---|---|---|---|---|---|---|---|---|---|---|---|---|
gateway | 21366 | 12 | 13 | 15 | 16 | 18 | 6 | 28 | 0.201% | 711.93896 | 133.77 | 87.60 |
TOTAL | 21366 | 12 | 13 | 15 | 16 | 18 | 6 | 28 | 0.201% | 711.93896 | 133.77 | 87.60 |
可以看到在极限压力情况下。
这里gateway的错误率要相对比较pool based gateway要搞。
注意事项
1) 这里gateway创建的是static对象。
如果反复从wallet里读取对象会发生文件IO阻塞导致服务器崩溃
2) 这里从gateway里创建的contract对象也是要求static且只连接一次的。(connection方法)
否则反复创建和peer节点的连接会把peer节点压垮
3) 关于如何转换byfn的钱包给到gateway的file wallet,推荐大家去读一下源码。
3.1) 需要准备一个admin.priv文件(从private key来)
3.2) 需要根据msp和sign cert准备一个json格式的文件,作为入口。