`
hyshucom
  • 浏览: 809970 次
文章分类
社区版块
存档分类
最新评论

Little's Law

 
阅读更多

这是排队论中最简单的一个定理,描述了平均队长、等待时间和到达率之间的关系。

L:平均队长, W:等待时间, Lambda:到达率

L = W * Lambda

理解该公式有几点需要注意:

1. 必须是稳定系统,即:“人”离开的速率必须大于或等于到达的速率,否则系统中的等待数将会越来越大,队长最终趋向于无穷大。

2. 等待时间可以理解成队列中最后一个“人”加入到队列中,直到他被服务为止的时间。

我们不妨观察队列中最后一个人,包括他在内前面一共有L个人,他最终要等待W秒才被服务,那么可以想象,这W秒后,系统中又进来了L个人。因此,系统的到达率为:Lambda = L / W


例1:

在一个网络系统中,假设我们的缓冲区可以缓冲1000个请求,每个请求的平均服务时间为0.001秒(1ms),那么这个系统中的数据包的平均等待时间为1000 * 0.001 = 1秒

Lambda = 1000 / 1 = 1000

也就是说,该系统每秒最多能够处理1000个请求。


例2:

假设我们观察到向一个系统发送请求,平均20ms就能得到响应,并且该系统每秒能处理大约1000个请求,那么是否能推测出该系统的缓冲区长度?

Lambda = 1000, W = 0.02, 所以: L = 20

实际上,为了应付瞬时尖峰请求,队长应该比20大一些(一般的经验值是多少呢?)。另外,实际系统中还会通过丢包、拒绝请求的方式控制队长。



参考:http://en.wikipedia.org/wiki/Little%27s_law#Example

Imagine a small store with a single counter and an area for browsing, where only one person can be at the counter at a time, and no one leaves without buying something. So the system is roughly:

Entrance → Browsing → Counter → Exit

This is a stable system, so the rate at which people enter the store is the rate at which they arrive at the store, and the rate at which they exit as well. We call this the arrival rate. By contrast, an arrival rate exceeding an exit rate would represent an unstable system, where the number of waiting customers in the store will gradually increase towards infinity.

Little's Law tells us that the average number of customers in the store,L, is the effective arrival rate, λ, times the average time that a customer spends in the store,W, or simply:

L = \lambda  W \,

Assume customers arrive at the rate of 10 per hour and stay an average of 0.5 hour. This means we should find the average number of customers in the store at any time to be 5.

L = 10 \cdot 0.5 = 5

Now suppose the store is considering doing more advertising to raise the arrival rate to 20 per hour. The store must either be prepared to host an average of 10 occupants or must reduce the time each customer spends in the store to 0.25 hour. The store might achieve the latter by ringing up the bill faster or by adding more counters.

We can apply Little's Law to systems within the store. For example, the counter and its queue. Assume we notice that there are on average 2 customers in the queue and at the counter. We know the arrival rate is 10 per hour, so customers must be spending 0.2 hours on average checking out.

W =\frac{L}{\lambda} = \frac{2}{10} = 0.2

We can even apply Little's Law to the counter itself. The average number of people at the counter would be in the range (0,1) since no more than one person can be at the counter at a time. In that case, the average number of people at the counter is also known as the utilisation of the counter.

However, because a store in reality generally has a limited amount of space, it cannot become unstable. Even if the arrival rate is much greater than the exit rate, the store will eventually start to overflow, and thus any new arriving customers will simply be rejected (and forced to go somewhere else or try again later) until there is once again free space available in the store. This is also the difference between thearrival rateand theeffective arrival rate, where the arrival rate roughly corresponds to the rate of which customers arrive at the store, whereas the effective arrival rate corresponds to the rate of which customersenterthe store. In a system with an infinite size and no loss, the two are however equal.


分享到:
评论

相关推荐

    Little's-Law原理与应用.pdf

    最原始的little定理解释说明,通俗易懂,章节详细的讲述了定理的证明,应用及其一些例题,即使是初学者也能快速学习,欢迎下载

    Agile.Metrics.for.Predictability.An.Introduction.098643633

    Why managing for flow is the best strategy for predictability—including an introduction to Little’s Law and its implications for flow. A definition of the basic metrics of flow and how to properly ...

    Everydata.The.Misinformation.Hidden.in.the.Little.Data.You.Consume

    While everyone is talking about big data,” the truth is that understanding the little data”the stats that underlie newspaper headlines, stock reports, weather forecasts, and so onis what ...

    基于Drum-Buffer-Rope理论的晶圆厂生产优化研究

    基于Drum-Buffer-Rope理论的晶圆厂生产优化研究,郭永辉,钱省三,DBR理论中缓冲区长度简单的采用经验给出,不利于订单作业安排的制订。基于little’s Law与约束理论,改进了缓冲区长度的设置方法。考�

    差分阻抗定义

    voltage along it, at any point, is (from Ohm’s law) V = Zo*i. General case, trace pair: Figure 1(b) illustrates a pair of traces. Trace 1 has a characteristic impedance Z11, which corresponds to Zo, ...

    The Art of Designing Embedded Systems.pdf

    many people's faith in complex technology (which shows just how little understanding Americans have of complexity). An odd resurgence of the worship of the primitive is directly at odds with the ...

    Addison.Wesley.File.System.Forensic.Analysis.7z

    on Techniques Most digital evidence is stored within the computer's file system, but understanding how file systems work is one of the most technically challenging concepts for a digital investigator ...

    新世纪研究生公共英语教材-听说(上)参考答案.doc

    6)fast and repetitious rhythms 1.little value; sin and evil 2.powerful symbol; Members of most societies ; keen feelings 3.central social values of a society ;western culture; interrelationship; the ...

    julia-1.1.0-win64

    For large scale numerical problems, speed always has been, continues to be, and probably always will be crucial: the amount of data being processed has easily kept pace with Moore's Law over the past...

    Teach Yourself Electricity & Electronics

    hour meters 55 Digital readout meters 56 Frequency counters 57...s Law 69 Current calculations 69 Voltage calculations 71 Resistance calculations 71 Power calculations 72 Resistances...

    WizFlow网页编辑

    case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free ...

    hibernate-shards.jar

    case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free ...

    Universal-USB-Installer

    By proceeding to use this tool, you agree not to hold it's author accountable for any damages that could potentially arise from it's use or misuse. --------------------------------------------------...

    四级英语真题

    C)To resign from his position in the woman's company. D)To exchange stock market infotmation with the woman. <br>20. A)He is head of a small teading company. B)He works in an ...

    统计物理学 (英文)

    3.2.1 A little quantum mechanics . . . . . . . . . . . . . . . . . . 21 3.2.2 The partition functions . . . . . . . . . . . . . . . . . . . . . 22 3.2.3 Classical limit . . . . . . . . . . . . . . . ....

    xplite_trial

    ------------------------------------------...You can read more about Windows File Protection on Microsoft's web site: http://msdn.microsoft.com/library/en-us/wfp/setup/about_windows_file_protection. asp ...

    Computer And Intrusion Forensics.7z

    3.2 The role of computer forensics in law enforcement . . . . . . . . 117 vi Contents 3.3 Principles of evidence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 3.3.1 Jurisdictional ...

Global site tag (gtag.js) - Google Analytics