使用mina框架实现高并发的TCP数据交互,请问有没有什么可以提高吞吐量或者提高性能的配置方法
比如一台服务器,10万个客户端,每个客户端平均5秒发一次TCP数据到服务器

解决方案 »

  1.   


    就是说在使用mina的时候,没有什么配置什么的吗?
    就直接用像网上那些基本的小例子那种收发消息。
    性能没法再提升吗?
    靠外部实现队列、缓存等方法不算,如何靠mina本身提高性能
      

  2.   

    貌似mina到这个级别有瓶颈。很久没碰了。最后一次实战应用还是mina1.x时代,2.0还没正式出来。建议通过某种算法或者实现规划,将10w级别自动引导到不同的服务器。
      

  3.   

    有一种可能是mina对并发不做人为限制,而是天然限制,比如内存,超重载荷下就OutOfMemery了,这种情况下就增大内存配给。Troubleshooting
    I get OutOfMemoryError or response timeout and connection reset under heavy load.We recommend to switch the default buffer type to 'heap' by inserting the following code before you start a server:ByteBuffer.setUseDirectBuffers(false);
    ByteBuffer.setAllocator(new SimpleByteBufferAllocator());If you prefer direct buffers to heap buffers, JVM might have ran out of direct memory. Please try increasing maximum direct memory size using -XX:MaxDirectMemorySize option (e.g. -XX:MaxDirectMemorySize=128M)
      

  4.   


    就是说得靠外部去实现负载均衡来提高吞吐量?
    mina框架本身可以通过配置实现类似的功能吗?