本页面上的部分或全部信息可能不适用于 Trusted Cloud by S3NS。
负载平衡和扩缩
Trusted Cloud by S3NS 提供了实例组负载均衡和自动扩缩功能。
负载均衡
由于Trusted Cloud 提供服务器端负载均衡功能,因此您可以在多个虚拟机 (VM) 实例之间分配传入流量。负载平衡具有以下优势:
- 扩缩应用
- 支持巨大流量
- 使用健康检查检测并自动移除健康状况不佳的虚拟机实例。系统会自动重新添加运行状况恢复良好的实例。
- 将流量路由到最近的虚拟机
Trusted Cloud 负载均衡会使用转发规则资源来匹配特定类型的流量并将其转发到负载均衡器。例如,转发规则可以匹配目的地为 IP 地址 192.0.2.1
端口 80 的 TCP 流量并转发到负载均衡器,随后负载均衡器会将相应流量定向到健康状况良好的虚拟机实例。
Trusted Cloud 负载均衡是一种托管式服务,因此它的组件具备冗余性和高可用性。如果负载均衡组件发生故障,则会立即自动重启或被替换。
Trusted Cloud 提供了数种不同类型的负载均衡,它们在功能、使用场景以及配置方式上有所不同。如需了解相关说明,请参阅Trusted Cloud 负载均衡文档。
自动扩缩
Compute Engine 提供了自动扩缩功能,可根据负载的增减自动向/从代管式实例组 (MIG) 添加/移除虚拟机实例。自动扩缩可让您的应用顺利应对流量增加的情况,并在资源需求量减少时降低费用。您可以根据 MIG 的 CPU 利用率、Cloud Monitoring 指标、时间表或负载均衡服务容量来自动扩缩 MIG。
当您将自动扩缩程序设置为根据负载均衡服务容量进行扩缩时,自动扩缩程序会监控实例组的服务容量,并在虚拟机实例容量过大或不足时进行扩缩。 您可以在负载均衡器的后端服务中定义实例的服务容量,该容量可能基于利用率或每秒请求次数。如需了解详情,请参阅根据负载均衡服务容量进行扩缩。
如需详细了解自动扩缩功能,请参阅自动扩缩实例组。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-19。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[[["\u003cp\u003eGoogle Cloud offers server-side load balancing to distribute incoming traffic across multiple virtual machine instances, ensuring high availability and scalability.\u003c/p\u003e\n"],["\u003cp\u003eThe load balancing service uses forwarding rules to direct specific types of traffic to a load balancer, which then routes it to healthy VM instances.\u003c/p\u003e\n"],["\u003cp\u003eAutoscaling in Compute Engine automatically adjusts the number of VM instances in a managed instance group based on various factors such as CPU utilization, Cloud Monitoring metrics, schedules, or load balancing serving capacity.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Cloud's autoscaling feature can scale based on the serving capacity of the instance group, defined in the load balancer's backend service, which can use either utilization or requests per second as metrics.\u003c/p\u003e\n"]]],[],null,[]]