0

I have an EC2 instance that runs an application which connects and listens to a third party WebSocket server (also deployed on AWS, using EC2 instances and Elastic Load Balancing to the best of my knowledge). My EC2 instance also runs a separate application which connects and sends request to a third party REST server (also deployed on AWS, using CloudFront and Lambda to the best of my knowledge).

Minimizing latency is of utmost important to me, so I want to know how much additional latency I would incur by using an Elastic IP with my EC2 instance instead of a public IP (which is the default I believe). Are we dealing with nanoseconds, microseconds, or milliseconds here? Would love the input of someone familiar with this. Thanks!

galpo
  • 27
  • 5
  • Question is unclear - what other options do you have than using an elastic IP? With a public IP that changes every time the server starts I'm going to _guess_ no difference in latency. Compared with a private IP and a NAT gateway, there's going to be a bit more latency, but you'd have to test it to work it out. If you really want low latency set up a VPC peering connection directly to the target server VPC. Maybe you should just ask what you actually mean "How do I minimise latency when calling from my EC2 instance to an external website also hosted on AWS?". – Tim Dec 10 '20 at 08:49
  • Yes, I am comparing an elastic IP to a public IP (that changes every time the EC2 instance restarts), which I believe is the default option. I'm not familiar with the details of how the elastic IP works, which is why I'm asking the question. Like I wonder if my EC2 instance is in zone 1a, and the elastic IP is in zone 1c, and the third party server is in zone 1a, will there be extra hops from 1a -> 1c -> 1a – galpo Dec 10 '20 at 08:54
  • Suggest you do some reading on how EC2 networking works. Your elastic IP is attached to your instance replacing the public IP. The instance and all associated networking components are all in the same AZ. So my answer, never having tested it but understanding AWS fairly well, is no difference. – Tim Dec 10 '20 at 08:57
  • I see. So there is zero relationship between an IP address and the AZ? And, consequently, given some random IP address that is known to be of an EC2 instance, there is no way to determine the AZ of this EC2 instance? – galpo Dec 10 '20 at 09:08
  • My understanding is IP address is unrelated to AZ. There may be an underlying pool per AZ, but it's irrelevant and particularly irrelevant to latency. I can't see any way the things you're talking about are related. – Tim Dec 11 '20 at 09:33

1 Answers1

2

Since the elastic IP simply replaces the public IP I believe there will be no difference in networking performance (latency / bandwidth) between a public and elastic IP.

The Elastic IP simply replaces the public IP that's associated with your instance. This is all in the same availability zone.

Tim
  • 31,888
  • 7
  • 52
  • 78