17Queues

Queues occur in many situations in computing:

  • When a programming job is submitted, it takes its place in a queue, and has to wait until the server is free before being processed. Each job is processed when there is no other job in front;
  • When a request is submitted to a website, if there are requests ahead of it, it cannot be serviced at once, so it takes its place in the queue;
  • Where there are multiple users of a networked computer system with a shared printer, files submitted have to wait until the previous jobs have been printed.

In this chapter, we use R to investigate single server queues and their properties empirically. In particular, we look at the factors that determine the length of the queue and the likely response time.

17.1 The Single Server Queue

The simplest type of queuing system is that for which there is one server dealing with the jobs on a first‐in first‐out basis as depicted in Fig. 17.1.

c17f001

Figure 17.1 A Single Server Queue

In queuing terminology, this is known as a single‐server queuing system. Empirical investigations have found that the time a server takes to process a task submitted to it in a queuing network can be modelled with the exponential distribution. Also it has been found that submissions often follow a Poisson distribution so that the interarrival time is exponential. Such a queue is denoted by M/M/1; the two Ms refer to the Markov/Memoryless ...

Get Probability with R, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.