DevOps Zone is brought to you in partnership with:

Chen is a Co-Founter at Takipi and among other things, responsible for the company's cloud architecture and stack discovery. Chen has posted 21 posts at DZone. You can read more from them at their website. View Full User Profile

The AWS Olypmics: Speed Testing Amazon EC2 And S3 Across Regions

03.20.2013
| 4358 views |
  • submit to reddit
So many of the web services we build and use today store and deliver their data using AWS S3. When we first began designing Takipi, we decided to test the upload/download speed between different AWS regions to get a feel for the differences in speed when transmitting data between EC2 and S3 buckets in different regions. We were particularly interested in the penalty physical distance has on performance.


We set up a test using EC2 instances and S3 buckets in all Amazon AWS regions currently available - three in the U.S (Oregon/California/Virginia), one in South America (Brazil), one in Europe (Ireland), two in Asia (Singapore/Japan) and one in Australia.



We also wanted to check how much benefit we would get from uploading data from an EC2 instance to an S3 bucket in the same region.Below are the results of the first run we did in January 2012 when we just began developing and the current results from March 2013. A fun thing we did around this test was have everyone at the office write down their guesses. Tal won in January and I won this time around (no cheating -- promise!).
The ResultsIn the following charts you can see our average results for the 10MB upload test (numbers are seconds).Mar 2013
 VirginiaCaliforniaOregonIrelandSingaporeJapanAustraliaBrazil
Virginia2.62811.7434.025.06815.94711.20428.44610.141
California4.6111.0611.1429.40913.0245.6967.1218.831
Oregon4.3763.2630.6845.42911.825.93811.9549.891
Ireland5.29118.3778.4160.75517.02512.85214.212.769
Singapore14.6226.2449.34540.3170.8514.3976.00719.763
Japan9.9189.6297.07811.9097.7111.0519.26314.575
Australia12.52817.9899.973182.011183.68240.7170.812216.164
Brazil7.48228.1339.58115.41523.81914.04310.3960.789



Highlights (the good, the bad and the ugly) 

- As expected, the best upload time was achieved when the EC2 instance and S3 bucket shared the same location.

- When an EC2 instance and S3 bucket were in the same location, the fastest upload time was achieved in Oregon and the slowest in Virginia.

- California’s combined upload time was the best.

- Singapore’s combined upload time was the worst.

- The slowest upload speed was when uploading from Australia to Brazil.

- Uploading from Singapore to Ireland was 4X slower times than from Japan to Ireland.


Jan 2012


 VirginiaCaliforniaOregonIrelandSingaporeJapanBrazil
Virgina0.5892.6885.642.8418.8787.3625.08
California5.9750.6641.1484.3839.5695.97327.428
Oregon6.4241.2620.4944.2989.1945.6737.349
Ireland6.7128.3796.8260.58343.80548.18516.826
Singapore5.4612.6473.5037.0680.1361.22912.005
Japan11.5244.4035.618.7065.40.55111.801
Brazil5.9794.925.9887.34323.76810.8410.584
chart_1 (2)

What has changed since 2012?

- Singapore’s combined up-speeds were the best -- a surprising finding!

- Europe’s combined upload time was the slowest.

- When EC2 instance and S3 buckets were in the same location, the best upload time was achieved in Singapore and the slowest in California.

- California struggled much more with traffic to Brazil than the other U.S regions.

- The slowest upload speed was between Ireland to Japan.


The Code

The Java code used for the test is available on GitHub: https://github.com/takipi/aws-s3-speed. Fork, clone, review or simply run the experiment yourself. Let us know if you experienced different results.

Takipi is cross-platform and is written in Java and C++. We first tested some C++ vs. Java networking. We ended up dropping the C++ communication modules altogether and went on implementing our HTTP communication only in Java. Some of the reasons for dropping C++ were cross-platform issues, ease of debugging, reconnection/timeout handling and security.

Diving into Java, we had two approaches we had to choose from. The first was using the open source AWS Java SDK to deal with everything (it uses Apache HTTP components internally). The second was signing URLs and uploading them using plain old Java HTTP(S) URLConnection. We soon found that the different methods didn’t have a significant effect on the results, so for the rest of the experiment and post we’ll be talking about the SDK code. Mark Rasmussen has a great post about pushing S3 upload speeds to the maximum.

The code creates/deletes buckets in all regions (using prefixes). Once the buckets are set, the test code uploads a few chunks (10MB, 100MB, etc..) to all regions over several rounds and averages the time it took from the initial call to the end.

The code shuffles the regions at each round, and never sends chunks concurrently. We went for a dozen rounds, removing best and worst scores before averaging. This left us with 10 valid scores to average, which seems to us like a fair number.


Conclusion

- Europe’s was pretty slow last year. This year it showed the same speeds as the U.S which is a good thing for both users and developers.

- We’ve learned that the newest region, Sydney, Australia, still has a lot of catching up to do.

- We’ve confirmed our original assumption that staying inside a region is hands down the best way to guarantee maximum performance.

Let me know if you run the test and experience different results or have any questions, I’ll be happy to hear your feedback.

P.s. Takipi has a new Twitter account, follow us - @takipid

Originally appeared on Takipi's blog 

Published at DZone with permission of its author, Chen Harel.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)