speedtest的原理_speedtest原理图解-程序员宅基地

技术标签: speedtest  

Speedtest.net operates entirely over HTTP for maximum compatibility. It tests ping (latency), download speed and upload speed.

(speedtest是承载在HTTP协议之上的,包括ping测试,下载测试和上传测试)

Ping

  1. This test sends HTTP requests to the selected server, and measures the time it takes to get a response. (选择好server后,发送HTTP请求server,根据返回响应的时间来计算ping时间)

Download Speed

  1. Your computer downloads small binary files from the web server to the client, and we measure that download to estimate the connection speed.
  2. Based off this result, we choose how much data to download for the real test. Our goal is to pick the right amount of data that you can download in 10 seconds, ensuring we get enough for an accurate result but not take too long.(下载测试只持续10s钟)
  3. We prevent caches from throwing off results by appending random strings to each download.(每次测试前都会清楚一下cache,避免假测)
  4. Once we start downloading, we use up to four HTTP threads to saturate your connection and get an accurate measurement.(启动4个HTTP线程来进行测试)
  5. Throughput samples are received at up to 30 times per second.(每秒采样30次)
  6. These samples are then aggregated into 20 slices (each being 5% of the samples).(每个采样分成20片)
  7. The fastest 10% and slowest 30% of the slices are then discarded. We'll explain that more below.(最快的10%和最慢的30%分片去掉)
  8. The remaining slices are averaged together to determine the final result.(结果是剩余分片的平均)

Since we are measuring data transported over HTTP (via Flash), there are the following factors that can affect speed: potential protocol overhead, buffering due to the many layers between our application and the raw data transfer, and throughput bursting due primarily to CPU usage. These factors lead us to drop the top 10% and bottom 10% of our slices as outliers.(考虑到一些外在的因素影响,因此把最快的和最慢的部分去掉)

Additionally, we keep the default test length short for user experience. Because the test is shorter, the ramp-up period can take a significant part of the beginning of the test, leading us to drop another 20% of the bottom result slices.

Upload Test

  1. A small amount of random data is generated in the client and sent to the web server to estimate the connection speed.(上次随机生成的数据到服务器)
  2. Based on this result, and appropriately sized chunck of randomly generated data is selected for upload.(选择合适的生成数据进行上传)
  3. The upload test is then performed in chunks of uniform size, pushed to the server-side script via POST.
  4. We'll use up to four HTTP threads here as well to saturate the connection.(使用4个HTTP线程进行上传测试)
  5. Chunks are sorted by speed, and the fastest half is averaged to eliminate anomalies and determine the result.

Deciding the number of threads

Speedtest.net will use up to four http threads during the download and upload portions of the test. However, it will only use more than two threads if they are needed to accurately measure the speed, so as to minimize the effect of HTTP overhead on lower-speed connections. After the pre-test, if the connection speed is at least 4 megabits per second, then Speedtest.net will use four threads. Otherwise, it will default to two threads.(只有预测试超过4Mbps,才会使用4线程;否则使用2线程)

However, there is a hurdle on older browsers: on Internet Explorer 7 and earlier (as well as Firefox 2 and earlier), the browser strictly adheres to the HTTP specification of only two threads per hostname. So for those older browsers, in order to scale up to four threads we must open the third and fourth thread to a secondary URL provided by the host that points to the same server. This way, we can work around the limitations of those older browsers and still measure higher-speed connections accurately. Most of our hosts do have a working secondary URL, but if you're testing from an older browser to a host that doesn't, Speedtest.net will be limited to two threads at maximum. This is one reason why we recommend that all visitors use up-to-date browsers.(在老的浏览器上怎样来操作使用4线程测速)

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u011208220/article/details/38376343

智能推荐

在Google使用Borg进行大规模集群的管理 7-8-程序员宅基地

文章浏览阅读606次。为什么80%的码农都做不了架构师?>>> ..._google trace batch job

python加密字符串小写字母循环后错两位_python学习:实现将字符串进行加密-程序员宅基地

文章浏览阅读2.6k次,点赞3次,收藏3次。'''题目描述1、对输入的字符串进行加解密,并输出。2加密方法为:当内容是英文字母时则用该英文字母的后一个字母替换,同时字母变换大小写,如字母a时则替换为B;字母Z时则替换为a;当内容是数字时则把该数字加1,如0替换1,1替换2,9替换0;其他字符不做变化。s'''#-*-coding:utf-8-*-importre#判断是否是字母defisLetter(letter):iflen..._编写函数fun2实现字符串加密,加密规则为:如果是字母,将其进行大小写转换;如果

【Java容器源码】集合应用总结:迭代器&批量操作&线程安全问题_迭代器是否可以保证容器删除和修改安全操作-程序员宅基地

文章浏览阅读4.4k次,点赞6次,收藏8次。下面列出了所有集合的类图:每个接口做的事情非常明确,比如 Serializable,只负责序列化,Cloneable 只负责拷贝,Map 只负责定义 Map 的接口,整个图看起来虽然接口众多,但职责都很清晰;复杂功能通过接口的继承来实现,比如 ArrayList 通过实现了 Serializable、Cloneable、RandomAccess、AbstractList、List 等接口,从而拥有了序列化、拷贝、对数组各种操作定义等各种功能;上述类图只能看见继承的关系,组合的关系还看不出来,比如说_迭代器是否可以保证容器删除和修改安全操作

养老金融:编织中国老龄社会的金色安全网

在科技金融、绿色金融、普惠金融、养老金融、数字金融这“五篇大文章”中,养老金融以其独特的社会价值和深远影响,占据着不可或缺的地位。通过政策引导与市场机制的双重驱动,激发金融机构创新养老服务产品,如推出更多针对不同年龄层、风险偏好的个性化养老金融产品,不仅能提高金融服务的可获得性,还能增强民众对养老规划的主动参与度,从而逐步建立起适应中国国情、满足人民期待的养老金融服务体系。在人口老龄化的全球趋势下,中国养老金融的发展不仅仅是经济议题,更关乎社会的稳定与进步。养老金融:民生之需,国计之重。

iOS 创建开源库时如何使用图片和xib资源

在需要使用图片的地方使用下面的代码,注意xib可以直接设置图片。将相应的图片资源文件放到bundle文件中。

R语言学习笔记9_多元统计分析介绍_r语言多元统计分析-程序员宅基地

文章浏览阅读3.6k次,点赞4次,收藏66次。目录九、多元统计分析介绍九、多元统计分析介绍_r语言多元统计分析

随便推点

基于psk和dpsk的matlab仿真,MATLAB课程设计-基于PSK和DPSK的matlab仿真-程序员宅基地

文章浏览阅读623次。MATLAB课程设计-基于PSK和DPSK的matlab仿真 (41页) 本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦!9.90 积分武汉理工大学MATLAB课程设计.目录摘要 1Abstract 21.设计目的与要求 32.方案的选择 42.1调制部分 42.2解调部分 43.单元电路原理和设计 63.1PCM编码原理及设计 63.1.1PCM编码原理 ..._通信原理课程设计(基于matlab的psk,dpsk仿真)(五篇模版)

腾讯微搭小程序获取微信用户信息_微搭 用微信号登录-程序员宅基地

文章浏览阅读3.5k次,点赞6次,收藏28次。腾讯微搭小程序获取微信用户信息无论你对低代码开发的爱与恨, 微信生态的强大毋庸置疑. 因此熟悉微搭技术还是很有必要的! 在大多数应用中, 都需要获取和跟踪用户信息. 本文就微搭中如何获取和存储用户信息进行详细演示, 因为用户信息的获取和存储是应用的基础.一. 微搭每个微搭平台都宣称使用微搭平台可以简单拖拽即可生成一个应用, 这种说法我认为是"夸大其词". 其实微搭优点大致来说, 前端定义了很多组件, 为开发人员封装组件节省了大量的时间,这是其一; 其二对后端开发来说, 省去了服务器的部署(并没有省去后_微搭 用微信号登录

sql中索引的使用分析

sql中索引的使用分析

termux安装metasploit()-程序员宅基地

文章浏览阅读8.9k次,点赞16次,收藏108次。因为呢,termux作者,不希望让termux变成脚本小子的黑客工具,于是把msf , sqlmap等包删了。至于如何安装metasploit呢。apt update -y && apt upgrade -y #更新升级更新升级之后要安装一个叫 git 的安装包apt install git -y然后我们就开始//这里的话建议把手机放到路由器旁边,保持网络的优良。或者科学上网。//git clone https://github.com/gushmazuko/metaspl_termux安装metasploit

armbian docker Chrome_一起学docker06-docker网络-程序员宅基地

文章浏览阅读141次。一、Docker支持4种网络模式Bridge(默认)--network默认网络,Docker启动后创建一个docker0网桥,默认创建的容器也是添加到这个网桥中;IP地址段是172.17.0.1/16 独立名称空间 docker0桥,虚拟网桥的工作方式和物理交换机类似,这样主机上的所有容器就通过交换机连在了一个二层网络中。host容器不会获得一个独立的network namespace,而是与宿主..._armbian 172.17.0.1

Ansible-Tower安装破解

Ansible-Tower安装破解。

推荐文章

热门文章

相关标签