Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reduce latency between my AWS EC2 instance and another AWS customer's REST API

I have a need to reduce the latency for my application to reach a vendor's API. Currently my EC2 instance resides in the same region and availability zone as the vendor and I am using EC2 instances with the best network performance.

Is there anything else within my control that I can do to reduce the latency between my application and the vendor's API?

If I had the vendor's cooperation, could anything be done to further reduce the latency?

like image 522
Daniel Avatar asked Nov 03 '25 10:11

Daniel


1 Answers

Ways to reduce latency:

  • Connect to resources in the same region: You are doing this
  • Connect to resources in the same Availability Zone: While you say that you are doing this, it might not be so simple. Each AWS account has a random naming of AZs, so you might not actually be in the same AZ.
  • Connect via VPC Peering: This bypasses the Internet Gateway and the mapping of Public IP addresses. The vendor would need to invite you to join and you would accept the peering request (or vice versa).

Or, the new modern option:

  • Connect via AWS PrivateLink, which exposes an Elastic Network Interface (ENI) within your VPC that directly connects to a Network Load Balancer in the vendor's VPC.

Any further optimization would require more information about the work being performed and the current architecture. For example, a queue might be more efficient than sending direct messages, or perhaps the use of streaming data might be more appropriate, depending upon the type of data being sent. (Feel free to Edit your question with more details if you want a more accurate answer.)

like image 185
John Rotenstein Avatar answered Nov 06 '25 03:11

John Rotenstein