Giter Site home page Giter Site logo

waterwave's Introduction

waterwave

About

  • a framework,which implements of the modle of AIO BIO NIO and which with optimization of it's buffer.

  • it is just depends on the JDK lib, witch with out other libs.

  • have done an implementation of proxy which is using this framework.

  • 一个网络框架,实现主流的AIO NIO BIO等模型,以及相应的缓存优化

  • 框架不依赖JDK外的任何外部LIB

  • 在工程中实现了一版基于框架的代理功能

TODO

  • protocols interface

  • implementations of parser for HTTP protocols and MYSQL protocols

  • implementations of recording for the Proxy's logging

  • 下一步增加协议接口

  • 实现HTTP,MYSQL协议解析

  • 代理的日志接口,和实现

First test (proxy):

ENV

  • VM: Xeon E312xx 2.4Ghz X 8 16GB RAM
  • MYSQL: 5.7.17
  • JAVA: 1.8.74
  • NET: VM NETWORKS, ZERO HOP OF ROUTER

DESC

  • AIO:
    • 2 thread for R/W handler of server and also for handler of working,
    • 2 thread for R/W handler of client and also for handler of working
  • NIO:
    • 1 thread for R/W handler of server,
    • 1 thread for R/W handler of client,
    • n hread for handler of working
  • BIO:
    • n thread for R/W handler of server and R/W handler of client and also for handler of working
  • NIO(1t):
    • 1 thread for R/W handler of server and R/W handler of client and also for handler of working
  • NETTY(1t):
    • 1 thread for R/W handler of server and R/W handler of client and also for handler of working

RESULT

  • just directly connecting to Mysql can upto 100K QPS
  • the best result is the single thread Proxy(NIO), and it may reach 75K QPS, wich is with low CPU using.
  • proxy using BIO may reach 70K QPS , wich is with some CPU using.
  • proxy using AIO may reach 70K QPS , wich is with some higher CPU using.
  • due to using synchronization in the implementation of the writer, the NIO with 1T + 1T + nT implementation has low QPS, this may improve by changing the strategy.

THREADS QPS (KQPS)

T DB QPS(NOPROXY) AIO(2T+2T) NIO(1T+1T+nT) BIO(nT) NIO(1T) NETTY(1T)
20 50 30 15 32 35 30
40 90 52 18 50 59 46
60 100 62 21 65 63 60
80 105 62 19 68 72 67
100 105 68 19 72 74 74

THREADS CPU USING (%)

T DB CPU(NOPROXY) AIO(2T+2T) NIO(1T+1T+nT) BIO(nT) NIO(1T) NETTY(1T)
20 400 250 200 140 70 100
40 700 300 250 290 89 150
60 780 310 270 320 90 220
80 790 310 260 380 92 240
100 790 320 260 420 93 220

THREADS QPS

WW-QPS-201701.png

THREADS CPU USING

WW-CPU-201701.png

waterwave's People

Contributors

psfu avatar

Watchers

James Cloos avatar  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.