简体   繁体   中英

How to use the minimum latency in Amazon EC2 around the globe?

We have few websites that are going to store and serve up a decent amount of data and MySQL queries in EC2 to a global audience where latency should be minimized.

I am currently in Europe, so the websites latency are around 80ms, as the instance region is in Europe/Ireland.

But when I load the website from USA, the latency increases to 300ms, I wonder, how we can set up a system in Amazon that will load the website with the fastest way possible but around the world? I am not talking about images or files, I am talking about a complete website.

Thanks

A few rules of thumb:

  • Keep your database as close as possible to your application (same region)
  • Offload as much as possible from your application/web servers by serving static data via Amazon S3 and/or Amazon CloudFront (eg images, style sheets, javascript includes)
  • If speed is critical, cache data where possible to reduce database queries (eg use ElasticCache, or similar, in front of a database)

Most of the time taken to render a web page isn't the response time to receive the HTML page from the web server, it's normally the additional files used to populate the page, such as images, style sheets and scripts.

Therefore, you could then run the application out of one region. Speeding up the other content through CloudFront will provide a much faster experience for the user, since that content will be served closer to the user.

Once you have that operational, spend some time measuring what is taking time to serve the website. Identify what is taking the longest time, then concentrate on reducing that element.

This will be much easier than going multi-region immediately, which would involve a lot of technical overhead for possibly little gain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM