In today’s modern world we are swimming in information. It can be tough to scrub through the mountains and mountains of data to find the exact information you need. Sometimes less is more. Little’s Law is the “less” in this current world of “more”. It is a back of the envelope formula for understanding the relationship between 3 key elements of systems:
- The arrival rate of users
- The length of time they spend in a system
- The number of users in a system
In this post we’ll go through 2 completely different types of systems and how Little’s Law is used in each situation to get the desired outcome. But first we need to back up and understand exactly what is meant by a “system” when it comes to queueing theory, which is the domain of science that Little’s Law falls under. A system in this sense is defined by users continually entering into some workflow to be processed or worked on. Due to constrained resources and natural variations in arrivals, a queue forms and it is this queuing system that Little’s Law allows us to assess. These queueing systems are way more common than you’d think and you can find them almost anywhere you look. A very simple example is grabbing coffee from your favorite coffee shop.
You, and many others, enter into the coffee shop at various times throughout the day to order your coffee. This is the arrival rate and is represented by Lambda (λ). You wait in line, order, and a barista processes your order at which point you grab it and leave, exiting the workflow. This is the length of time you have spent in the system and is represented by W. Finally, you are not the only person performing this. There are others waiting for their coffee. This is the number of users in the system and is represented by a L. And the final equation which ties these all together is Little’s Law which is L = λ W. It’s important to note that Little’s Law only works with averages of long period of time like days or hours. That it to say, it looks at the average arrival rate, the average length of time spent in the system, and the average number of users in the system.
So let’s go back to the coffee shop. Let’s say an average of 21 people arrive at the shop each hour. And there are an average of about 3 people in line. Using’s Little’s Law we can say with confidence that they spend an average of .14 hours (or 8.6 minutes) in the shop waiting for their coffee. Here’s how the math checks out:
Once you start to understand this basic setup of users entering into a workflow, being processed, and exiting — you will start to see it everywhere. And here is the real power of Little’s Law — it’s ubiquity. Things like rollercoaster rides, manufacturing processes, call centers — these are all examples of queueing systems which can be assessed using Little’s Law. They can even get a little abstract like in the case of people using YouTube.
You see, people pulling out their devices and opening up the YouTube app represent users entering into a workflow. They spend some time in the app, they close it and then exit the workflow. According to Alexa.com, users spend an average of 16 min, 21 sec on YouTube each day. YouTube also claims 1 Billion Hours of video are watched each day on average. This means if you divided the two together you’d get an average of 61.2 million users/day entering into the YouTube website. But how many users are on YouTube at any given moment? Surely a network engineer would need to know this information to help understand server load.
Using Little’s Law, we already know the arrival rate (λ): 61.2 million users/day. This is also equivalent to 42,500 users/min. And we know the average amount of time a user spends on YouTube each day is (W): 16 min, 21 sec (or 16.33 min). From the equation we can calculate 42,500 (users/min) * 16.33 (min) = 694,025 users on the site (or in the system) at any given moment.
Little’s Law power lies in its flexibility, simplicity and ubiquity. Knowing any of the 2 values in the formula will allow us to calculate the third across a variety of situations. The next time you’re data mining or crunching numbers in preparation for a project just stop and think is this a queueing system where people, parts of information is waiting to be processed? And do I know at least two of the three elements? If so, consider Little’s Law. It could save you a lot of time.