Azure VM: too frequent DNS lookup [TTL 60] - azure

I have a VM setup on Azure (classic VM running CentOS). I am developing my mobile app that connect with RESTful API's hosted on Azure VM. My mobile app performance was slow and on investigation, I found DNS lookup to the FQDN of my Azure VM is too long (about 5-5.5 seconds per lookup) and very frequent. Attached is the output of "dig" tool on my Mac.
Dig tool output
Is there a way I can control TTL for the Azure VM's? Would it help if I buy a static IP and map it to my Azure VM's FQDN? Also, is there a way to reduce the DNS lookup time?
Thanks,
Giri

The TTL is associated to the domain name. If you want to increase the TTL you would need to purchase a domain name and associate it with the domain. With your own domain name you can set whatever TTL you require.
You would be far better developing against a domain name as this will give you the most flexibility with regards to developing against it, since you are able to move the location that your application points to, and should your app be particularly successful you would need a domain name for load balancing etc.

Related

Trying to achieve simple fail over for two VMs hosted on Azure

i am running a web-based online application and trying to achieve HA.
i created two windows vmss in an availability set.
All i am looking for is a simple failover protocol, what i am trying to achieve is when my Main Vm is down for any reason,my incoming traffic redirects to my Backup VM till the main vm is up and running again.
I know that Azure Traffic Manager can achieve this by using the Priority type and setting end points for Public Ips that assigned to my vmss.
But the traffic manager is using DNS in order to route traffics, there are some downtown before the traffic manager redirect traffic to my backup vm.
Please check this answer as well for more info why Traffic manager is not the solution. -even when i use fast-intervals settings-
https://stackoverflow.com/a/34469575/10786981
i also can't use load-balancer. As i need the Active/Passive model and load-balancer can't support this model.
A 3rd Load Balancer are expensive and we are really looking in to a simple solution here.

Azure AppService - multitenant application different datacenter

I am building a multitenant application and I would need to know if I can achieve this in Azure.
Assuming the application will be deployed to multiple regions/datacenters. The tenant will be identified by the subdomain: tenant1.domain.com, tenant2.domain.com and tenant3.domain.com. My question is how can I make the redirect so that tenant1.domain.com will be redirected to an application hosted in an US datacenter, tenant2.domain.com to a datacenter in EU and tenant3.domain.com to a datacenter in Australia for example?
I will guess here I have to use Azure Traffic Manager and DNS? Can somebody point me to correct path?
One possibility would be to use Azure DNS (or any DNS with an API really) to setup the CNAME record for a tenant so that it points to the right datacenter.
You would then have to add that as a custom domain on the app if you run on App Service.
Though it does have a limit on the number of domains, max 500 according to: https://stackoverflow.com/a/31565429/1658906.
If you run on virtual machines, you can of course configure the server to accept traffic to *.domain.com.
Can't really do that with App Service, since you would only be able to map the wildcard record to one region.
You can't really use Traffic Manager in this case I think, since your tenant's data really is in one datacenter.
Unless you have replication to a secondary, in which case you could use a TM profile per region in Failover mode.

How to do load balancing / port forwarding on Azure?

I am evaluating the convenience of moving to azure. Currently, I am trying to figure out how to balance the load and make routing for different websites on the same machine. I saw tutorials where a user created a separate LB on a different VM. I also found many articles about the possibility to balance the load using Azure load balancing.
So I assume both are possible, is that correct?
I would like to know how to connect between machines on azure. Would it be possible to do so using a local ip, machinename, or dns?
I also need to figure out how to forward traffic to different ports based on http header, is that possible without a seperate machine as load balancer? I see the endpoint config in my azure dashboard and found the official documentation, but unfortunately it's not enough for my understanding.
Currently, I am trying to figure out how to balance the load and make
routing for different websites on the same machine.
You can have different web sites on the same machine by configuring virtual hosting on IIS. This is accomplished using host header. VM, Cloud Service or even Websites supports this functionality. VMs and Cloud Services should be pretty straight forward. Example using websites:
Hosting multiple domains under one Azure Website
http://blogs.msdn.com/b/cschotte/archive/2013/05/30/hosting-multiple-domains-under-one-azure.aspx
I also found many articles about the possibility to balance the load
using Azure load balancing.
LB for VMs are as easy as creating a load balance set inside endpoint configuration wizard. Once you create a balance set, for example, enpoint HTTP port 80, you can assign this balance set to any VM on the same cloud service. All requests to port 80 would be automatically balanced across all VMs in the set.
So I assume both are possible, is that correct?
Yes.
I would like to know how to connect between machines on azure. Would
it be possible to do so using a local ip, machinename, or dns?
You just have to create a virtual network and deploy the VMs to it. Websites (through preview portal only), Cloud Services and VMs supports VNet.
Virtual Network Overview
https://msdn.microsoft.com/library/azure/jj156007.aspx/
I also need to figure out how to forward traffic to different ports
based on http header, is that possible without a seperate machine as
load balancer?
Not at this moment. Best you can have with native Azure Services is a 3-tuple (Source IP, Destination IP, Protocol) load balance configuration.
Azure Load Balancer new distribution mode
http://azure.microsoft.com/blog/2014/10/30/azure-load-balancer-new-distribution-mode/
depending on how you're deploying there's a couple of options:
first of all: LB sets in VM's in a cloud service. For this the Cloud service acts as the LB. this can only be achieved when using a standard sku VM.
second of all in Azure WebApps : load balancing is achieved automagically when deploying through standard means, since scaling is foreseen here.
Third of all there's Cloud Services with roles, who also do this "automagically".
Now none of that seem to apply to your needs. you can also start thinking about using traffic manager, something with a little more bite :-)
have you read this article by any chance? http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-load-balance/
I'd like to advise you to add different endpoints to your VM's work with traffic manager and ake sure you IIS has all the headers on the correct ports (cause i'm assuming that's what you're doing already)

Ubuntu in Azure DNS Name Change

I was wondering if I could change the DNS name on one of our azure servers from ######.cloudapp.net to mail.flyboeingva.org?
If so, how would I go about doing this?
Yes you can!
follow the tutorial Configure a custom domain name for Azure cloud service. Further more, if you are going to host e-mail server on azure, you may also want to:
Reserve an IP Address for your cloud service (your VM runs in a cloud service, don't get confused by the terms)
Register Reverse DNS record (PTR) for your cloud service / custom domain

Azure Traffic Manager

Fast question is it possible to have Azure Traffic Manager
I would like to rent dedicated servers in 3rd party suppler and to load balancer from Azure
Question 1:
Can I setup this scenario? and use the load balancer from Azure?
Question 2:
Will I pay Outgoing bandwidth
Question 3:
Will you share for website with 10 000 000 page views per month how much you pay for DNS look ups as average.
Question 4 please suggest same service competitors... Google, Amazon, Rackspace I already know
The link you provided to the article already answers #1 and #3. Yes you can set this up. Billing is done by DNS lookup at $0.75 per million lookup, so your 10m page views will cost at most $7.50, but this isn't taking into consideration DNS caching which will drastically lower this (already very low) cost.
Question 2 is not an Azure Traffic Manager related question. No bandwidth goes through ATM so there is no charge. I am sure you will pay bandwidth charges with whatever 3rd party datacenter provider you are going to use.
I don't understand question 4. What do you want suggestions for? A cloud provider? There are lots of good ones but it depends on your scenario.
Azure Traffic Manager is a DNS routing system. It is similar to the routing features of AWS Route 53 (although Route 53 is a more full-featured DNS system).
Azure Traffic Manager uses DNS to point incoming traffic to different endpoints, which can be either within Azure or external urls. Because it uses DNS, it doesn't actually see any of the data itself, it just translates something like myapp.trafficmanager.net to 'webserver1.example.comorwebserver2.example.com` based on your rules and setup.
You can use round-robin, weighted or performance (which directs to the geographically closest address you have setup). You can further use Azure's DNS or another DNS system to use your own (sub)domain to CNAME to the trafficmanager.net domain name.
Load balancers like Azure Load Balancers and Amazon's Elastic Load Balancers are used to actually spread the traffic itself to different machines or services. Each work only with services hosted with the cloud provider so Azure Load Balancers can be used to load balance Azure VM's but not some servers you have hosted elsewhere.
Load balancers have bandwidth charges because they actually pass through the traffic. Azure Traffic Manager just has DNS query charges because that's all it does.
In your case, yes you can use Azure Traffic Manager to point to several external endpoints for your dedicated servers. You can also nest Traffic Manager profiles so that you can first use geo-location then round-robin. Azure Traffic Manager does support basic http/https monitoring to make sure the endpoint is still active.
Because it is based on DNS, there will always be a lag between changes with the TTL value and how clients cache DNS addresses. This is inherent with all DNS routing. To be extra safe, you can use Azure Traffic Manager to route to your datacenter and then run your own load balancing software locally to spread the load among servers.

Resources