In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Performance test LoadRunner11
I. basic concepts of performance testing (terminology)
1. Concurrent Concurrency
Online Online
Parallel: multiple tasks occupy their own resources and run together
Concurrency: multiple tasks occupy the same resource, run together, and need to compete for resources
1) the difference between concurrency and online: the pressure of concurrency is an instantaneous pressure, which is generally aimed at the same type of business. Online stress is a stress situation over a period of time. 2) the concurrency pressure of 20 users is equivalent to the pressure of 200 users online. When writing a test plan, you can refer to it. For example, 2000 users are online, usually 200 users concurrently. (concurrent login, concurrent query, concurrent deletion, etc.) 2. Request response time (TTLB,Time to last byte) = client time + network time + server time unit. Generally, seconds / milliseconds can avoid network problems through private network testing, and the client will not become a performance bottleneck, so in most cases, if the request response time is long, the performance bottleneck appears on the server side. It is recommended that the Web server and the database server should be deployed separately to monitor 3, transaction response time respectively: the premise is that when recording the script, insert transaction point 4, TP: Throuthput is the total amount, the total amount of data of the cumulative time, and the total amount of data obtained by the user from the server in any given 1 second. Byte throughput (TPS): throughput per unit time / transfer time per second TPS: Transaction Per Second transactions per second (transactions per second) click rate: the number of Http requests submitted by the user to the Web server per second. Does not refer to the number of mouse clicks, for example: click a button, the server returns a page, the page includes 3 images, then the current number of clicks initiated: 1 click 3 = 4 Http requests. * .html with
Each picture is a resource. Will resend the difference between request throughput and click rate: throughput: the amount of data processed by the server per second click rate: the number of HTTP requests submitted by the client to the server per second 5, requests and responses: the client initiates a request to the server (Request), and the server returns a reply to the client (response Response). 6. Resource utilization: generally refers to the use of CPU, memory, disk, network and other major resources in the system. (understand, it is difficult)
Case: test the performance of the login module in the case of 8 users
Requirements: number of users: 8 VU
User loading method: load 1 VU every 2 seconds
Run time: all users finish running the script
Login user name: jojo
Password: bean
Action:
1) record the script login day02/login
-> Click the New icon-> New Virtual User-> default protocol
-> Create is ready to record
-> enter basic information:
Select software architecture: Internet Applications (Bramp S) default
Win32 Applications (CBG S)
Select browser type: default IE
URL Address: the web address of the system under test
Http://127.0.0.1:1080/WebTours/
Or http://localhost:1080/WebTours/
Working directory: default common tool commands for LR work path
Record into Action: default Action for the location where the script is recorded
(vuser_init initialization Action vuser_end ends)
-> OK automatically opens the browser AUT and starts recording
Pay attention to the small operation bar (the recording control pays attention to the digital change before the digital stability continues)
-> enter jojo bean
-> start transaction name login (insert transaction)-> OK
-> Login button
-> end transaction login-> OK
-> change to vuser_end mode and click Sign Off to exit
-> close browser-> Click the blue button Stop to end recording
-> Save to the newly created day02/login folder, script name: login
2) Open the console Controller and use the login script to configure the scene
Open Controller-> default manual scene mode-> set Use the Percentage Mode to... Uncheck the purpose: the number of users does not use percentage mode-> Browse button to select the script login-> OK hint: if the script is wrong You can modify-> set 8 VU: Run Mode: select Basic schedule to change Quantity to 8-> load one VU every 2 seconds: lower left window Global Schedule-> Start vusers: Start all Vusers simultaneously loads 8 virtual users by default. You need to change-> double-click Start vusers-> Edit Action-> Select the second radio button. Change to 1 Vusers every 00:00:02 (HH:MM:SS)-> OK-> Schedule Graphics Plan Preview Abscissa: Time Test time ordinate: number of Vusers virtual users loading a dotted line every 2 seconds indicates uncertainty-> set run time:-> Run until completion in Duration Run until the end (script end) Select Run for _ _ days and _ _ (HH:MM:SS) fixed time how long Run indefinitely unlimited unlimited operation The tester clicks the end-"normal test, but also needs to set the system resources monitored by Windows Resources (not configured for the time being)-> switch to the Run interface (run scene) (previously set scene by Design)-> set scene, you can run scene-> Start Scenario button and click the Vusers button to further check the running status of VU: Done. Passed 1 iteration (s) attemped: 1successed. At the end, after one iterative attempt, we successfully observed the running results of the scene. Figure: Running Vusers running virtual user Hit per Second click rate Throughput throughput click right above The penultimate icon button on the right: view Hp LoadRunner Analysis result analysis report Reports report Graphs picture Running Vusers virtual user operation Hit per Second click rate Throughput throughput Transaction Summary transaction summary Average Transaction Response Time average transaction response time
Second, performance testing strategy
Important:
Benchmark testing (single user), concurrent testing, integrated scenario testing (required for the first 3 projects)
Limit test, incremental test is secondary: fatigue strength test (in large systems), memory leak test, data capacity test. What they have in common: initiate to the system under test
1. Benchmark: it is a single-user test (key point)
Note: you still need to use the console, run the scenario, collect data automatically, and analyze the results through Analysis.
2. Concurrent testing: multiple users perform an operation concurrently (LR is accurate to the millisecond level at the same time).
Note: concurrent testing is a rigorous test, which mainly examines the ability of the system to withstand instantaneous pressure.
3. Comprehensive scene testing: it is said to be able to simulate the actual production environment in the most real way.
Integrate several elements of the scenario: multi-user, multiple scripts (at least 3, that is, doing multiple different tasks), online execution for a period of time (1 hour, 50 minutes, etc.) Note: generally, you do not need to set concurrency points. If multiple users run together, there must be concurrency. During the comprehensive scenario testing, all users cycle through the corresponding operations. For example: 100 users online synthesis scenario 100 users jointly perform operations on the system under test, of which 30 users browse the home page, 50 users query orders, and 20 users submit orders. Question: why not simulate a large number of logins? Because the user can't log in all the time, simulate the real situation. The above operations are performed by the user in a loop. Response time: there is generally a "358 principle" in the industry, if the system response time is less than 3 seconds, the user can accept it; if the response time is less than 5 seconds, the user can bear it; if the response time is more than 8 seconds, the user cannot bear it. For example: general demand indicator, no more than 3 seconds
4. Incremental testing: virtual users are loaded step by step and pressurized step by step at regular intervals (1s, 5s, 10s).
Purpose: when logging in to the test, you can increment the test
Limit testing: using concurrent testing, online testing, etc., to test the limit pressure that the system can withstand (such as the maximum number of users)
Or the maximum processing capacity that the system can achieve (such as maximum throughput).
The testing method can use incremental testing, such as testing the system with 100,500,1000 users and so on.
(also known as: touch height test)
5. Fatigue strength test: test the performance of the system for a long time under a certain strength (pressure).
Generally 724 hours, or 24 hours, 12 hours and so on.
For example: banking system, 724,365 round-the-clock operation
When examining the fatigue strength test, it is necessary to examine the average response time and the resources of each server. For example: cluster load balancing, cost reduction and above are more common test types, which often appear in the test plan.
6. Memory leak test:
Through the normal performance test, if the memory curve of the tested system is abnormal, then pay attention to its corresponding important memory indicators.
Determine if there is a memory leak by corresponding to the trend.
7. Data capacity test: use large-capacity data to add to the database to observe whether the system under test can run normally.
For example: add 200G of data to the database, and then test. Even a few T
Big data Big Data is generally T-level and P-level data.
1024Byte = 1KB
1024K = 1m
1024m = 1G
1024G = 1T
1024T = 1P
E Z Y
Benchmark testing: single-user testing
1. Checkpoints should be added to the test script.
Reason: the authentication in the LR report is only targeted at the network level, where the server receives the packet sent by the client and then sends the reply packet back to the client, but LR does not verify that the data in the reply packet is correct. Case 1: benchmark the order placing operation. First record the script and insert the checkpoint. Open AUT first and familiarize yourself with the whole business process Open VuGen-> New input URL-> record login-> vuser_init-> enter jojo and bean-> start transaction login-> Click Login-> Welcome Page: add checkpoint: select "Welcome" Jojo "Click Insert text check insert text checkpoint-> end transaction login-> Action Mode-> Click Flights-> Select City: from Denver to London-> Continue-> Continue-> start transaction buy-> Continue-> order result page add checkpoint: select" Denver for London "insert text checkpoint-> end transaction buy-> vuser_ End mode-> Sign Off-> close browser-> Stop script save: day02\ buy and then play back web_reg_find ("Text=Welcome" Jojo, ", LAST) Web_reg_find ("Text=Denver for London", LAST); checkpoint function: web_reg_find () web_ or lr_ begins with the word reg: registration function web_submit_form () requests to submit the form for the Bhammer S system, the LR function in the LR script starts with lr_ or web_. (in addition, there is the C language function strcmp) web_reg_find function, the function with the word reg is called: registration function this kind of function is special: it must be written before the corresponding request. If the checkpoint-added script runs (playback) correctly, the script is correct. (learn to debug scripts)
Demand: recurring booking of 3 tickets
Run-time Settings button in VuGen (runtime settings)
Run Logic run Logic-> Iteration Count iterations default 1 to 3
Note: only Action is looped. Log in only once
The init and end scripts are executed only once.
Note:
1. Set the current differences and contacts of Run-time Settings in the console and in VuGen:
1) if you open the script directly from the console, the Run-time Settings settings in the script are automatically displayed in the Run-time Settings of the console. (bring it over)
2) if Run-time Settings is set in both the console and the script, and the values are different, the priority of the console is high.
2. Packing value: the time interval between each iteration. Iteration: the script Action runs from the first line to the last line. The higher the Pacing value of an iteration, the less the pressure on the AUT. 3. Think time: the time interval between steps in a script. (interval between requests)
Case: benchmark for buy scripts (method 1: 5 cycles per user)
Open the VUG recording script
1) debug the script (run successfully in VuGen)
Save script file: scrip/day02/buy1
Open Controller and set up the scene
2) Open the console and load the buy script
First set the number of people: Run Mode radio Basic schedule mode
Change Quantity to 1 single user mode
3) Open the console Run-time Settings settings
Run Logic iterations 5 (priority)
Pacing value-Start new Iteration recommends setting a random 2 to 3 seconds
As soon as the previous interation ends, as long as the previous iteration ends
Concern item 3:
At fixed intervals, every 60.000 sec
Random every 2.000 to 3.000 sec
Fixed: fixed intervals interval random: random Think time: Ignore think time ignore think time choose to simplify Replay think time specific set think time strategy-> click OK 6) Global Schedule set Initialize: initialize Vuser initialize before Run (keep default) Start Vusers: Start all Vusers simulaneously on a VU default Duration: Run until completion run until the end of default-> switch to Run to start running scenario: Start Scenario 6) result analysis results: Running Vusers horizontal axis: Elapsed Time test time vertical axis: # of Vusers virtual users After the number of clicks is started Scene initialization takes time, no need to pay attention to the analysis result: Hits per Second click rate (hits per second) horizontal axis: Elapsed Time test time vertical axis: # Hits per Second click rate data is low Because it is a single-user analysis result chart: Throughput throughput (data processed by the server) horizontal axis: Elapsed Time test time vertical axis: # Bytes/sec due to short time The rule does not reflect the saving scene file: ctl/day02/buy1 opens Anlysis: the penultimate graphic button is most concerned about: transaction response time Transcation Name Average average transaction response time buy 0.23 reasonable login 0.406 reasonable details can be paid attention to the upper left corner list: various common indicators chart (first understand Will be explained later) Save the result file: result/day02/buy1
two。 Inductive benchmark:
Method 1: cycle 5 times for a single user
1) debug the script (add checkpoints and run successfully in VuGen)
2) Open the console and set Run-time Settings
3) iterations: 5
4) Pacing value: random 2-3 (interval between iterations)
5) Think time: ignore (time interval between requests)
The reason for neglect: a single user has less pressure on the system, and whether it is ignored or not has little impact on the results.
Method 2: a single user runs continuously for 1 minute. 1) debug the script (add checkpoint and run successfully in VuGen) 2) Open the console and set Run-time Settings 3) Pacing value: random 2: 3 4) Think time: ignore 5) Duration: 1 minute hint: after configuration, observe the chart status and change before the modification is successful.
3. Attention:
When iterations in Run-time Settings conflict with the VU deployment settings (Duration), Duration takes precedence. For example: Duration chooses the second item, Run for _ _ days and _ (HH:MM:SS) if you choose the first item: Run until completion or listen to Duration, it just delegates power. Duration is the first leader, and let the second leader take matters into his own hands. At this point, Run-time Settings has the final say. Duration: refers to the results in Run's Action time test report, which should be tested three times and take the middle value. (for example, 0.1 second 0.3 second 0.4 second result takes 0.3 second) above is the benchmark test.
Short answer question:
2. What are the concepts and practices of benchmarking and concurrent testing?
1) A benchmark is a single-user test, and you need to open the console to get the results in Analysis.
(method 1: single user cycle n times; method 2: single user execution n time)
2) concurrent testing is a rigorous test in which multiple users perform an operation to form an instantaneous pressure (accurate to milliseconds).
The main purpose of this paper is to investigate the bearing capacity of the system to instantaneous high pressure.
3. What is the difference between concurrent testing and online testing?
1) the difference between concurrency and online:
Concurrent pressure is a kind of instantaneous pressure.
Online pressure is pressure for a period of time.
2) the concurrency pressure of 20 users is equivalent to the pressure of 200 users online. (1:10 proportion)
As a reference when writing a test plan. 2000 users are online, designed for 200 users to be concurrent.
(concurrent operations: query, login, delete, add)
4. what is the concept and difference between throughput and click-through rate?
1) Throughput: the user gets all the data from the server in bytes (Byte).
2) Throughput / transfer time, which is the throughput, is the amount of data processed by the server per second.
3) click rate (Hits per Second): the number of Http requests submitted by the client to the server per second.
(the number of requests for one click of the mouse may be n)
Description: throughput is the total amount, which is the total amount of data in the cumulative time. Throughput reflects the processing speed and performance of the server, and it is also an important index to measure network performance. The higher the click rate, the greater the pressure on the server. Files/Doc.zip
How to add comments in a script
1) single-line comments / /
2) Multiline comments / /
First, yesterday's homework questions:
1. Thinking: the difference between QTP and LoadRunner.
1) QTP: functional testing tool (Automation)
LR: performance testing tools can test multiple users
2) QTP is concerned with the interface (UI) and objects (the concept of object library)
LR only cares about the packets (request packet, reply packet) between the client and the server.
Do not care about the object, let alone compare the attribute values of the object, only care about capturing packets (capturing data packets).
If the user interface changes, but the business logic remains the same: the QTP script needs to change, the LR script does not.
3) LR is concerned with the dialogue between the client and the server, as long as the correct network protocol is chosen (equivalent to the language of the network).
4) LR cannot be re-recorded. Recording failed. Start all over again.
Note: an error occurred during the recording process, and the recording is invalidated. Re-recording starts from New.
Record slowly and wait for the page resources to be downloaded before you proceed to the next step.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 252
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.