0

I have a client sever located in AWS and I want to reduce latency between his machine and my EC2 instance. I rented two same servers in one availability zone and started sending requests to client`s API. It turned out that these servers have different latencies: 95-th percentiles were different for about 5 milliseconds (that is about 30% from mean latency). And my aim is to reduce latency.

I think that I can rent more servers and repeat these experiment, but it will be the next step of my investigation. The first step for me is to understand the reasons why servers in the same zone have so big difference in API response latency and which metrics can be useful to explain it?

The second way to reduce latency is to rent bare metal server instead of EC2, but it seems to be too expensive. And I am afraid that renting this server make even worse if it stand further from client server.

So, tell me please:

  1. Do you have any advice how to reduce latency?
  2. How can I rent closest server to my client in the same AWS zone?

2 Answers 2

0

Even when launching in the same AZ, your EC2 instances may be in different data centers. It will be a crap shoot to get them together by trial and error.

Take a look at "Placement Groups". They are used when launching multiple EC2 instances to get them to launch in the same data centres, reducing latency between them.

If you have an existing EC2 instance that is not in a placement group, I don't think it will be possible to add it to a placement group.

1
  • Than you, I will continue renting servers and measuring latencies Dec 9, 2020 at 10:58
0

You can start by making sure your instances are in the same physical AZ, which doesn't always mean the same building. In Resource Access Manager (RAM) there's a mapping of your logical AZ ID to the physical AZ ID. This is randomised between accounts - AZ-A in your account may be AZ-C in another account. This is because most people put most resources in AZ-A, so it balances things out.

Beyond that I don't think you can do much other than trial and error to get an instance that has low latency to your client machine. I'm pretty sure Placement groups as mentioned above are for inside a single account, so if you need ultra-low latency (5ms isn't bad) you might have to be in the same account.

AZ Mapping

1
  • Oh, thank you, I`ll check my AZ Dec 9, 2020 at 11:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .