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 (exemplied 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 conne 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

你可能感兴趣的:(Throughput 吞吐量 和 latency 延迟)