High latency issue for web service call from amazon aws ec2 to local server

amazon ec2amazon-web-serviceslatencyweb services

We have a legacy web application that is running in our data center on premises located in Houston. We have a developed a new .net 4 based web application in order to provide new features to customers. The new web application is hosted in amazon aws ec2 environment (N. Virginia region us-east-1b zone).

In order to get seamlessly integrate with the legacy application the new web application makes web service calls to retrieve data. We are seeing an unusually high latency time in the order of 5+ seconds for these web service calls. The exact same web service call returns in less than a second on our local PCs (which makes sense given physical proximity to the actual server). The weird part is that we have developers in California who also have the same milliseconds response time. We are testing the web service response using third party tools such as SoapUI, Google Chrome extensions such as Advanced REST Client, Postman REST Client, etc.

As if this wasnt weird enough, we have noticed the same low latency from certain other ec2 instances while testing which are in the same region and availability zone as well. If we experienced the high latency consistently from all the ec2 instances I could understand. But there is something else going on.

Comparing the various stats and results between the low latency and high latency ec2 servers do not show any significant differences: ping (constant 40ms), tracert, winmtr, etc.

We have instances that are in the VPC as well. So I tried both the public and private IP address of the web service host server and that didnt make a difference either for the above results.

We need to resolve this latency issue as this is causing the resulting web pages to load very slowly (almost 15+ seconds which is simply unacceptable).

The ec2 instances have Windows Server Datacenter 64 bit. Let me know if there is any other infor I can provide to help diagnose this.

Best Answer

First, this sounds like something you will have to troubleshoot with Amazon. A simple tracert to your destination host will show you where the delay is.

Second, you should design your application to load the page and then display the data whenever it becomes available, not simply expect it to show up. It sounds to me like you have not utilized any AJAX failover in your application. How can you be sure that your new application will ALWAYS have a connection back to your legacy app.

TL;DR: Run a tracert, call Amazon, check your code, make sure it allows for delays and no internet connection scenarios.

Related Topic