Azure是否限制传出连接 [英] Is Azure limiting outgoing connections

查看:58
本文介绍了Azure是否限制传出连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Azure中运行VM,在该VM上我有一项服务,该服务可以进行许多拨出的HTTP客户端调用.一段时间(大约10分钟)后,当该服务进行了大约5000-10000次通话时,它突然开始获得Connection Refused作为对请求的响应.

I'm running a VM in Azure on which I have a service that makes a lot of outgoing http client calls. After a while (approx 10 minutes) when the service has made around 5000-10000 calls it suddenly starts to get Connection Refused as reponse to the requests.

在本地运行相同的服务(在许多环境和计算机中尝试过)时,它运行时没有任何错误.我们正在使用HttpClient类进行请求.这些请求是在3个同时运行的任务中完成的.

When running the same service locally (tried in many environments and computers) it runs without any error. We are using the HttpClient class for the request. The requests are done in 3 tasks running concurrently.

我应该注意Azure中传出连接的数量有什么限制吗?

Is there some limits on the amount of outgoing connections in Azure that I should be aware of?

推荐答案

我们过去也遇到过类似的问题,并且看起来虚拟机与外部IP的出站连接限制为1024.当内部Azure IP位于同一数据中心时,它们将不受此限制,因为内部路由表能够处理这些连接.

We have hit similar issues in the past, and looks like the VMs have an outbound connection limit of 1024 to an external IP. Internal Azure IPs, when they are in the same data center won't have this limitation since internal routing tables are able to handle those connections.

这里有很多相关信息: https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-connections#snatexhaust

There is a lot of relevant information here: https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-connections#snatexhaust

总结要点:

  1. 如果没有,请尝试为您的VM分配一个公共IP.仅当您运行少量VM时,这才可行.
  2. 如果要在VNET/负载均衡器中运行多个IP,请尝试添加多个IP.每个外部IP都会使您的连接限制倍增.
  3. 尝试优化您的连接使用情况,即,使连接保持活动状态的时间更长,以实现高效的管道传输.

这篇关于Azure是否限制传出连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆