【发布时间】:2014-10-28 17:02:57
【问题描述】:
我目前正在使用 io.netty.handler.traffic.ChannelTrafficShapingHandler 和 io.netty.handler.traffic.TrafficCounter 来测量 netty 客户端和服务器的性能。我一直看到服务器上的当前写入值和客户端上的当前读取值存在差异。考虑到写入/读取 KB/s 始终接近匹配,我该如何解释这种差异。
2014-10-28 16:57:50,099 [Timer-4] INFO PerfLogging 130 - Netty Traffic stats TrafficShaping with Write Limit: 0 Read Limit: 0 and Counter: Monitor ChannelTC431885482 Current Speed Read: 3049 KB/ s,写入:0 KB/s 当前读取:90847 KB当前写入:0 KB
2014-10-28 16:57:42,230 [ServerStreamingLogging] 调试 c.f.s.r.l.ServerStreamingLogger:115 - 流量统计 WKS226-39843-MTY6NDU6NTAvMDAwMDAw TrafficShaping with Write Limit: 0 Read Limit: 0 and Counter: Monitor ChannelTC385810078 Current Speed Read: 0 KB /s,写入:3049 KB/s 当前读取:0 KB 当前写入:66837 KB
客户端和服务器之间是否存在某种压缩?
我可以看到我的客户端值大约是 3049 * 30 = 91470KB,其中 30 是计算累积数字的秒数
【问题讨论】:
-
不确定这是否相关,但有一堆与此代码区域相关的 PR 已打开。例如github.com/netty/netty/pull/3050.
-
感谢斯科特提供的信息。
标签: performance netty