user7091765
user7091765

Reputation:

Why is CloudFront slower than the original server?

Hello Stack Overflow Users.

I did a speed test on CloudFront.

The environment is as follows.

S3 bucket (Tokyo): CloudFront unused 28MB

S3 bucket (Tokyo): cloudfront use 28MB

File receive command input

S3: wget -S -v S3 file url

CloudFront: wget -S -v cloudfront / file url

(We did each twice for accuracy.)

It is the average value of 2 times.

Tokyo
CloudFront not used: 1.7 seconds
Using CloudFront: 1.7 seconds

Sydney Region
CloudFront not used: 2.8 seconds
Using CloudFront: 3.0 seconds

California Area
Unused CloudFront: 30 seconds
Using CloudFront: 16 seconds

Frankfurt Area
Unused CloudFront: 65 seconds
Using CloudFront: 75 seconds

I think it would be faster to use CloudFront as a result of the California region.

But why are the Sydney and Frankfurt areas slower?

Are you having trouble with my test?

Upvotes: 0

Views: 2552

Answers (1)

tomfa
tomfa

Reputation: 275

As @michael-sqlbot points out, a Miss from cloudfront should not be faster (but actually somewhat slower) than going towards S3 directly. Even when you get Hit from CloudFront CloudFront is not itself faster than S3 when served from the same location. Usually, the differences are marginal, and can be in the favor of S3.

The perks of using CloudFront when used in front of S3 are:

  • Having a cache on several physical locations, instead of one (i.e. better latency for other parts of the world, but not the one where S3 resides)
  • Custom HTTPS certificates (i.e. serving from https://example.com)
  • Better logging tools/stats/reports
  • Customer error pages
  • Automatic gzipping of content ++

Upvotes: 1

Related Questions