您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

配置 Azure 负载均衡器的 TCP 重置和空闲超时Configure TCP reset and idle timeout for Azure Load Balancer

Azure 负载均衡器的空闲超时范围如下:Azure Load Balancer has the following idle timeout range:

  • 对于出站规则为4分钟到100分钟4 minutes to 100 minutes for Outbound Rules
  • 负载均衡器规则和入站 NAT 规则4到30分钟4 minutes to 30 minutes for Load Balancer rules and Inbound NAT rules

默认情况下,它设置为4分钟。By default, it's set to 4 minutes. 如果处于非活动状态的时间超过超时值,则不能保证在客户端和服务之间保持 TCP 或 HTTP 会话。If a period of inactivity is longer than the timeout value, there's no guarantee that the TCP or HTTP session is maintained between the client and your service.

以下部分介绍如何更改负载均衡器资源的空闲超时和 tcp 重置设置。The following sections describe how to change idle timeout and tcp reset settings for load balancer resources.

设置 tcp 重置和空闲超时Set tcp reset and idle timeout


若要为负载均衡器设置空闲超时和 tcp 重置,请编辑负载均衡规则。To set the idle timeout and tcp reset for a load balancer, edit the load-balanced rule.

  1. 登录 Azure 门户Sign in to the Azure portal.

  2. 在左侧菜单中,选择 " 资源组 "。In the left-hand menu, select Resource groups .

  3. 选择负载均衡器的资源组。Select the resource group for your load balancer. 在此示例中,资源组名为 myResourceGroupIn this example, the resource group is named myResourceGroup .

  4. 选择负载均衡器。Select your load balancer. 在此示例中,负载均衡器名为 myLoadBalancerIn this example, the load balancer is named myLoadBalancer .

  5. 在 " 设置 " 中,选择 " 负载均衡规则 "。In Settings , select Load balancing rules .

    编辑负载均衡器规则。

  6. 选择负载均衡规则。Select your load-balancing rule. 在此示例中,负载均衡规则名为 mylbrule 更改In this example, the load-balancing rule is named myLBrule .

  7. 在负载平衡规则中,将 "空闲超时" 下的滑块 (分钟) 移动到超时值。In the load-balancing rule, move the slider in Idle timeout (minutes) to your timeout value.

  8. 在 " TCP 重置 " 下,选择 " 已启用 "。Under TCP reset , select Enabled .

    设置空闲超时和 tcp 重置。

  9. 选择“保存” 。Select Save .

后续步骤Next steps

有关 tcp 空闲超时和重置的详细信息,请参阅 负载均衡器 Tcp 重置和空闲超时For more information on tcp idle timeout and reset, see Load Balancer TCP Reset and Idle Timeout

有关配置负载均衡器分发模式的详细信息,请参阅 配置负载均衡器分发模式For more information on configuring the load balancer distribution mode, see Configure a load balancer distribution mode.