Overview
The article discusses the performance advantages of Cloudflare R2 over Amazon S3, particularly in terms of response times for serving media content. It highlights the importance of storage performance for user experience and presents benchmarking results that demonstrate R2's superior speed in various regions.
What You'll Learn
1
How to measure storage performance using 95th percentile response tests
2
Why Cloudflare R2 is faster than Amazon S3 for media content delivery
3
How to utilize Cloudflare R2 for improved application performance
Key Questions Answered
How does Cloudflare R2 compare to Amazon S3 in performance?
Cloudflare R2 is on average 20-40% faster than Amazon S3 when serving media content via public access. In specific tests, R2 showed a 38% faster response time than S3 in North America, with a 95th percentile response time of 1,262 ms compared to S3's 2,055 ms.
What factors contribute to the performance of Cloudflare R2?
The performance of Cloudflare R2 is attributed to its proximity to users and highly optimized HTTP stacks, resulting in faster TCP connect and SSL handshake times. For instance, R2's 95th percentile connect time is 32 ms compared to S3's 78 ms.
What methodology was used to benchmark R2 and S3?
The benchmarking involved over 400 Catchpoint backbone nodes retrieving a 1 MB file from R2 and S3 every 30 minutes for four days, ensuring that caching was disabled to measure true performance.
How does R2 perform in cross-region access compared to S3?
Cloudflare R2 outperforms Amazon S3 in cross-region access as well, with R2 providing a 95th percentile response time of 3,224 ms for users outside the US accessing content in Ashburn, compared to S3's 6,387 ms.
Key Statistics & Figures
Cloudflare R2 95th percentile response time
1,262 ms
Measured in North America for users retrieving content from a bucket in Ashburn, VA.
Amazon S3 95th percentile response time
2,055 ms
Measured in North America for users retrieving content from a bucket in Ashburn, VA.
R2 faster than S3 in North America
38%
In terms of response time for uncached raw file delivery.
Cloudflare R2 connect time
32 ms
95th percentile connect time in North America.
Amazon S3 connect time
78 ms
95th percentile connect time in North America.
Technologies & Tools
Storage
Cloudflare R2
Used for serving media content and optimizing application performance.
Storage
Amazon S3
Compared against Cloudflare R2 in terms of performance metrics.
Key Actionable Insights
1Utilize Cloudflare R2 for media content delivery to enhance user experience.Given R2's superior performance metrics, especially in terms of response times, using it can significantly improve application responsiveness, particularly for users accessing content from various geographical locations.
2Implement performance testing methodologies to evaluate storage solutions.By adopting rigorous benchmarking practices like the 95th percentile response tests, developers can make informed decisions about which storage solutions best meet their performance needs.
3Leverage Cloudflare's global infrastructure for optimized content delivery.R2's design allows for data to be stored closer to users, which can drastically reduce latency and improve load times, making it a strategic choice for global applications.
Common Pitfalls
1
Neglecting the impact of storage performance on user experience.
Many developers may overlook how slow storage can affect overall application responsiveness. It's crucial to recognize that even a single slow API call can degrade the user experience significantly.