Giter Site home page Giter Site logo

javanio's Introduction

#java nio 非阻塞压力测试客户端

  • 非阻塞 IO
  • 其实无论是用 Java NIO 还是用 Netty,达到百万连接都没有任何难度。因为它们都是非阻塞的 IO,不需要为每个连接创建一个线程了。
  • nio 和 io的区别
  • nio的核心:Channel 通道,Buffer 缓冲区,Selector 选择器

如果是百万级测试,怎么去找那么多机器?

  • 按照nio上面的做法,单机最多可以有 6W 的连接,百万连接起码需要17台机器!

  • 如何才能突破这个限制呢?其实这个限制来自于网卡。 可以通过使用虚拟机,并且把虚拟机的虚拟网卡配置成了桥接模式解决了问题。

    • 根据物理机内存大小,单个物理机起码可以跑4-5个虚拟机,所以最终百万连接只要4台物理机就够了。
  • 此次学习用的是netty 的方式,netty可以写server和client,代码中是client的学习

  • http://netty.io/wiki/user-guide-for-4.x.html#wiki-h3-10

端口受限设置参考说明文档

javanio's People

Contributors

louis-me avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.