The SamKnows Cloudflare Platform

Guest Author
11 min readadvanced
--
View Original

Overview

The article discusses the collaboration between SamKnows and Cloudflare to enhance internet performance measurement through the use of Cloudflare Workers. It details the implementation of a measurement server using Cloudflare's infrastructure, the benefits of this approach, and the results of performance testing in various regions.

What You'll Learn

1

How to implement a measurement server using Cloudflare Workers

2

Why using Cloudflare Workers can improve measurement infrastructure

3

When to consider using Cloudflare for internet performance testing

Prerequisites & Requirements

  • Understanding of internet performance metrics like speed, latency, and packet loss
  • Familiarity with Cloudflare Workers and JavaScript(optional)

Key Questions Answered

How does Cloudflare Workers enhance SamKnows' measurement capabilities?
Cloudflare Workers allows SamKnows to run measurement scripts at 165 global locations, improving the ability to measure internet performance in various regions. This infrastructure enables quick deployment and scalability, aligning with SamKnows' needs for reliable testing servers.
What measurements can be performed using Cloudflare Workers?
The measurements supported by Cloudflare Workers include TCP download and upload speed tests, round-trip latency, and packet loss, all conducted over HTTP traffic. UDP measurements are not supported due to the limitations of the W3C Service Workers standard.
What were the results of performance testing between Cloudflare and existing servers?
Performance testing showed an average difference of 0.1% in measured speed between Cloudflare and existing servers. However, there were instances of significant performance variability, particularly in regions like Germany and Singapore, highlighting the impact of routing and peering arrangements.

Key Statistics & Figures

Average difference in measured speed
0.1%
This was observed when comparing Cloudflare to existing measurement servers.
Number of Cloudflare data centers
165
Cloudflare has a widespread network that enhances measurement capabilities.
Maximum link saturation achieved
10Gbps
Demonstrated during initial testing of the Workers script.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Backend
Cloudflare Workers
Used to implement the measurement server for internet performance testing.
Programming Language
Javascript
Required for rewriting the server-side software to run on Cloudflare Workers.

Key Actionable Insights

1
Consider leveraging Cloudflare Workers for scalable measurement infrastructure.
This approach allows for rapid deployment of measurement servers in new locations, enhancing the ability to assess internet performance globally.
2
Regularly evaluate the performance of your measurement servers against various ISPs.
Understanding the performance differences can help identify optimal routing paths and improve overall measurement accuracy.
3
Utilize the capabilities of Cloudflare Workers to generate random content for speed tests.
This practice helps avoid issues with middleboxes that may compress data, ensuring more accurate measurement results.

Common Pitfalls

1
Failing to account for the limitations of Cloudflare Workers, such as CPU time and memory constraints.
These limitations can affect the performance of measurement scripts, so developers should optimize their code to fit within these constraints.
2
Not considering the impact of routing and peering on measurement accuracy.
Performance can vary significantly based on the ISP and routing paths, which can lead to misleading results if not properly analyzed.

Related Concepts

Internet Performance Metrics
Cloudflare Infrastructure
Javascript Programming For Serverless Environments