我需要构建 HTTP 服务器来获取其中的许多请求。1-5 秒内只有 10,000-30,000 个。这是一个短/小的要求。
我需要选择或将其基于 libevent/libev(或者可能是 ACE ??),或者使用 java.nio 在 java 中进行。
我没有找到任何可以与 libevent 与 java.nio 或 ACE 与 java.nio 进行对比的基准测试。
你们专家怎么看?
从我的角度来看,java 更容易维护(java 比 c 更容易),但我怀疑我会为性能付出代价。
我需要建议。
谢谢
问问题
1688 次
1 回答
1
Have a look at Netty. It's a Java NIO server that's built to handle what you're asking for.
As for benchmarks, the first hit from Google is already four years old:
http://gleamynode.net/articles/2232/
I'd bet that Netty has improved since then.
from my point of view java is more easy to maintain (java is easier then c) but i suspect i will pay in preference.
I'll assume that you mean "performance", not "preference." I would say that your suspicion might be incorrect. Best to get some real data of your own and see.
于 2012-03-05T23:33:03.410 回答