Git Product home page Git Product logo

Comments (3)

gaocegege avatar gaocegege commented on June 12, 2024 1

这篇文章主要介绍了谷歌生产环境(曾经?)的 IP 层(OSI 第三层)负载均衡软件实现的设计与实现。

众所周知,负载均衡分为硬件方案和软件方案两种。硬件方案最典型的代表是 F5,软件方案则包括 nginx 等。

截屏2021-11-15 上午10 46 53

硬件方案如左图所示。像 F5 这样的硬件负载均衡器虽然能够解决问题,但是存在非常多的缺点:

  • 成本非常高。这里的成本是不同维度的,不仅是设备本身贵,学习 F5 本身的成本也非常高。特定的硬件需要特定的知识,而且无法扩展到其他领域。
  • 利用率低。一个 F5 工作的时候一定需要一个完全冗余的副本,在工业界一般它们被称作一对负载均衡器。这一对负载均衡器的理论最大利用率也只有 50%,也就是一个满负载工作,一个 backup 看戏(
  • 扩展性差。系统的瓶颈往往会来自负载均衡器的理论上限,难以横向扩展。

谷歌向来的设计原则是用尽可能便宜的主流商用机器解决问题,在负载均衡这件事情上也是一样的。因此 Maglev 可以被当作是为了取代 F5,打败邪恶的领域特定硬件的软件负载均衡方案。软件方案的好处有很多:

  • 降低成本,普通的 Linux 服务器就可以运行软件负载均衡器,不需要特定硬件和特定知识
  • 扩展性好,只需要横向地增加软件负载均衡实例就可以不断提高负载均衡器的理论 QPS 上限
  • 利用率高,之前利用率的理论上限是 50%,因为工作节点和 backup 节点的数量是 1:1,而软件方案可以做到 N/N+1 * 100% 的利用率,因为可以让工作节点扩展到 N 个,同时只留一个 backup。

具体的细节可以参考 https://manjusaka.itscoder.com/posts/2020/05/23/a-simple-introduction-about-maglev/

from papers-notebook.

gaocegege avatar gaocegege commented on June 12, 2024

https://manjusaka.itscoder.com/posts/2020/05/23/a-simple-introduction-about-maglev/ 群友的 post

from papers-notebook.

gaocegege avatar gaocegege commented on June 12, 2024

envoyproxy/envoy#2267

from papers-notebook.

Related Issues (20)

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.