Coder Social home page Coder Social logo

iustu-agent's Introduction

阿里第四届中间件性能大赛初赛代码

全Netty实现,最终得分5756,排名152,进入复赛。

优化点如下:

  1. 通信均采用了Netty实现,全异步调用。
  2. Agent之间采用ProtoBuf协议进行通信,去除了HTTP。
  3. 保持连接未断开,复用连接,通过RequestId进行消息绑定。
  4. 使用FastThreadLoacl存储RequsetId,减少线程切换。(这个优化的跑分没跑出来,当时以为比赛截至提交了)
  5. 1:2:2的绝对负载均衡,效果一般,略微提升。
  6. 各种Netty参数调优。

未实现的已知的优化点如下(不确定正确):

  1. Consumer Agent和Provider Agent之间的连接数似乎一个就够了,之前使用了自制的连接池,效果并没有。
  2. 线程切换在高并发下的消耗很多,应进一步减少线程切换带来的损失。
  3. GC方面可以优化,我的代码GC频率较高,也会产生许多消耗。
  4. 私以为瓶颈主要集中在Consumer Agent上,其性能提升影响较大。
  5. 后来看其他人答辩的时候发现dubbo本身连接数是有限制的,单client不超过200个连接,所以本身1:2:2的负载均衡其实会导致一些连接被丢弃。
  6. 答辩过程中看到冠军队c++用了新的向量化计算的指令集对协议进行解析等。
  7. 亚军队在Agent之间使用了udp传输,避免了建立连接的过程。

本人实力不佳,以上这些仅供参考,希望明年能取得好点的成绩。

附一位 6800+大神的代码地址
另一位 6800+大神的总结及代码地址

iustu-agent's People

Contributors

lynnshaw avatar

Watchers

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