Source: http://blog.csdn.net/qiguiting/article/details/11584397
A partial overview of Web performance testing in general, the processing of a Web request consists of the following steps:
(1) The customer sends the request
(2) The Web server accepts requests for processing;
(3) Web server obtains data to DB;
(4) Webserver generates the user's object (page) and returns it to the user. The time to send a request to the client to start to the last byte is called the response time (the third step is not included in each request processing).
1. Transactions (Transaction)
In a Web performance test , a transaction represents a process that "sends a request from a user->web server accepts to a request, is processed by Web server to obtain data from the DB, generates the user's object (page), and returns to the user" , the general response time is for the transaction.
2. Request Response Time
Request response time refers to a request initiated from a client, to the end of the client receiving a response returned from the server, the time spent in some tools, the response is often referred to as "TTLB", or "time to the last byte", which means starting a request, The time it takes for the client to receive the response from the last byte, which is typically "seconds" or "milliseconds" in the response time. A formula can be expressed as: response time = Network response time + application response time. The standard can refer to foreign 3/5/10 principle:
(1) Within 3 seconds, the page gives the user a response and display, can be considered "very good";
(2) Within 3-5 seconds, the page gives the user a response and is displayed, can be considered "good";
(3) Within 5-10 seconds, the page gives the user a response and is displayed, can be considered "reluctantly accepted";
(4) More than 10 seconds is a bit impatient, the user will probably not continue to wait;
3. Transaction response Time
A transaction may consist of a series of requests, and the response time of a transaction is primarily for the user, and is a macro concept that is presented to inform the user of the business response time. For example, the response time for a cross-line withdrawal transaction is made up of a series of requests. Transaction response time is a parameter that directly measures system performance.
4. Number of concurrent users
Concurrency is generally divided into 2 scenarios. One is the strict concurrency, that is, all users do the same thing or operation at the same time, this kind of operation generally refers to doing the same type of business. For example, in the credit card approval business, a certain number of advocates at the same time to the completed approval of the business to submit; There is also a special case where all users do exactly the same thing, for example, in the credit card approval business, all users can apply for business together, or modify the same record.
Another concurrency is generalized range of concurrency. The difference between this concurrency and the previous concurrency is that although multiple users have made requests or performed actions on the system, these requests or actions can be the same or different. For the whole system, there are still many users working on the system at the same time, and therefore also belong to the concurrency category.
As you can see, the latter concurrency is the one that contains the previous concurrency. and the latter concurrency is closer to the actual usage of the user, so for most systems, only a very small number of users are "in strict concurrency". For Web performance testing, these 2 concurrency scenarios typically require testing, usually by first performing a rigorous concurrency test. In the strict sense of user concurrency generally occurs in the use of more frequent modules, although the probability of occurrence is not very large, but once a performance problem, the consequences are likely to be fatal. Rigorous concurrency testing is often associated with functional testing because concurrency is often a program problem and is part of robustness and stability testing.
number of concurrent users : There are 2 common misconceptions about the number of concurrent users. One of the misconceptions is that the number of concurrent users is understood as the number of users who use the system, on the grounds that they may use the system at the same time, and that a more near-correct view is that the number of online users is understood as the number of concurrent users. The fact that online users are not necessarily associated with other users, such as users who are browsing the web, has no effect on the server, but the number of online users is one of the main bases for calculating the number of concurrent users.
5. Throughput
Refers to the sum of the amount of data transmitted over the network during a performance test. Throughput/Transfer time is the throughput rate.
6. TPS(transactionper second)
The number of transactions or transactions that the system is able to process per second. It is an important indicator to measure the system's ability to deal with.
7. Ctr
The number of HTTP requests that the user submits to the Web server per second. This indicator is a unique indicator of Web application: The Web application is a "request-response" mode, the user makes one request, the server will process it, So click is the smallest unit of transactions that the Web app can handle. If you define each click as a trade, CTR and TPS are a concept. It is easy to see that the larger the CTR, the greater the pressure on the server. CTR is just a performance reference, and it's important to analyze the impact of clicks. Note that the Click here does not refer to a single click of the mouse, because in a single click, the client may make multiple HTTP requests to the server.
8. Resource utilization
Refers to the use of different system resources, such as server CPU utilization, disk utilization, and so on. Resource utilization is the main basis for analyzing system performance Index and improving performance, so it is the focus of Web performance testing work .
Resource utilization is mainly for Web server, operating system , database server, network and so on, which is the main reference for testing and analyzing bottleneck. In the Web performance test, it is more necessary to collect the corresponding parameters for analysis.
Common metrics (refers to Web application Server, database server required test items)
Index |
Description |
Processortime |
Server CPU usage, average up to 70%, service is nearly saturated |
Memory Available MByte |
The number of available memory, if the test found that memory changes should also be noted, if the memory leak is more serious |
Physicsdisk time |
Physical Disk read-write time condition |
Web server Metrics
indicator |
description |
Requests per Second (avg Rps) |
Average number of responses per second = Total Request time/seconds |
avg time to L AST byte per terstion (mstes) |
Average number of iterations per second of a business script, someone will confuse the above |
successful Rounds | td> Successful request
Failed requests |
failed request |
successful Hits | td> number of successful clicks
Failed Hits |
failed clicks |
Hits Per Second | td> clicks per second
successful Hits per Second |
successful clicks per second |
Failed Hi TS per Second |
number of failed clicks per second |
attempted Connections |
try links |
Database Server performance Metrics
Index |
Description |
User 0 Connections |
Number of user connections, that is, the number of connections to the database |
Number of deadlocks |
Database deadlock |
Butter Cache Hit |
The database Cache hit condition |
The bottleneck definition of the system
Performance items |
Command |
Index |
CPU Limit |
Vmstat |
When%user+%sys is over 80% |
Disk I/O limits |
Vmstat |
When%iowait exceeds 40% (AIX4.3.3 or later) |
Apply Disk Limits |
Iostat |
When%tm_act is over 70% |
Less Virtual storage space |
Lsps,-a |
When the paging space activity rate exceeds 70% |
Page Break limit |
Iostat, stat |
Virtual Storage Logical Volume%tm_act exceeds I/O (iostat) 30%, when the virtual memory rate of the activation exceeds 10 times times the number of CPUs (VMSTAT) |
System failure |
Vmstat, SAR |
Page exchange increases, CPU waits and runs queue |
Stabilizing the resource state of the system
Performance items |
Resources |
Evaluation |
CPU Usage |
70% |
Good |
85% |
Bad |
90%+ |
Very poor |
Disk i/0 |
<30% |
Good |
<40% |
Bad |
<50%+ |
Very poor |
Internet |
<30% Bandwidth |
Good |
Run queue |
Number of <2*CPU |
Good |
Memory |
No page Exchange |
Good |
10-page Exchange per second of CPU |
Bad |
More Page-Swapping |
Very poor |
Popular Understanding:
Daily Visit volume
Common page Max concurrent number
Simultaneous online headcount
Access the appropriate time
Case:
A recent company project, is a portal site, need to do performance testing , according to the characteristics of the project to set out the main test items and test plan:
One is to test the maximum number of concurrent numbers that can be accepted by several popular pages (user name parameterization, set point policy)
One is to test the server under long-time pressure, the user can operate normally (user name parameterization, Iteration run script)
One is to test whether the server can accept 100,000 of users at the same time online operation, if the use of IIS as an application server, the maximum number of concurrent single can not reach 100,000 levels, it is necessary to use the cluster, multi-machine load balancing to achieve , if the application server such as WebSphere, a single can withstand the maximum number of concurrent can reach 100,000 levels, but for performance considerations or must use the cluster, multi-machine load balancing to achieve, usually there are 1 simple calculation methods, 1 connections to generate 1 sessions, Each session on the server has a memory space size setting, on NT is 3M, then 100,000 concurrent needs 300G memory, of course, the actual use of the considerationotherThe program also consumes memory, so the amount of memory you need to prepare is more than that. There are 100,000 users online at the same time, with 100,000 concurrent numbers is a completely different 2 concepts. This upstairs has been said. But how does this conversion convert 100,000 simultaneous users to how many concurrent numbers? This has to be a lot of history.LogInformation to support it. The system log needs to have the same number of online users of the log information, but also the number of user operations log information, the proportion of the 2 data is you at the same time the number of users online conversion to concurrency ratio. In addition, according to empirical statistics, for aJAVADeveloped byWEBSystem (Other I have not statistics, can not give data), generally 1 dual CPU, 2G of memory on the server to support the maximum number of concurrent concurrency of no more than 500 (this state most operations are over-the-times error and the server is very easy to downtime, in fact, no practical significance), The maximum number of concurrent operations that can be used normally (one step non-large data volume operation wait time of less than 20 seconds) is no more than 300. Assuming that your 100,000 simultaneous online user conversions are 9,000, then you need at least 18 units of this machine, not less than 30 units. Of course, if you buy a large server, which contains 200 CPUs, 256G of memory, gigabit fiber bandwidth, even 100,000 concurrent users, that speed, is definitely swish.
In addition to the severe cold 1, the light set all into the running state requires nearly 6 hours. Concrete can take 1 system to press A look, may appear the following situation:
1, server downtime;
2, client downtime;
3, from a certain time to start the server refused the request, the client is full of errors displayed;
4, reluctantly test completed, but the network congestion or test results show a very long time. Suppose the client and server between the hundred gigabit bandwidth, hundred trillion/10000=10k, that each user can only get 10K, this speed nearly 1 64K modem internet speed, and the above analysis all did not consider the background of the system, such as database , middleware and so on.
1, server: The above said that the PC server needs 50 units;
2, the network aspect: according to each user 50K, that at least 5 hundred trillion gigabit bandwidth exclusive, estimated only the network delay is probably the second level;
3, if there is a database, at least Oracle, preferably sysbase,SQLServer is definitely not the top. The database server requires at least 10 machines with 4CPU and 16G of memory;
4, if there is CORBA, then at least 10 sets of 4CPU, 16G memory of the machine, coupled with load balancing, firewalls, routers and a variety of software, in short, not a 10 million of the capital investment, it is certainly uncertain.
Such a portal system, because of the user rights, so not as Jackie said most of the static page. But as long as it is a multi-server cluster, we can calculate the load capacity of multiple machine clusters through the test results of 1 machines, with the additional consideration of load balancing and routing pressure, such as bandwidth, speed, latency, etc. But if all the changes in 1 machines, then we can only do some of the indicators on the calculation, can be easily judged from these indicators is not feasible, such as 100,000 concurrent users but only 1 hundred trillion bandwidth, then we can calculate the user only 1 K bandwidth, which is obviously not possible. But the actual results still need testing to know, after all, the system pressure and the number of users is not linear change.
The widespread use of this type of system, as well as the ability of many software to approximate the performance characteristics of the system after design, have led to a large proportion of the system's tuning in software performance (which certainly does not completely exclude further improvements in performance after some code and configuration optimizations), More of the hardware considerations, such as increased memory, hard disk raid, increase the bandwidth, and even increase the machine.
The 10M bandwidth in network technology refers to a bit calculation, that is 10M bit/second, and the speed of download is measured in bytes (byte), so 10M bandwidth conversion into bytes theoretically the fastest download speed: 1.25 M byte/seconds!
Web performance testing Basic performance metrics