Throughput 吞吐量 和 latency 延迟

 

一句话

吞吐量是系统单位时间内响应(处理/接收)的任务(消息/用户)数(量),latency是系统响应单个任务所需要的时间,即平均响应时间。

对系统而言,希望吞吐量最大最好。对单个任务而言,希望响应速度越快越好 - 为了较好的用户体验,系统需要保证最坏响应时间,而不是平均响应时间。

比喻和例子

服务窗口的比喻

单个服务窗口,响应速度是1person/1s。如果同时有8个服务窗口对外服务,则该办公厅的吞吐量是8 person/s

 

交通灯的比喻

为了保证

 

卫星电话

卫星通信有很大的带宽(吞吐量),但卫星电话的响应时间很慢。

 

电信宽带

2M, 4M, 8M 带宽意味着什么?上网速度翻倍?

回答是NO

 

如果要想sina网页访问速度翻倍,需要sina:提高sina服务器响应速度(比如减少网页size),减少网络路由(比如使用使用CDN),这样会导致sina页面访问速度加快。

 

那为什么宽带业务比以前的电话拨号上网感觉快很多?

一是基本上所有的网站都提速了,二是偶猜测因为带宽的限制(与网络有关?),电信model对每个用户的上网速度作了限制(receive window 的限制?).

We start by introducing two important measures that we use to compare the performance of

protocols. Consider a system (like a network) where jobs (like messages) arrive, and after completion

leave the network. Throughput roughly measures the number of jobs completed per second. Latency

measures the time (worst-case or average, we will typically consider worst-case) to complete a job.

The owners of a system want to maximize throughput to maximize revenues, while users of a

system want low latencies so they don't waste their time. Consider a doctor's oce. Often they

keep you waiting for a long time so that you will be ready when the doctor is ready. They are

optimizing for throughput, not to minimize your latency. A busy trac signal should typically

maximize for throughput by having each signal direction stay on for a long time; this minimizes the

startup overhead every time the signal changes. However, that means that even if there is nobody

at the intersection, you may have to wait a long time till the signal light changes if you are unlucky

and arrive just as your light changes to red.

Another interesting point (exempli ed by the trac light example) is throughput is more in-

teresting for busy systems and latency is more important for idle systems.

One might think that throughput is just the reciprocal of latency. That is not true when the

system is pipelined | i.e., the number of users that may being serviced at the same time inside

the system. For example, if the system consists of 8 service stations that take 1 unit of time each.

If each job must go through each station, the throughput can be 1 job per unit time, while the

latency is 8. On the other hand, suppose each job needs only 1 service station and any service

station will do. Then the throughput can be 8 jobs per unit time, and the latency is 1.

For networks, the jobs are messages and the system is a network. The service stations correspond

to a series of hops. However, in this lecture we will con ne ourselves to a single hop.

怎样提高latency

写过程序的地球人都知道,提高响应速度的方式有批处理,流水线(overlapping),在本地cache

怎样提高throughput

写过程序的地球人都知道,提高吞吐量的方法是并发

网络带宽计算公式

http://en.wikipedia.org/wiki/Measuring_network_throughput

 

如何理解?

 

常用上网方式

http://wenku.baidu.com/view/c5a3ab2458fb770bf78a55e8.html

http://net.csai.cn/Join_ADSL/200802181430201595.htm

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
要通过fio测试服务器SSD盘的吞吐量、IOPS和延迟等指标,你可以在配置文件中定义适当的参数。下面是一些常用的参数设置: 1. 吞吐量(Throughput):可以通过设置块大小(bs)和并发作业数(numjobs)来控制。较大的块大小和更多的并发作业通常会增加吞吐量。 2. IOPS:可以通过设置读写操作的比例(rw)来控制。例如,如果想测试读取IOPS,将rw设置为"read";如果想测试写入IOPS,将rw设置为"write"。 3. 延迟Latency):可以通过设置运行时间(runtime)和报告间隔时间(time_based)来控制。较长的运行时间和较短的报告间隔时间可以提供更准确的延迟数据。 此外,你可以使用以下命令行参数来获取更详细的指标数据: - `--output-format=json`:以JSON格式输出结果,方便后续处理和分析。 - `--output=result.json`:将结果输出到result.json文件中。 - `--eta=always`:显示测试进度和预计完成时间。 下面是一个示例配置文件,用于测试SSD盘的吞吐量、IOPS和延迟: ``` [global] ioengine=libaio direct=1 thread=1 [random-read] rw=randread bs=4k numjobs=4 size=1G runtime=60 time_based=1 directory=/path/to/test/directory [random-write] rw=randwrite bs=4k numjobs=4 size=1G runtime=60 time_based=1 directory=/path/to/test/directory ``` 运行测试的命令如下: ``` fio /path/to/config/file --output-format=json --output=result.json --eta=always ``` 以上是一个简单的示例,你可以根据具体需求进行更详细的配置和参数设置。记得根据实际情况调整测试时长、并发数等参数,以获取准确的性能指标。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

FireCoder

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值