可扩展性和弹性

云计算中的负载均衡是什么?

更新日期: 10 月 28, 2026

作者: Ioana Grigorescu, 内容经理

审阅者: Marta Dozorska, 产品副总裁

了解负载均衡如何确保您的 SaaS 应用程序保持在线并在压力下运行。探索其工作原理、优势以及与可扩展性的关系。

什么是负载均衡?

Load balancing is the practice of spreading incoming traffic across several servers, also referred to as traffic dispatching because it works as a traffic director for websites and applications. It distributes user traffic across multiple servers to manage the load on individual servers, which can affect system operation. In cloud computing, it is usually a managed software service rather than a dedicated hardware appliance.

为什么负载均衡对云计算和SaaS应用程序至关重要?

负载均衡在以下方面至关重要 云环境 和SaaS应用程序中,因为那里的资源是虚拟的,有时可能会因流量过载。它可以确保:

  • 高可用性: 如果一台服务器宕机,流量会自动重定向到其他功能正常的服务器。
  • 性能: 在同时接收多个请求时,保持应用程序的响应。
  • 可扩展性: 向池中添加更多服务器以处理不断增长的流量。

请记住: 所有服务器协同工作,同时处理总工作负载,以提高所提供产品或服务的可用性。

真实案例: 像Netflix这样的流媒体平台采用负载均衡,以便同时向数百万用户提供无缝的视频流。

负载均衡是如何工作的?

Think of it like shopping in a busy supermarket where instead of everybody queueing up at one counter, several counters are opened to divide the load. Load balancers function similarly; they distribute incoming requests across the servers, often to the least loaded one.

Some of the common load balancing techniques include round-robin, least connections, and IP hash, each with its advantages and use cases. Load balancers also differ by layer: a Layer 4 (transport) balancer routes by IP address and port, while a Layer 7 (application) balancer reads the request itself, such as its URL (F5).

请记住

负载均衡器还可能考虑服务器的健康状况、响应时间或服务器的地理位置。 A global load balancer spreads traffic across servers in several regions and sends each user to a nearby healthy one.

可扩展性和负载均衡之间有什么区别?

Load balancing decides which server receives each request, while 可扩展性 changes how many servers there are:

  • 可扩展性: 能够增加或减少资源(如服务器)并管理不同的流量级别。
  • 负载均衡: 这是将流量分配到可用资源上的行为。
  • 云弹性: 包括基于流量自动扩展资源,以及可扩展性和负载分配的集成。

 

可扩展性、负载均衡和云弹性的比较
特征 可扩展性 负载均衡 云弹性
核心职能
主要目的 增加或减少资源以管理流量水平 在可用资源之间分配流量 根据流量自动扩展和分配资源
运行机制
资源管理 添加或移除服务器/资源 Often directs traffic to least loaded servers 动态调整资源和流量分配
响应能力 为潜在的流量变化做好准备 响应即时流量分配需求 主动和被动地管理资源
主要优势
性能影响 确保流量增长的容量 保持一致的应用程序性能 优化性能和资源利用率

在SaaS应用中,负载均衡有哪些实际应用案例?

负载均衡广泛应用于 SaaS 应用程序中,以提高用户满意度和服务的可用性。例如:

  • Microsoft Office 365: 平衡数百万用户访问电子邮件、文档和其他服务的流量。
  • Zoom视频会议: 将视频或音频流量分配到多个服务器,以保持通信质量。
  • Salesforce CRM: Balances the volume of customer relationship management data and transactions for responsiveness 和 availability for 销售团队.

结论

负载均衡是云计算和基于SaaS的解决方案的核心组件之一。它将用户流量分配到多个服务器,以保持应用程序的可用性、性能和可扩展性。理解负载均衡及其相关概念有助于在构建或选择基于云的解决方案时做出明智的决策。

准备好开始了吗?

我们理解您的处境。让我们分享二十余载的经验,助您实现全球化梦想。
马赛克图像
zh_CN简体中文