Java:rmi 协议的预期开销
在我的程序中,我使用两个提供不同方法的 RMI 服务器来模拟两个笔记本之间的简单网络协议。从我的跟踪日志中我可以看到“数据包”的传输时间当前在 850 到 1100 毫秒之间变化。
传输时间是否在预期范围内? RMI协议的开销真的有那么大吗?
BR,
马库斯
Within my program I'm using two RMI servers, which provide different methods, to simulate a simple network protocol between two notebooks. From my trace log I can see that the transmission time of a "packet" currently varies between 850 and 1100 ms.
Are the transmission times in the expected range? Is the overhead of the RMI protocol really that large?
BR,
Markus
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,RMI的开销并没有那么大。对于这种响应时间,您的请求通常必须非常大,或者您的网络非常慢。
No, the overhead of RMI is not that large. Your requests would typically have to be very big or your network really slow for that kind of response time.
导致 RMI 速度显着减慢的原因之一是您如何将数据分成多个数据包。例如,在我的工作中,我们曾经测试过一种设置,通过 RMI 逐一发送事件,每个事件大约需要 35 毫秒才能传输。之后,我们尝试对多个事件进行分组缓冲区并将它们作为一个组发送,在大约 20,000 个事件以约 60 毫秒的速度发送时,我们得出的结论是,虽然 RMI 没有大量带宽开销,但发送/接收部分可能有。
One thing which causes RMI to slow down a lot is how you divide your data into several packets. For example at my work we once tested a setup where we sent events over RMI one by one, each event took about 35ms to get transferred. After that we tried to group buffer multiple events and sending them as a group and at around 20 000 events going at ~60ms we came to conclusion that while RMI doesn't have a lot of bandwidth overhead, the sending/receiving part may have.