Skip to content

Improve latency when accessing remote endpoints via EC2 instance

0

Hello,

We are using an EC2 instance(IntsanceID: i-00d502bf2cb8d806b) We are accessing endpoints via ws from this instance to Asia, Europe locations. We are facing high latency when accessing Asian servers(normal) Is there any option to improve this latency without moving the instance to another AWS location?

asked a year ago157 views

2 Answers
0

There are several options to improve latency when accessing remote endpoints from your EC2 instance without relocating it:

  1. Use AWS Global Accelerator: This service can improve performance for applications by up to 60% by providing users with an optimal path to your workload through the AWS global network. It establishes TCP connections at edge locations closest to clients, reducing initial connection setup time.

  2. Enable busy poll mode: For Linux-based EC2 instances, you can enable busy poll mode in the Linux kernel configuration to reduce latency. This allows the system to actively check for incoming packets rather than waiting for interrupts.

  3. Configure CPU power states: Adjusting CPU power states can help reduce latency by ensuring your processor is running at optimal performance levels when needed.

  4. Optimize interrupt moderation: Dynamic interrupt moderation can be configured using ethtool commands to balance between reducing CPU overhead and minimizing latency.

  5. Implement placement groups: If you have multiple EC2 instances that need to communicate with each other, using a cluster placement group can decrease network latency between them. This won't directly affect external endpoints but can improve overall application performance.

  6. Use Elastic Network Adapter (ENA): Ensure your instance is using ENA with supported instance types to enable participation in a low-latency, reduced jitter 25 Gbps network.

  7. Edge caching solutions: Implement caching solutions like Amazon CloudFront for frequently accessed content to reduce the need for repeated long-distance data transfers.

  8. Lambda@Edge or CloudFront Functions: For certain workloads, you can run code closer to users with these services to reduce latency.

Before implementing any changes, thoroughly test and monitor your network performance to ensure you're getting the desired results, as the effectiveness of these solutions may vary depending on your specific use case and network hardware.
Sources
Improve network latency for Linux based EC2 instances - Amazon Elastic Compute Cloud
PERF04-BP06 Choose your workload's location based on network requirements - AWS Well-Architected Framework
PERF04-BP06 Choose your workload's location based on network requirements - AWS Well-Architected Framework

answered a year ago

0

In your question, "endpoints" is vague. Are they AWS service endpoints in other regions? Or endpoints for third party applications hosted in AWS? Or endpoints outside of AWS?

In most cases there is no beating the speed of light so moving the instance or creating an instance closer to the endpoint is the right answer.

If you own the endpoint(s) then using things like Global Accelerator can help but it will not eliminate the majority of the delay because of physics.

EXPERT

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.