Azure WebApp Performance Tip

Introduction 

 
Unoptimized images, Javascript Issues, too much flash content, excessive HTTP requests, not making use of caching techniques, unclean code, not using gZip compression, too many ads, not using a CDN Service, bad hosting...
 
Apart from the above top 10 reasons a website can be slow, there is another reason, "Bad Hosting Configuration", that is most of the time the issue behind all.
 

How does this happen?

 
Most of the time under the pressure of timelines of the project, developers create resources haphazardly and do not cater to the guidelines properly. Sometimes prototypes become projects, and they use the same set of resources they used while demoing.
 

Effect on Projects?

 
Simple, delays happen. To analyze the bad configurations, sometimes the blame is on developers that they have written code that is not performing. While the problem lies in the infrastructure itself. Developers spend a lot of time analyzing database queries, image optimizations, and code optimizations, but sometimes it's of no use.
 

What to do then?

 
Let's look at a scenario. Say there is a project that is using MS Azure Web APP Service and MSSql Database to store data. When both resources were created on Azure, they created the app service on South East Asia and a database in South Central US.
 
When the end-user makes a request, the request goes to the southeast Asia server, which then routes to the south-central US server to get back data. It will then route back to South East Asia Server and then to the end-user. Long trip it is, yeah.
 
The first thing to consider is that all resources for the same project are in the same Azure region.
 
Some people suggest Geo-replication, Load balancing, and stuff. But why to add extra cost when the beast can be tamed at less cost.
 
Geo-Replication and Load balancing are for scenarios when the traffic load exceeds your server limitation. Not every scenario fits these.
 
Another thing to consider is if you prefer to keep the resources in the same subscription as well for manageability and prevent unseen DNS routing under the hood.
 
This above tip is golden and if your configurations are incorrect, this can increase your website performance triple-fold.