Atitit. Concurrency test solution (2), atitit Solution

Source: Internet
Author: User

Atitit. Concurrency test solution (2), atitit Solution

Atitit. Concurrent Test Solution (2) ----- obtain random database records and randomly extract data for random sorting

 

1. Application Scenario 1

2. Principles of random data extraction 1

3. Common Implementation Methods: Database random function 1

4. Mssql implementation NEWID () and rand () 1

5. Differences between newid () and rand () 2

6. NEWID () 2

7. Refer to 2

 

1. application scenarios

Concurrency Test

 

2. Principles of random data extraction

The principle is to loop all the ID/record, append the random function field, and then sort the as field ..

 

3. Common Implementation Methods: Database Random Functions

Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com

Reprinted please indicate Source: http://blog.csdn.net/attilax

 

4. Mssql implementation NEWID () and rand ()
 

Select top 10 *

FROM wechatuhstry

Order by newid ()

Or

 

Select top 10 *, newid () as Random from ywle where ywlename = '001' ordey by Random

 

 

Random Function: rand ()
Run select rand () in the query analyzer and you can see that the result is a random decimal like this: 0.36361513486289558. decimal places like this are not used much in practical applications, generally, random numbers are random integers. Let's look at the following two random integer acquisition methods:

 

Newid should be used instead of rand ()... newid is different in each row... rand is different in every number of times.

 

It returns a GUID

5. Differences between newid () and rand ()

Select top 3 id from table order by newid () each time this line is run, a new random three-row result is generated.

The three records of the select top 3 id from table order by Rand () operation are the same each time.

The Rand () function returns the same value for all rows in a given command.

If you do not need such a result, you can provide a seed value to the rand () function. In the following code, the productid of each row is given as the seed value in the Rand () function.

 

6. NEWID ()

4650D5AA-E8FE-4721-83E7-EA12C4F7A473

It returns a GUID

 

Newdi () creates a unique value of the uniqueidentifier type, similar to this style 6F9619FF-8B86-D011-B42D-00C04FC964FF
This function is called every time the select statement is scanned to obtain a record. In this way, different values of each result record are generated. Sorting by this value is similar to generating a random record.

 

 

7. Reference

 

Example of database query and sorting using random sorting results (Oracle_MySQL_MS SQL server_oracle_footfall .htm

SQL NEWID () random function-log of lansong-wangyi Boke .htm

SQL server's Random Functions newID () and RAND ()-unintentional-blog. htm

Log of the SQL Random Functions NEWID () and RAND ()-xiao_mege-wangyi Boke .htm

Differences between newid () and rand ()


Q: How many concurrent users can be simulated by the WAS test tool?

50
 
How to test the maximum concurrency of a website?

This article solves the problem of many users, that is, how to determine the maximum number of users in the system through the maximum number of concurrent users. If this problem is not solved, it is difficult for users to select the server most suitable for their systems. Let's take a look at this article. The original Article is as follows.
This article focuses on performance.
The maximum number of concurrent users in a system is 1100. How can we calculate the maximum number of users supported by the system.
The user performance requirements are as follows: 1 million registered users are supported
Performance Requirement Analysis:
1. According to user requirements, the system should support 1 million users. What is the performance machine configuration? What is the peak value? Bandwidth? And so on
2. If the test environment of the company is used, what types of performance should we do this time? Performance evaluation, load testing, and intensity testing?
3. How to calculate the number of concurrent users? Response time?
Performance Indicator determination:
Because the user's performance requirements are too wide, the specific value is not set. So how can I carry out subsequent work? 1. determine to adopt the company's testing environment without considering environmental issues. That is to say, clients, servers, bandwidth, and other systems do not need to be considered. This is fixed.
2. Consider whether the system performance that this project team has previously developed can be used as a reference value. Solution: Find out the project group that has concurrent two projects, and evaluate the right of its performance metrics. Browsing: The concurrency is 1100, the average response time is 363 seconds, and the average response time per user is 0.33 seconds. Three concurrent users per second. Among them, the number of system users has reached 5 million, and the number of other system users is 3.2 million. In addition, the second system has been running normally, but currently the second system has three servers each. It can be concluded that a server is carrying 1.66 million or more. (Because the server has a permission relationship)
3. How can we calculate the number of active users per hour for 1 million users?
Solution: Based on the 80 • 20 principle, the number of active users per hour is calculated as 66.67 thousand. The number of concurrent clicks per second for the same function point should be 18.5.
4. How can I get the number of concurrent jobs?
Solution: How many features does the system have? The number of features is 153, that is, the system will be clicked 1258 times at a high peak, 0.35 times per second. (Regardless of the interval) consider the values of the previous project team. The initial setting concurrency is 1100, mainly focusing on the browsing function, followed by query and addition.
5. The performance type should be tested. After repeated consideration, all three types of performance should be tested.
Execution performance:
Evaluation: Based on the third point in the performance indicator determination, set the user concurrency to 300-350, depending on the situation. Load Testing, starting from 1100, is 15 hours and 24 hours
Performance test results:
The maximum number of users supported by the system is 1100. the maximum number of failed users is 209, and the response time is 315. The maximum concurrency of the system is about 1100. This means that the system supports 1.5 million users on one server.
Based on the above situation, we can conclude that:
1100 concurrent users, the total response time of the user is 315 seconds (that is, the average response time of each user is 0.005 seconds), of which up to 209 failed users are generated, however, successful users can basically complete subsequent operations, and the maximum number of stable users meets the requirements of the current system. It can be concluded that the maximum number of concurrent users supported by the system in the new function points is 1100. According to the 1*100 ratio, the peak number of active users per hour is calculated as 0.11 million/hour. The 80 • 20 principle is used to calculate that the number of registered users supported by the system is about 1.65 million. The system performance requirements Support 1 million registered users on a large scale. Our system meets the performance requirements of the system based on the above data.
Note: The peak number of active users per hour is 1 million, and the 80 • 20 principle is adopted.

Related Article

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.