Modeling & Simulation- Lecture -4- 30/10/2013 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 30/10/2013 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, = Erlang type k, GI = General Independent. The second characteristic (B); specifies the service probability distribution. M = Exponential, D = Deterministic, = 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 30/10/2013 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 = ⁄ ). 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 = ⁄ ). 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- 30/10/2013 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 , , 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, is the average waiting time in the queue, L is the average number in the system, and 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- 30/10/2013 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 : …………….((1)) …………….((2)) …………….((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- 30/10/2013 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 , while the service rate 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 ( ) . 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 ( ). Also, we can describe these points as follows: { 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- 30/10/2013 /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: λ C I Figure (9) Tandem queue with feedback 7 Lecturer: Hawraa Sh. Modeling & Simulation- Lecture -4The arrival rate for the first server is departure in the steady state its done by 30/10/2013 and for the second server is . Entities arriving to the first server (C) from the outside with rate server (I, feedback) with rate , thus and so the or from the second ………….((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.