Yesterday I took Amazon CloudFront for a spin. Creating the CloudFront distribution was pretty simple - the wizard process flowed nicely. I found myself relying on the help text in places, but the most surprising thing was how long it took for the distribution to become enabled. I didn't time it exactly, but I probably spent 45 minutes waiting for my new CloudFront distribution to change from "In Progress" to "Enabled" status.
The performance is a bit confusing. Compared to the S3 bucket, I didn't see any improvement in performance in a few tries - in fact, the CloudFront CDN performance was worse than the S3 bucket on its own for my 217 KB image file. I decided to take a larger sample, loading the same image 30 times in Chrome and noting the timing data from the "network" tab in the developer tools. I'm located in Brooklyn, have CloudFront configured for the US/Europe with download mode configured. My S3 bucket is in the US Standard zone, which is probably on the east coast. Here is what I found:
The first observation is that there's a lot of variance in the performance of my ISP. The second is that the mean response times are pretty similar, and the relative frequencies in my samples are nearly identical (sorry no graphic - need to find a good tool for generating graphs for the blog). So I can't see any meaningful difference between S3 and CloudFront for my ISP in Brooklyn. However, I tested only with a single modest image, so there might be a more notable difference for other file sizes.
Some interesting statistics about performance from other regions of the country suggest the locality of the user is an important factor. I would expect that users who are more rural or are located further from the eastern United States would notice better performance over CloudFront than using S3 buckets in the US Standard configuration. For those of us located in close network proximity to our S3 buckets, the level of optimization in S3 seemingly matches that of the CDN.
I did this test to decide where I want to serve static images from for my demo site. For now I think I'm going to leave the CloudFront CDN enabled. My traffic volume is low enough that the cost isn't a big factor and the performance is probably better this way for some potential visitors.
The performance is a bit confusing. Compared to the S3 bucket, I didn't see any improvement in performance in a few tries - in fact, the CloudFront CDN performance was worse than the S3 bucket on its own for my 217 KB image file. I decided to take a larger sample, loading the same image 30 times in Chrome and noting the timing data from the "network" tab in the developer tools. I'm located in Brooklyn, have CloudFront configured for the US/Europe with download mode configured. My S3 bucket is in the US Standard zone, which is probably on the east coast. Here is what I found:
CloudFront | S3 | |
---|---|---|
Mean | 343 ms | 305 ms |
Std Dev | 230 ms | 170 ms |
Some interesting statistics about performance from other regions of the country suggest the locality of the user is an important factor. I would expect that users who are more rural or are located further from the eastern United States would notice better performance over CloudFront than using S3 buckets in the US Standard configuration. For those of us located in close network proximity to our S3 buckets, the level of optimization in S3 seemingly matches that of the CDN.
I did this test to decide where I want to serve static images from for my demo site. For now I think I'm going to leave the CloudFront CDN enabled. My traffic volume is low enough that the cost isn't a big factor and the performance is probably better this way for some potential visitors.
Comments
Post a Comment