Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

question about Littles Law

Tags:

algorithm

I know that Little's Law states (paraphrased):

the average number of things in a system is the product of the average rate at which things leave the system and the average time each one spends in the system, or:

n=x*(r+z);
x-throughput
r-response time
z-think time
r+z - average response time

now i have question about a problem from programming pearls:

Suppose that system makes 100 disk accesses to process a transaction (although some systems require fewer, some systems will require several hundred disk access per transaction). How many transactions per hour per disk can the system handle? Assumption: disk access takes 20 milliseconds.

Here is solution on this problem

Ignoring slowdown due to queuing, 20 milliseconds (of the seek time) per disk operation gives 2 seconds per transaction or 1800 transactions per hour

i am confused because i did not understand solution of this problem please help


1 Answers

It will be more intuitive if you forget about that formula and think that the rate at which you can do something is inversely proportional to the time that it takes you to do it. For example, if it takes you 0.5 hour to eat a pizza, you eat pizzas at a rate of 2 pizzas per hour because 1/0.5 = 2.

In this case the rate is the number of transactions per time and the time is how long a transaction takes. According to the problem, a transaction takes 100 disk accesses, and each disk access takes 20 ms. Therefore each transaction takes 2 seconds total. The rate is then 1/2 = 0.5 transactions per second.

Now, more formally:

Rate of transactions per seconds R is inversely proportional to the transaction time in seconds TT.

R = 1/TT

The transaction time TT in this case is:

TT = disk access time * number of disk accesses per transaction =
20 milliseconds * 100 = 2000 milliseconds = 2 seconds

R = 1/2 transactions per second 
= 3600/2 transactions per hour
= 1800 transactions per hour
like image 137
b.roth Avatar answered Dec 31 '25 17:12

b.roth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!