Apache Mina 总带宽基准测试
我正在开发一个相对快节奏的游戏(Flash/Apache Mina 服务器后端),并且我在获得当前设置将使用的带宽类型的准确基准方面遇到一些困难。
我的问题是:如何获得测试所需带宽的准确基准?我现在所做的不会考虑任何开销?
在我正在执行的消息发送/接收方法中,
[out/in]Bandwidth+= message.toString().getBytes().length;
我每 250 毫秒打印出当前值(因为这是当前“世界”更新的频率)。
10 个“怪物”全部随机移动,1 个玩家随机移动,我得到这个输出..(此处为 1 秒窗口)
In bandwidth: 1647, Outgoing: 35378
In bandwidth: 1658, Outgoing: 35585
In bandwidth: 1669, Outgoing: 35792
In bandwidth: 1680, Outgoing: 35999
因此,严格按照传递的消息(传出)大小进行操作,结果约为 621 字节/秒或每人屏幕上不断移动的项目每秒 (621/10) 62.1 字节。这看起来有点低,良好的高速连接可以以这个“速率”每秒处理 1000+ 对象更新,没有问题。
I am developing a relatively fast paced game (Flash/Apache Mina Server back end) and I am having some difficulty getting an accurate benchmark of the type of bandwidth my current setup would use.
My question is: How do I get an accurate benchmark of the bandwidth required for my tests? What I am doing now wouldn't take into account any overhead?
On the message sent/received methods I am doing
[out/in]Bandwidth+= message.toString().getBytes().length;
I then print out the current values every 250 milliseconds (since that is how frequently "world" updates are done currently) .
With 10 "monsters" all randomly moving around and 1 player randomly moving around I am getting this output.. (1 second window here)
In bandwidth: 1647, Outgoing: 35378
In bandwidth: 1658, Outgoing: 35585
In bandwidth: 1669, Outgoing: 35792
In bandwidth: 1680, Outgoing: 35999
So acting strictly on the size of the messages (outgoing) being passed that works out to about 621 bytes/second or (621/10) 62.1 bytes per second per constantly moving item on screen per person. This seems a little low, a good high speed connection could handle 1000+ object updates per second at this "rate" no problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里肯定有股鱼腥味。根据他们提供的性能测试:这里 mina 能够处理 20K+ 405 字节每秒约 10 个连接的请求数 - 比您所看到的要多得多。
我的猜测是这里发生了某种主题/计时问题导致了延迟。我会寻求数据包跟踪应用程序(例如wireshark)的帮助,看看您在代码中的观察结果是否与原始网络数据相匹配。如果可能的话,我还会尝试用更多数据“淹没”服务器端 - 这可能会提供一些有关问题所在的见解。
我希望这有帮助,祝你好运。
Something definitely smells fishy here. According to the performance testing provided by them: here mina is capable of 20K+ 405 byte requests per second on ~10 connections - way more than what you're seeing.
My guess is that there is some kind of theading\timing issue going on here that is causing the delay. I would enlist the help of a packet tracing application such as wireshark and see if your observations in code mesh with the raw network data. I would also try "flooding" the server side with more data if possible - this might provide some insight to where the issue lies.
I hope this helps, good luck.