In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
The agile technology era requires test developers to shorten release time and streamline workflow while improving product quality. Developers are now completing the end-to-end cycle on their own in a short period of time, and are constantly releasing new fixes and features.
One of the ways test developers can save time is to reuse as many existing scripts as possible. This saves time in creating new scripts and automates them.
In general, you can test an application with many available tools and get reports on performance levels and tipping points. Like most tools, you need to exit what you are running and be thoroughly prepared for testing. Today, let's talk about how a common tool, LoadRunner, can be tested under heavy loads.
First of all, what is a load test?
The load test is to test the change of the system performance by gradually increasing the system load, and finally determine the maximum load that the system can bear when the performance index is met. for example, the response time for accessing a page is no more than 1 second, and the load test is the maximum number of concurrent users that the system can withstand when the response time is 1 second.
The goal of load testing is to determine and ensure that the system can run normally even if the maximum expected workload is exceeded, and to evaluate the performance characteristics of the system.
Here are a few basic concepts about load testing:
Throughput: a quantitative description of the server's concurrent processing capacity (in reqs/s), the number of requests processed per unit time.
Number of concurrent connections: the maximum number of requests allowed at a certain point in time, which is commonly used to measure the system's ability to process requests concurrently, should be distinguished from the following number of concurrent users.
Number of concurrent users: a user may have multiple concurrent connections. For example, IE8 currently supports 6 concurrent connections.
Average time for user requests: an average time from initiating to receiving processing results for a large number of user requests. The best user perception is no more than 3 seconds by default on the web page.
Average server request processing time: the average time it takes to process a request, which can be used to measure business logic complexity and machine performance metrics.
Let's learn more about what is LoadRunner?
LoadRunner is a load testing tool suitable for a variety of software architectures, which measures the performance of the system from the aspects of response time, throughput, the number of concurrent users and performance counters, and assists users to optimize the system performance.
Principle: LoadRunner identifies and finds problems by simulating thousands of users to implement concurrent load and real-time performance monitoring, optimizes performance and speeds up the release cycle of the application system.
Composition: LoadRunner mainly consists of three foreground functional components, namely VuGen (virtual user script generator), Controller (test controller) and Analysis (result analyzer). The system will automatically call the background functional components LG (load generator) and Proxy (user agent) to complete the performance test.
How to use LoadRunner to implement heavy load testing?
Step 1: configure system parameters
In the case of large concurrent users, the following problems occur:
1) when using the netstat command, you can see many Socket in the "WAIT" state.
2) connection fails when the load increases
3) the number of handles of mmdrv increases with the running of virtual users.
4) there is a "No buffer space available" error message when establishing a connection
Solution method
Edit the following registry key:
1. To avoid the "No Buffer Space Available" error, you need to configure as follows:
1) modify the registry:
* set "HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Services\ tcpip\ Par"
Ameters\ TcpTimedWaitDelay "is 30
* set "HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Services\ tcpip\ Par"
Ameters\ MaxUserPort "is 65534
* in "HKEY_LOCAL_MACHINE\ SYSTEM\ ControlSet001\ Control\ Session"
Manager\ Sub Systems\ Windows "set SharedSection to 4096
2) set the "SHUTDOWN" mode to "ABRUPT" by adding the following function at the beginning of each script
Web_set_sockets_option ("SHUTDOWN_MODE", "ABRUPT")
Step 2: configure LR
1) script runtime settings
Check "send message only when error occurs" when handling messages
Disable snapshot on error
Uncheck "define each step as a transaction"
Uncheck "simulate browser cache", check "simulate new user on each iteration" and its suboptions
2) change the default mode of "Mode=HTML" in the web_url function in the script to "Mode=HTTP", which will reduce the pressure on the LG machine (without parsing HTML)
3) web page breakdown will be disabled in diagnostics- > configuration of controller
4) in Controller, use Tools > Options > Run-Time Settings to restrict the initialization of virtual users on all LG at the same time, and the settings will be obtained by each LG. The purpose of this is to avoid excessive utilization of LG system resources in the initial stage of script execution.
5) limit the number of errors stored by controller at run time. This is achieved by modifying the [output] item in wlrun.ini:
FlagLimitOutputMessages=1
MaxNumberOfOutputMessages= (default is 10000)
6) modify the sampling rate of monitor through Tools > Options > Monitors in Controller, which will reduce the CPU utilization of Controller during the test run, as shown in the following figure:
7) modify the ExportMessagesToFile=1 redirect output information in wlrun7.ini to a .txt file instead of to a MDB file
In addition: turn off anti-virus and anti-spyware on Controller and LG, about running unwanted Windows services on above computers; do not run virtual users on Controller; do not open Error/Output windows frequently, as this will increase the number of additional database connections on Controller these are all useful suggestions for successful heavy load testing.
Step 3: modify the script
1) in load testing, it is very important to ensure the network communication between Controller and Generator. Large amount of information (error message,output message) and large concurrent load testing has a great negative impact.
Such as the following two examples
Remove the script that prints the information in the script. For example, the following code is called every iteration, which has a negative impact on the operation of a large number of concurrent users.
Controller handles the information of all virtual users, which greatly degrades the performance of Controller. Here is a similar code:
These statements should only appear when the script is debugging, not in the script during the load test, and comment them out before the formal load test.
2) remove all calls to sleep () in the script and use lr_think_time () instead of .lr _ think_time to give control to LR, that is, LR can do other useful things when Vuser sleeps. Do not remove lr_think_time: use this function to simulate the load more accurately and put relatively less pressure on LG
3) web_reg_save_param and web_reg_find () functions:
Add the "Notfound=empty" parameter to web_reg_save_param ().
Add "Savecount=some_parameter_name" to web_reg_find (). If you want to know whether it is successful, you can use atoi (lr_eval_string ("{some_paramater_name}")) to measure it.
Step 4: set the group policy
The following occurs during a heavy load test:
● produces a lot of errors, and the amount of data is larger than 1GB.
If ● produces about 1000 errors per second, the behavior of Controller will be difficult to predict.
● stress tests generate a lot of running data
These problems can be avoided by setting a reasonable group policy. Here is an example.
The scenario is 1000 virtual users, running with one Group
At this point, divide the Group into two Group:
G1-> 100 Vusers
G2-> 900 Vusers
These two groups can generate the same load as the original group. For G2, add the following parameters to the group command line:
-disable_data-disable_messages
_ disable_data: let this group send no messages, no online messages, no offline messages.
_ disable_message: make this group not send any information (error, log) to Controller
Note: using the command line options above will prevent the LG from sending online and offline information to congtroller. In this way, the analysis data of the virtual users on this group cannot be collected.
Summary:
Through a period of learning found, combined with the user manual of LR, and find more information on the Internet, watch more learning videos, and then more hands-on operation. Some operation steps of LR will be done slowly. This is the so-called "practice makes perfect". As for the analysis results, there are many things involved, which depends on long-term experience and learning. If you persist in doing, learning, and asking questions, you will gain a lot. Come on!
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: 0
*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.