排队论及其应用Lecture6一般到达或服务模型.ppt
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《排队论及其应用Lecture6一般到达或服务模型.ppt》由会员分享,可在线阅读,更多相关《排队论及其应用Lecture6一般到达或服务模型.ppt(66页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、排队论及其应用排队论及其应用Lecture 6一般到达或服务模型一般到达或服务模型中国科学技术大学计算机科学与技术学院田 野1M/G/1排队模型n考虑一个排队系统n一个服务器,无穷等待位n客户到达服从泊松过程,速率n任意服务时间分布函数,平均服务速率(即单位时间服务个客户),服务时间CDF分布:B(t)n用M/G/1表示n用t1,t2,t3,表示客户1,2,3,.完成服务(离开系统)的时刻,X(ti)表示在ti时系统内的客户数量(即客户离开排队系统后瞬间系统内客户的数量)。可以用嵌入马尔科夫链模型描述这个排队系统,用Xi表示X(ti)。2n离散时间随机过程Xi具有Markov性质n证明:这里A
2、n+1是服务器服务第n+1个客户这段时间S(n+1)内到达排队系统的客户数量。An+1和S(n+1)均为独立随机变量,稳态下与n无关。用A和S来表示。有A和S相互独立,所以3泊松到达,时间t内到达a个客户的概率当Xn1,第n个客户离开立即开始服务第n+1个客户;但是当Xn=0,必须先等第n+1个客户到达,才开始服务n所以,对Xn=i1上式只和i与j有关,说明Xi具有Markov性质n对Xn=0,类似可以证明4M/G/1稳态解nM/G/1系统的演化方程 其中n令 ,即客户离开后瞬间系统内平均客户数量(括号中D表示客户离开,Departure)。上式两边取期望,有其中,5n 两边平方再取期望,得n
3、由于 ,可得 6n现在求解EA2所以n综上对于M/G/1,客户离开时的系统参数均值=任意时刻的系统参数均值(将证明这一点)7nM/G/1排队系统中平均客户数量这个公式被称为Pollaczek-Khintchine等式(PK等式,波拉切克-辛钦等式)nF.Pollaczek:法国数学家nA.Y.Khinchin:苏联数学家(现代概率理论奠基人之一)n由Littles Law:n平均逗留时间:n平均排队时间:n平均排队客户数:8例子:n一个单服务器排队系统,客户到达可视为泊松过程,平均每小时到达10个。服务器平均服务时间5分钟,服从指数分布。现在如果有一种措施,可以把服务时间标准差从5分钟减为4分
4、钟,但是平均服务时间会延长到5.5分钟?问这种措施是否必要?n未采取措施,M/M/1,n采取措施,M/G/19客户离开时的稳态系统状态n我们考察一个稳态M/G/1排队系统中,当一个客户离开后的瞬间,系统中存在n个客户的概率。用n表示这个概率序列。n定义10注意:我们已经证明了Xi的Markov性质n由此可以得到Xi的一步转移概率n并且11或者展开,有n序列i和ki的生成函数n对 两边分别乘以zi,再把等式相加,得到12n由于(1)=1,且K(1)=1,K(1)=/n综上,13n获得(z),即可获得n;或者从稳态方程递归获得当i=0,求出1;当i=1,求出2;当i=2,求出3;14例子:机器-修
5、理工n某工厂有很多机器,它们出现故障的过程可以用一个泊松过程来描述,到达速率每小时平均5台。工厂有一个修理工负责修复机器。机器只可能发生两种故障,修理工排除第一种故障需要9分钟,排除第二种故障需12分钟。2/3的故障属于第一种,剩下的属于第二种。n问:任意时间多于三台机器不能工作的概率15nM/G/1排队模型n服务时间是一个两点分布:PrS=9=2/3,PrS=12=1/3,其余为016n服务时间分布B(t)是一个两点分布,17n根据(z)和K(z)的关系n由K(z)计算(z),再由(z)获得n具体计算过程略n迄今为止我们使用一个假设假设:任意时间系统中有i个客户的概率=客户离开后瞬间系统中有
6、i个客户的概率,即pn=n下面我们证明这一点18证明n=pnnn:一个客户离开后瞬间系统中有n个客户的概率npn:任意时刻系统中有n个客户的概率n证明:n考虑在一段时间T内系统的演变。令An(T)表示时间T内系统发生nn+1状态迁移的次数,Dn(T)表示时间T内发生nn-1状态迁移的次数。两种迁移的次数之差最多为1。n令A(T)和D(T)分别表示时间T内的所有到达和离开事件的个数,X(T)为T时刻系统内客户个数19n客户离开后瞬间状态概率n由于n当T,X(0)和X(T)是有限的,综合以上条件n由于客户到达事件独立于系统状态,所以20客户到达的泊松过程独立于排队系统中的客客户到达的泊松过程独立于
7、排队系统中的客户人数,因此最后一个等号成立户人数,因此最后一个等号成立有限等待位的M/G/1/K模型nM/G/1/K与M/G/1的关系类似于M/M/1/K与M/M/1的关系n一个服务器,任意服务时间分布,平均服务速率,K-1个等待位nPK等式不成立n排队系统只有K+1个状态,相应地,单步转移概率矩阵(K+1)(K+1)21n单步转移矩阵n由 ,得到M/G/1/K的稳态方程22n上式可以独立求解i,进而计算系统内平均客户数量n求解上式:和M/G/1的稳态方程对比,可以看到第一个式子是一样的。如果已知M/G/1的状态概率为i*,对i=0,1,2,K。有i=Ci*,并且常数C为23nn是一个客户离开
8、后瞬间系统中有n个客户的概率n定义:nqn:一个客户到达时系统中已有n个客户的概率,不管这个到达客户是否能够进入排队系统nqn:一个客户到达并且能够进入排队系统时系统中已有n个客户的概率n阻塞概率:qKn参考对M/G/1排队模型中“n=pn”的证明过程,对M/G/1/K,有n=qn。24n n因此 ,求qn,需要获得qKn对于M/G/1/K,下式成立n因此 ,需获得p0n由于到达过程是独立的泊松过程,因此n综上,25状态相关服务n服务时间分布取决于服务开始时,系统内有多少客户。n令 表示当系统内有i个客户的时候,客户服务时间分布。可为任意分布。n服务时间分布 时,服务一个客户期间到达n个客户的
9、概率26n一步转移概率n对状态相关服务时间分布的M/G/1排队模型,稳态存在的条件是简单来说,就是对所有Bi(t),i1。27Crabill,1968n将方程 展开,可以写为n序列i,kji的生成函数n将展开方程两边乘以相应的zj再相加,整理得28n考虑一个特例,服务器的服务时间服从指数分布,且有两档服务速率(“慢”和“快”),分别是系统空和非空时的服务速率。n转移概率29n使用K0(z)和Ki(z)=K(z)计算(z)30n求0:(1)=1,且K(1)=K0(1)=1,K0(1)=0=/0,K(1)=/31n最后,由令n=0,可求出1;令n=1,可求出2;令n=2,可求出3;.n最终有32M
10、/G/模型nM/G/排队模型n类似于M/M/排队系统,无限个服务器n泊松到达,服务时间任意分布,CDF为B(t),平均服务时间1/n时刻t系统内客户个数记为N(t),到时间t,累积到达客户个数X(t),累积离开客户个数Y(t)n由于泊松到达,33n时刻x到达的客户在时刻t仍在系统内的概率为1-B(t-x)。时刻t任意一个客户在系统内的概率n由于泊松到达,到达事件均匀分布在(0,t)n所以 ,且客户相互独立n根据组合定律34n综上n当t,所以35均值为qtt的泊松分布M/G/c/c损失模型nM/G/c/c排队模型n系统中c个服务器,无等待位n泊松到达,服务时间任意分布,CDF为B(t),平均服务
11、时间1/nM/M/c/c的状态概率同样适用于M/G/c/c,36Erlang loss formulaG/M/1排队模型n考虑一个排队系统n一个服务器,无穷等待位n客户单个到达,到达时间间隔任意分布,其CDF为A(t),到达速率为n服务器平均服务速率,服务时间为指数分布nG/M/1n定义Xn为第n个客户到达前瞬间,系统内的客户个数。有这里Bn是第n个客户和第n+1个客户到达间隔T(n)服务器服务客户的个数37n由于服务时间和到达间隔均为独立随机变量,我们用T和B代表T(n)和Bn,有进而我们有上式只和i与j有关,说明Xi具有Markov性质38pi0单独考虑n令nXi的一步转移概率可以写为n令
12、 ,则39pi0单独考虑,因为系统空闲时,到达时间间隔并不是全部用于服务客户n矩阵形式展开,有n如果我们令Dqi=qi+1,则上式可以写为如果把D改写为z,上面右边为bn的生成函数,写为(z),进而有40求解这个式子,可以得到z,进而由qi=1得到qin由于nbn的生成函数可以写为这里 是A(t)的Laplace-Stieltjes(拉普拉斯-斯蒂尔吉斯)变换(LST)n求解方程 在-1,+1内,上式有唯一稳定解r0。41G/M/1的解n综上所述,客户到达前瞬间系统内有n个客户的概率为n对比M/M/1,区别在于用r0替换nqn仅仅是一个客户进入系统前瞬间系统内有n个客户的概率,不同于任意时刻系
13、统内有n个客户的概率pn,且 pnqn42n考虑客户进入前瞬间的系统指标。参考M/M/1的推导过程,有43这里的上标A表示客户进入的时刻(arrival)例子:n某个G/M/1排队系统,服务器的服务速率为每分钟2个,客户到达间隔时间分三种,分别是2分钟,3分钟,和4分钟,出现这三种到达间隔的概率分别为0.2,0.7和0.1。n=1/2,首先求解 44n数值求解,得r00.467。45Kz(k)(z(k)10.5000.48920.4890.48130.4810.47640.4760.47250.4720.47060.4700.46870.4680.46780.4670.467Case Stud
14、ynKrishna Kumar Ramachandran and Biplab Sikdar,A Queueing Model for Evaluating the Transfer Latency of Peer to Peer Systems,IEEE Transactions on Parallel and Distributed Systems,2009.47Peer-to-Peer DownloadingnA P2P system can be considered to consist of an interconnecting network of routers forming
15、 the network backbone which connects the various sub-networks in which the peers themselves reside.48DelaynThe total file transfer delay is given by the sum of the(1)query search time,(2)peer level delay i.e.the transmission time of the file being downloaded and(3)core network delay i.e.queuing dela
16、y at the intermediate routers.nFocus on the peer level delay49Queueing Model for the End PeersSingle peernLet there be N peers in the subnets of a given router and on an average,d download requests arrive at the router per second with an arbitrary inter-arrival time distribution FI.It is also reason
17、able to assume that the fraction qi(N)of these request arrivals that are destined for particular peer i is inversely proportional to N.nLet 1,2,be the sequence of inter-arrival times of the download requests arriving at a given router.The inter-arrival time between to requests at peer i,Ti,is then g
18、iven by the random variable.50n is a geometric random variable with parameter qi(N),i.e.,Pr=n=qi(N)(1qi(N)n,for n=1,2,.Thus the inter-arrival time between two successive arrivals at a peer is a random,geometric sum of the inter-arrival times.nIt is well known from Renyis theorem that the geometric s
19、um of any arbitrary distribution for independent,non-negative random variables converges to the exponential distribution as qi(N)0.nThus the distribution of the time between two download requests at peer i is exponentially distributed with rate 51nWe allow for arbitrary distributions for the service
20、 times thereby accommodating generalized models for the file sizes.nWith C and Nr representing the total service capacity of the node and number of requests being served,respectively,the service rate of each download is C/Nr.nHence we model each peer as a M/G/1/m Processor Sharing(PS)queue.nSuppose
21、a peer can allow up to m downloading flows.52nThe state probabilities of M/G/1/m PS is identical to M/M/1/m nPl is the blocking or loss probabilityn is the average service time per request.nEffective rate of arrivals P(1-Pl),where P=nUsing Littles law53Aggregate Peer LatencynThe number of replicas o
22、f files in P2P systems like Napster and Gnutella is heavily skewed and may be modeled by a Zipf distribution.nWe denote the total number of files currently shared in the entire network by V and the number of files shared by the peers that are currently online by Von.nThe ith most frequent object fro
23、m a total of V files occurs54nWe assume that the downloading peer requests an equal fraction of the file from each of the O(i)peers available.Assuming that equal amounts are downloaded from each available peer starting at the same time,the overall download time is characterized by the time taken by
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 排队 论及 应用 Lecture6 一般 到达 服务 模型
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内