dimecres, 22 de juny del 2016

More or Faster?

The More or Faster dilemma

What would you choose? MORE  but slow workers or to have fewer but FASTER workers?

Let's explore a little bit to find an answer.

Hairdresser’s

You have the opportunity to choose between two hairdresser's that have advertised, and it's true indeed, they are capable of 4 haircuts per hour:
  • The Faster with only 1 worker (m=1) and 15 minutes service time (S=15min),
  • The More with 4 hairdressers (m=4) and 1 hour service time (S=1h).

If just before entering you see a queue of 5 (Q=5) in both shops, which one should you choose?

Response:
  • The More: the response time, the total time you'll spend there, is between 2 h and 3 h,
  • The Faster: the response time, the total time you'll spend there, is between 1 h 30 min and 1 h 45 min.
It's better to choose "The Faster".

Company Department

The scheduling manager has to decide which department to send incoming jobs to. She has to make a choice between two departments delivering the same maximum performance (2 jobs per day).
  • The Faster department with 4 experienced and very efficient professionals (m=4) spending  2 days per job (S=2d).
  • The More department with 8 less experienced people (m=8) who spend 4 days per job (S=4d).
If the queue is 10 jobs long (Q=10)  in both departments, what should she choose?

Response:
  • The More: the next incoming job would take between 24 and 28 days to be processed.
  • The Faster: the next incoming job would take between 12 and 14 days to be processed.
It's better to choose "The Faster".

Below is the plot of the response time I see against the number in the queue (Q) for "The Faster" (red)  and "The More" (yellow)  alternatives in the hairdresser's case. It cleanly illustrates that "The Faster" is better, because of the delivered response time is smaller.



Learning point: given the same bandwidth (maximum throughput) always choose the service center with the fastest workers.





New blog URL:   http://www.ibm.com/blogs/performance
Mirror blog:  http://demystperf.blogspot.com

dimecres, 8 de juny del 2016

How much do I have to wait?

Wait time is lost time

I suppose everyone agrees with the sentence: wait time is lost time. Nobody likes or wants to wait. From the customer (requester) point of view wait time is, in general, badly tolerated.

But the service provider point of view is different. In general it would not provide ample capacity to eliminate any waits, given that the capacity has a cost and probably will remain idle out of peak times. An agreement/equilibrium must be reached.

How much do you have to wait?

Suppose you are a customer, arrive to a service center that has one worker, and find Q customers waiting in the queue ahead of you, and one customer being serviced. How much do you have to wait?

The response is simple: the remaining service time for the customer being serviced, plus the service time of the 1st customer in the queue, plus the service time for the 2nd customer in the queue,..., and so on until the last customer  queued (the number Q). This results in the following expression for the waiting time (W) ():

S1 + S2 + ... + SQ  <=  W  <=  S0 + S1 + S2 + ... + SQ

If we make the simplifying assumption that the service time (S) is constant, that is, every customer spends the same amount of time receiving service, we have this simpler expression

Q · S  <=  W  <= (Q+1) · S

and being the response time equal to the sum of the waiting time and the service time (R = W + S) we have

(Q+1) · S  <=  R  <= (Q+2) · S


In the case of a service center that has m workers, and S constant, the bounds to the waiting and the response time are

S*INT(Q /m)  <=   W   <=  S+S*INT(Q /m)
and
S + S*INT(Q /m)  <=   R   <=  2S + S*INT(Q /m)

where INT() is the integer part function.

So the waiting time depends on:
  • The Service Time  (S):  If the service time, mine or of the customers ahead in the line, increases (decreases) the response time will increase (decrease) as well.
  • The Number of Workers  (m): If the number of workers increases (decreases) the wait time will decrease (increase) as the line will advance faster (slower).
  • The number of queued customers (Q), that is, the number of waiting (queued) customers ahead of you. The bigger Q is the bigger the wait time is.

Practical cases

Hairdresser’s:
My hairdresser’s has the following performance values: a service time of 1 hour (S=1 h), and four hairdressers at work (m=4). When I arrive there, willing to get an haircut, there are 4 customers in the waiting room (Q=4).

I can easily derive that I'll have to wait between 1 and 2 hours,  as  1*int(4/4)=1  and 1+1*int(4/4)=2. That is, the response time I will experience will be between 2 h and 3 h.

Here is the plot of the response time (R)  interval against the number in the queue (Q):


Company Department:
In my company department jobs take one working day to be completed (S=1 day), and there are three equally qualified professionals working there  (m=3). So when a new job arrives and "finds" a queue of 6 (Q=6), it may be concluded that the job requester must have to wait between 3 and 4 days to get his request serviced, as 1 + INT(6/3) <= R <= 2 + INT(6/3).




New blog URL:   http://www.ibm.com/blogs/performance
Mirror blog:  http://demystperf.blogspot.com