Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Azure limiting outgoing connections

Tags:

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.

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.

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

like image 976
Richard Houltz Avatar asked May 15 '15 21:05

Richard Houltz


People also ask

What is outbound rule in Azure?

Outbound rules allow you to explicitly define SNAT(source network address translation) for a public standard load balancer. This configuration allows you to use the public IP(s) of your load balancer to provide outbound internet connectivity for your backend instances. This configuration enables: IP masquerading.

How many requests can Azure app handle?

By default each Cloud Run container instance can receive up to 80 requests at the same time; you can increase this to a maximum of 1000. Although you should use the default value, if needed you can lower the maximum concurrency.

How do you set inbound and outbound rules in Azure?

Create an inbound security ruleSelect your new network security group. Select Inbound security rules from the left menu, then select Add. You can limit the Source and Source port ranges as needed or leave the default of Any. You can limit the Destination as needed or leave the default of Any.


Video Answer


2 Answers

There is a maximum connection limit per azure subscription.

You should reuse the connections instead of opening new ones.

Read more about it here: http://www.freekpaans.nl/2015/08/starving-outgoing-connections-on-windows-azure-web-sites/

like image 195
Stefan Alexandru Avatar answered Nov 15 '22 10:11

Stefan Alexandru


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.

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

Summarizing key points:

  1. Try assigning a public IP to your VM if it doesn't have one. This is only viable if you are running a handful of VMs.
  2. Try adding multiple IPs to your VNET/Load balancer if you are running behind one. Each external IP will multiply your connection limit.
  3. Try optimizing your connection usage, i.e. keep connections alive for longer for efficient pipe-lining.
like image 24
heren Avatar answered Nov 15 '22 12:11

heren