"Turn" Eric ' s concurrent user number estimation and equivalence of little law

Source: Internet
Author: User

Transferred from: http://www.cnblogs.com/hundredsofyears/p/3360305.html

In the field of performance testing in China there is a classic article almost as a Daniel, a named Eric man Wong in 2004 published the "Method for estimating the number of Concurrent users, a formula for estimating the number of concurrent users in a system is presented, and the process and proof method are described in detail. This formula is very simple to use, and many performance test engineers are using it in their own projects or trying to use it, even when they are not specifically analyzing the behavior of the system user. This article does not intend to delve into the applicability of this formula, and I will discuss this in a future article.

I do not deny the correctness of the formula under the conditions specified by the author in the article, it helps me to some extent to consider the performance model of the system from another way of thinking, and through the study of performance engineering I found that the estimation formula and Little law altogether is equivalent.

Here's a look at how Eric came up with this formula, according to the original meaning :

First of all, we know that the system resources are used in the system is active users, that is, the so-called concurrent users, but not for users of the system, such as just logged out or have not yet logged in users will not consume the system resources, so when we want to measure the capacity of the system, this part of the users do not need to consider, Only active users in the system can be considered at this moment.

Then the article introduced a login session concept, of course, this thing is always there, but this article needs to use so specifically that it is equivalent to the user log out of the system when the time difference with the login system, that is, the life cycle of the session.

This diagram in this article is a good description of the state of the system at some point in the process of processing a succession of users, as well as the concept or idea of interpreting the system performance by calculating the number of concurrent user counts.

Finally came c=nl/t.

The proof process and the following details are not shown.

Then look at what is Little law.

To be honest, this law should be the most basic, but also widely used in many areas of the law, but in the domestic performance testing field of frequency is not high.

Direct borrowing from the translation of the programing pearls:

Most estimates follow a simple rule: the total cost is equal to the cost of each part multiplied by the total number of parts. But at some point we need to get to the details more deeply. Bruce Weide of Ohio State University wrote down the following text on a surprisingly general rule.

The "Operational analysis" introduced by Denning and Buzen (see Computing Surveys 10, 3rd, November 1978, No. 225 to No. 261) is more generic than the computer system queue network model. Their presentation was quite exciting, but they did not reveal the generality of the little law because of the limitations of the subject matter of the article. Their method of proving has nothing to do with the queue or computer system. Imagine an arbitrary system that has something to enter and leave. The little law can be expressed as "the average number of things in the system equals the average amount of time that these things leave the system, multiplied by each thing leaving the system." (If the overall flow of the system is balanced, the departure rate is the rate of entry.) )

When building a performance model, it is common to use the following formula to express the Little law:

N=x*r

N represents a user who is concurrently active in the system, including those that are being processed and queued.

X indicates the rate at which the user reaches the system successively, which is the system throughput (Arrival = departure) in a balanced state

R represents the average dwell time per user in the system

This means that the average number of simultaneous users in the system is equal to the speed at which the user arrives at the system * Each user's time in the system

This law is very practical and has a wide range of applicability, to give an example:

For example, you're waiting in line to get into a popular nightclub, and you can figure out how much time you have to wait by estimating the rate at which people enter. Using the little law, you can infer: "This place can hold almost 60 people, the average time spent in it is 3 hours, so we enter at the rate of 20 people per hour." And we have 20 people in front of us, so we have to wait one hours.

The above example can be further expressed by the formula:

R=3 hours

X=20 man /hour

So n=3 hours * /hour=60 people , the nightclub can accommodate the people

You can compare the above two methods and laws, their statements are completely different, the calculation of the required variables are not the same, but after the following case will make you surprised to find.

Case:

There is a forum system, active users every day, the user active time is mainly concentrated in the evening 7 to a point, the average person logged in and logged out once, landing time of five minutes, Please establish a performance test model for this system.

Use Eric 's formula to solve the equation:

Assuming the system backend maintenance session, then the length of the session is five minutes,l=30minutes

User active time has been learned from 7 points to a total of five hours,t=5 hours

Then the number of concurrent users c=n*l/t=500*30/(5*60) =50

We can also use the Little law to estimate the number of concurrent users of a system:

a user needs to enter the forum at 7 to three points, the arrival rate x=500/(5*60) = 5/3 users / minutes

Log -in time of up to five minutes for the user resident in the system,r=30 minutes

Then the system is served concurrently, and the number of concurrent N=X*R=5/3 *30=50

It seems that the results of the two complete different methods are exactly the same, is it coincidence? or multiple solutions to a problem?

Let's break down Eric 's estimation formula from another angle:

c=n*l/t can be expressed as c= (n/t) *l

n/t is not the same as we were in the above Little first step, is to calculate the arrival rate of X.

and L is not R ? is equal to the length of the session.

That is to say c= (n/t) *t=x*r=n

Conclusion: From the above,Eric 's estimation formula is equivalent to the Little law . at the same time, the reader can look at their own identification process , there is a certain similarity.

We can also safely use these two estimation methods to conserve resources and time within the scope of applicability.

Reference :

Http://www.ece.virginia.edu/mv/edu/715/lectures/littles-law/littles-law.pdf

Http://emiraga.wikispaces.com/file/view/Littles.law.January.2009.pdf

"Turn" Eric ' s concurrent user number estimation and equivalence of little law

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.