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

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:

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.

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.

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 the arrival rate and the effective 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 customers enter the store. In a system with an infinite size and no loss, the two are however equal.

Little's Law相关推荐

  1. Power Law and Exponential Decay of Inter Contac...

    2019独角兽企业重金招聘Python工程师标准>>> MobiCom'07, September 9–14, 2007: the observed dichotomy: Power ...

  2. R语言distCosine函数计算大圆距离实战(Law of Cosines Great Circle Distance)

    R语言distCosine函数计算大圆距离实战(Law of Cosines Great Circle Distance) 目录 R语言distCosine函数计算大圆距离实战(Law of Cosi ...

  3. 的g极串一个电阻_Ohm#39;s Law 简单系列D:从惠斯通(会石头)测电阻开始说

    引子 伏安法测电阻是初中电学中考典型实验之一,也是历年中考.一二模重点考查的内容,但电阻的测量方法不局限于伏安法,具有一定的灵活性.技巧性.多样性.按照基本器材来分有:伏安法.伏阻法.安阻法等.按照设 ...

  4. tableau必知必会之运用本福德定律(Benford‘s law)验证数据真实性

    本福德定律 本福德定律(本福德法则 Benford's law ),也称为本福德法则,说明一堆从实际生活得出的数据中,以1为首位数字的数的出现机率约为总数的三成,接近期望值 1/9 的 3 倍.而越大 ...

  5. 迪米特法则(Law of Demeter) 简介

    在Java里class设计经常会提到一些个原则或者规则 最出名的莫非是 封闭-开放原则了(closed-open principle) 而这次这个 Law of Demeter 也是挺重要的. 一, ...

  6. Amdahl’s law (阿姆达尔定律)的演化和思考

    G.M.Amdahl在1967年提出了Amdahl's law,针对并行处理的scalability给出了一个模型,指出使用并行处理的提速由问题的可并行的部分所决定.这个模型为并行计算系统的设计者提供 ...

  7. 软件设计原则(六)迪米特法则 -Law of Demeter

    LoD,Law of Demeter: 又称最少知识原则(Least Knowledge Principle),一个对象应该对其他对象有最少的了解 一个类对自己依赖的类知道的越少越好.也就是说,对于被 ...

  8. 帕金森定律(Parkinson's Law)

    帕金森定律(Parkinson's Law)是官僚主义或官僚主义现象的一种别称, 是由英国历史学家.政治学家西里尔·诺斯古德·帕金森(Cyril Northcote Parkinson)通过长期调查研 ...

  9. Conway#39;s law(康威定律)

    Mel Conway  康威在加利福尼亚理工学院获得物理学硕士学位,在凯斯西储大学获得数学博士学位.毕业之后,他参与了很多知名的软件项目,如 Pascal 编辑器.在他的职业生涯中,康威观察到一个现象 ...

  10. MP law simulation

    一个简单的例子解释随机矩阵里的MP law, ############################# ## ## A example to show the MP law in random ma ...

最新文章

  1. DataWorks V2使用PyUdf
  2. 2019年企业新增长 从雇佣“机器人员工”开始
  3. git常见的回退操作
  4. 【Tiny4412】烧写Uboot到EMMC
  5. spark RDD创建方式:parallelize,makeRDD,textFile
  6. CF758 D. Ability To Convert 细节处理字符串
  7. 数学界的花木兰——苏菲﹒热尔曼
  8. 基于主体掩码的实体关系抽取方法
  9. python读取xml文件内容_python读取xml文件
  10. BeanFactory和FactoryBean
  11. Hibernate集合属性的元素为组件(三)
  12. 更新pip下载jupyter lab
  13. 浙大pat | 浙大pat乙级 1001~1004
  14. PE安装Win10纯净版教程【附Win10企业版/专业版/64/32位系统下载地址以及系统激活工具和解压软件安装包】
  15. 为什么说汽车VIN码是汽车唯一的身份证
  16. 内燃机 vs 外燃机
  17. 排序相关算法在计算机程序设计竞赛中的研究
  18. r语言remarkdown展示图_十个超级好用的R语言编程技巧,一般人绝不知道!
  19. 7.Python3标准库--文件系统
  20. 【JavaScript:快速入门】

热门文章

  1. 2013年嵌入式软件开发工程师的薪资水平调查
  2. Android避免缓存资源被系统扫描并显示(.nomedia)
  3. 交互设计:非原型,不设计
  4. 医用红外额温枪测温仪方案
  5. 作为外汇交易者,外汇交易跟非法集资的区别你都清楚吗?
  6. Java程序运行状态的监控
  7. ftl页面中html飘红,eclipse下不能编译.ftl文件,会报错的解决方法
  8. [Java 游戏编程]STG类游戏的实现2-Bullet
  9. 八竿子打不着的零碎记录
  10. NIPTeR包分析 NIPT