ak.zip的输出(更大的文件) 总计:0.0499999523163 **吞吐量:20.48 K /秒。** 成功收到文件 连接关闭 我尝试过: 输出正在变化。就像,如果我使用较小尺寸的文件,吞吐量更高,但是如果我发送的文件更大,吞吐量更低。我正在寻找解决方案,以获得两个同行之间的恒定吞吐速度。Output when sending akki.txtServer listening....Got connection from ('10.143.47.165', 60902)('Server received', "'Hello server!'")Done sendingRaw timers: 1503350568.11 1503350568.11 1503350568.11Total: 0.00499987602234**Throughput: 204.805 K/sec.**Successfully received the fileconnection closedOutput for ak.zip ( which is bigger file)Total: 0.0499999523163**Throughput: 20.48 K/sec.**Successfully received the fileconnection closedWhat I have tried:The output is changing. Like, If I am using file with smaller size, the throughput is more, however if I am sending the file with bigger size, the throughput is less. I am looking for the solution to get the constant throughput speed between two peers.推荐答案将此行更改为change this line toprint 'Throughput:', round((1024.0 * 0.001) / (t3 - t1), 3),print 'Throughput:', round((totalbytesreceived * 0.001) / (t3 - t1), 3), 其中totalbytesreceived将是收到的文件的大小where totalbytesreceived will be the size of the file received 这篇关于服务器和客户端之间通过Python输出的吞吐量不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 05:05
查看更多