测试代码:1. smart/test/tcpserver/tcpserver.cpp 2. smart/test/examples/latency/ 测试环境:CentOS6.7-x86_64 虚拟机(4核,2G内存)
[[email protected] bin_d]$ ./latency_d 127.0.0.1 8800 Usage: ./latency_d server_ip server_port block_size [msg_totalCount] [[email protected] bin_d]$ ./latency_d 127.0.0.1 8800 16000 10000 s Press q or Q to exit... Press q or Q to exit... --------------done-------------- blocksize = 16000 bytes //每次发送16000字节 ping-ping测试 round-trips = 10000 //10000次轮回 elapsed = 2538[ms] 3938.748 round-trips per second 126.944 latency[us] //测试结果 平均延时 127微秒 ≈ 0.13毫秒 60.101 band width[MB/s]