Modeling & Simulation- Lecture -4- 5/11/2014 Queuing Systems Queuing theory establishes a powerful tool in modeling and performance analysis of many complex systems, such as computer networks, telecommunication systems, call centers, manufacturing systems and service systems. Many real systems can be modeled as networks of queues, such as the waiting line in a bank, a bus stop, waiting line in airport, material flow in factory, and signal flow in network. So, each of these simple systems consists of three major components: • Entities: Something that changes the state of the system. In many cases, particularly those involving service systems, the entity may be a person. In the customer service center, the entities are the customers. Entities do not necessarily have to be people; they can also be objects. Similarly, in the factory example, the entities are components waiting to be machined; entities can be signals waiting to be received in communication networks. • Queues: Queues are the simulation term for lines. Entities generally wait in a queue until it is their turn to be processed. • Resources: Processer or server that serves the entities those are in the queue. Example factory machines, computer processer, nodes in communication networks. The relationships among these components are illustrated in figure (1). Queue or Buffer Arrival Departure Server Entities being served Figure (1) Basic Queuing system component Queues can be categorized to simple queue, or it can be chained to make a network of queues; thus the departure from one queue enters to the next queue. Queuing network can be opened network or closed network. Figure (2) shows the opened network, while figure (3) shows the closed network representation. 1 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4- Arrival 5/11/2014 Queues Departure Server Server Figure (2) Opened Queuing Network Arrival Queues Server Server Departure Figure (3) Closed Queuing Network Basic Queuing System Concepts Each queuing system is described by characters: A / B /C / X / Y / Z, these characters called Kendall’s notation: The first characteristic (A); specifies the arrival distribution (or the time between two successive arrivals). The following standard abbreviations are used: M = Exponential, D = Deterministic, Ek = Erlang type k, GI = General Independent. The second characteristic (B); specifies the service probability distribution. M = Exponential, D = Deterministic, Ek = Erlang type k, GI = General Independent. The third characteristic (C); specifies the number of parallel identical servers in the systems, denoted by 1 of theirs only one server and by C if theirs multiple server. The fourth characteristic (X); describes the queue length or the number of entities allowable to enter the system. The fifth characteristic (Y); specifies the queue strategy. A queue strategy determines the discipline for ordering Entities in a queue. It defines the order in which they are served and the way in which resources are divided between customers. Here are some of these strategies: 2 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4 5/11/2014 First In First Out (FIFO). Last In First Out (LIFO). Priority Queue. The shortest is served first. Random Service. Round Robin. Calling source for entities asking for service (Z): it considers being finite if these entities coming from finite population or it can be infinite of the population they are come from is infinite. Performance Measurements One approach to Performance measurement is to obtain the data by observing the events and activities on an existing system. Mean response time, the total service time, the workflow, the numbers of completed or aborted service requests, the total waiting time, the queue length, the number of transactions completed per unit time, the ratio of blocked connection requests, and The rollback completion time are the most important performance measures. When analyzing a system with a single queue, the most common performance measures are obtained as follows: Arrival distribution (λ): or the average time between arrivals (Interarrival times = 1⁄𝜆). This distribution considers being the first statistical pointer that helped to determine the model type. Service rate ( ): number of departing entines per unit time. Service time is average between departures (Interdeparture time = 1⁄µ). Server utilization (ρ): or Traffic intensity describes the fraction of time that the server is busy, or the mean fraction of active servers, in the case of multiple servers. 𝜌= 𝜆 µ Queue length ( L ) : is the number of Entities in the system including both the entities waiting for the service and receiving it . Waiting time ( W ) : is the total time that the Entities spend in the system waiting to be served. 𝑃𝑖 : The probability of a given number of Entities i in the system. 3 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4- 5/11/2014 Little's Formula Little's formula is the most used formula in performance evaluations. It is important because it can be used with most queuing systems and applies to both single server systems and network of servers as well. It state that N = λ ∗ T , L = λ ∗ W, Lq = λ ∗ Wq Where N is the average number of entities in the system, λ is the arrival rate to the system, T is the average time spent in the system, W is the average waiting time in whole system, Wq is the average waiting time in the queue, L is the average number in the system, and Lq is the average number in the queue . Markov Chains The most powerful analytic techniques for evaluating complex system performance are based on the theory of Markov chains. A random process is called a Markov Process if, conditional on the current state of the process, its future is independent of its past. A Markov chain is a mathematical model for stochastic systems whose states, discrete or continuous, are governed by transition probability. Transitions means the change of the state of the system, and the probabilities associated with various statechanges are called transition probabilities. The collection of the states and transition probabilities forms a Markov chain. Many queuing models are in fact represents Markov processes. There are a large number of real engineering, industrial, physical, biological, economics, and social phenomena that can be described and analyzed as Markov chains. The Birth-Death process The Birth-Death process is a Continuous Time Markov Chains (CTMC) with states {0, 1, 2…n-1} for which transition from state i may go only to state i-1 or i+1. CTMC do not have discrete time or index. The state changes could occur at any instant of time. Queuing systems suppose that the entity arrival and departure operations to and from the system basis on birth-death process. In queuing theory the term birth means entity arrival to queuing line, and the term death means the departing entity after getting the service. 4 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4- 5/11/2014 M / M / 1 Queue The M / M / 1 queue is the default representation of Kendall notation of queuing systems, it contain from single server uses the FIFO service disciplines, and one waiting line of infinite size. Figure (4) shows the M / M / 1 queue. And the state diagram of this model explained in figure (5). L 𝐿𝑞 λ Server µ 𝑊𝑞 W Figure (4) The M / M / 1 queue The relationship between the performance measurements of M / M / 1 is : ∴ W = Wq + 1 …………….((1)) µ ∴ Lq = λ ∙ Wq …………….((2)) ∴L=λ∙W …………….((3)) This relationship defined with little's formula. λ λ 1 0 µ λ n-1 2 µ λ µ λ n+1 11 n µ µ 1 Figure (5) the state diagram of birth-death process for M / M /1 5 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4- 5/11/2014 M / M / C Queue The number of parallel servers is ( C ) where ( C >1 ) and the entities use the FIFO service disciplines. In this model the arrival rate λn = λ , while the service rate µn can be calculate as follows : 1 If (𝑛 ≥ 𝑐), the number of entities in the system is more than or equal to the number of servers; this means all servers is busy; then the average of served entities is (cµ ) . 2 If (𝑛 < 𝑐), the number of entities in the system is less than the number of servers; this means that some servers are idle; then the average of served entities is (nµ ). Also, we can describe these points as follows: nµ , 0 < 𝑛 < 𝑐 µn = { cµ , 𝑐 ≤ 𝑛 λ λ λ 0 1 µ λ c-1 2 2µ λ c cµ cµ Figure (6) the state diagram of birth-death process for M / M /C We have two types of M / M / C , the first one consist of one waiting queue and all the parallel servers share this queue, while in the other one each server have its own waiting queue, the two types can be explain in a and b of figure (7). µ µ Arrival Server 1 Server 2 λ Departure µ Server n (a) M / M / C model with one waiting queue. 6 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4- 5/11/2014 λ/n µ λ/n µ Server 1 Server 2 Arrival λ/n Departure µ Server n (b) M / M /C model with one queue for each server. Figure (7) M / M /C model Tandem Queue This model consist of (j) sequence stages, where (j>1). And each stage include number of parallel server (i) where (i≥1). If entity completes its service at any server or if new entity asking for a service this situation makes change in the state of system. Figure (8) explain the model, λ µ𝟏 µ𝟏 Figure (8) Tandem queue model Tandem Queue with Feedback From the previous results, it become so clear for us that the system with two sequence server is working as two independent M / M / 1 queues . And for applying this relationship to tandem queue with feedback, we take the model in (a), the state diagram in figure (9) as an example: λ P1 µ𝟎 C µ𝟏 I P2 Figure (9) Tandem queue with feedback 7 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4- 5/11/2014 The arrival rate for the first server is λ0 and for the second server is λ1 and so the departure in the steady state its done by λ0 , λ1 . Entities arriving to the first server (C) from the outside with rate λ or from the second server (I, feedback) with rate λ1 , thus λ0 = λ + λ1 ………….((1)) When entity arriving to the system, it enter server (C) and after complete its service enter to server (I), then return to server (C) and finally depart from the system. We conclude that the entity get service two times at server(C) and one time at server (I). 8 Lecturer: Hawraa Sh.