JMeter Notes 1

Source: Internet
Author: User
Tags response code

Using JMeter distributed performance testing      as a pure JAVA GUI application, JMeter's CPU and memory consumption is staggering, so when you need to emulate thousands of concurrent users, Simulating all concurrent users with a single machine can be a bit of a problem, even causing a Java memory overflow error. However, JMeter can also share the pressure on the Load Generator itself by using multiple machines to run the so-called Agent, like LoadRunner, to get a larger number of concurrent users. Depending on the signature of the official JMeter document, you need to do this yourself, but don't worry, it will be very simple ^_^  1. Install JMeter on all machines that expect to run JMeter as Load Generator and determine one of the machines as Controller, other machines as agents. Then run the Jmeter-server.bat file on all the Agent machines-assuming we use two machines 192.168.0.1 and 192.168.0.2 as agent; 2. In the controller machine's JMeter Locate the bin directory under the installation directory, and then locate the Jmeter.properties file, and use Notepad or other text editing tools to open it;  3. Find the string "remote_hosts=" in the open file, and you can find a line like "remote_hosts=127.0.0.1". The 127.0..0.1 represents the machine running the JMeter Agent, which needs to be modified to "remote_hosts=192.168.0.1:1664,192.168.0.2:1664"--1664 of which are JMeter Default RMI port number for communication between controller and Agent;  4. Save the file, restart the Jmeter.bat on the controller machine, and go to the Run-and Remote Start menu item.  jmeter trial Record-important components introduction     Script editing, you should have been exposed to a lot of jmeter components, such as "thread Group" and so on. Components are the main features of the JMeter, the various logic of the script, the setting of various parameters at run time, the monitoring of the operation, by adding components to the test plan and configuration to achieve, the following are important components of the introduction.  1, threadingThe concept of groups     thread groups is equivalent to the "VUser group" in the LoadRunner controller run scenario, right-clicking the test plan, selecting Add-Thread group, joining a thread group, joining a thread group, The parameters you need to set are as follows: number of threads--number of impersonated users (number of concurrently running threads), number of cycles--cycles per thread, ramp-up Period--the time required for all impersonated users to run, if set to 10 users, with a value of 100s, A user thread is started every 10s. After the "scheduler" hook, there will also be a timer, specify the start time and end time, specifically see JMeter help.  2, controllers       in general, a thread group will have several requests (typically, such as HTTP requests) that can be combined with a logical controller, and the request can be placed directly under the thread group. The controller mainly has "if controller", "Loop controller" and so on. Right-click the thread group, select Add-Logical controller, you can select various controllers, and if it is a loop controller, the request under the controller can be executed in a loop.  3, HTTP request     Click a thread group or a controller, choose Add-Sampler-HTTP request, set the parameters for the HTTP request. For a POST request, or a GET request with a URL with parameters, its parameters can be added in the "Send parameter with Request:" column. For example  http://www.xxxx.com this request, its parameter list is to add two parameter pairs: username (xxxxx), Target (http://www.xxxxx.com).       There is one more important option, "get all the included resources from an HTML file", which, when checked, loads all the static resources contained in the HTML.  4, timers     timers can be placed under the thread group and controller to set the time delay, and if placed under a controller, each request under the controller is deferred for a specified time. Timers include fixed timers and other types of timers, please refer to JMeter Help for details.  5, listeners     listeners are primarily used to monitor the execution results of jmeter individual requests. Can be placed in the thread group, the controller or the request below, put in different places, the scope of the listener also varies. Commonly used have aggregated reports, aggregate graph, use the table to see the results and look at the results tree. Aggregated reports show that each request is in each loopGeneral statistics, such as average response time, average throughput, etc. aggregate graph is similar to the aggregation report, the graph display is added, the information of each request execution is recorded by the table view results, and the view result tree is more careful, similar to the display of the truncation tool, Displays the URL, content, and response information for the request.  1. How does  jmeter work? Submits a request to the server, and the result returned from the server retrieval request.  2. The role of  jmeter?     JMeter can be used to test the performance of static or dynamic resources (files, Servlets, Perl scripts, Java objects, databases and queries, FTP servers, or other resources). JMeter is used to simulate the ability to attach high loads on servers, networks, or other objects to test the compression capabilities of their services, or to analyze the overall performance of the services they provide under different load conditions. You can use the graphical interface provided by JMeter to analyze performance metrics or test server/script/object behavior under high load conditions.  3.    how can I see the script examples provided by JMeter? Under the \jmeter\jakarta-jmeter-2.0.3\xdocs\demos directory.  4. How do I set the number of concurrent users?     Select the test Plan node for the left tree in the visual interface, right-click and select the Add-> Thread Group, where the number of threads parameter is used to set how many users are sending the request.  5. Operating instructions for JMeter?    jmeter at run time, there is a small box in the upper right corner, which is run as green, and the box is white when finished running. 6. What is the role of  user parameters?     Improve script usability  7. In result, there will be a color font of HTTP response code, explain what? The HTTP response code is the HTTP return value, the color font is more noticeable, can use the user quick attention. Like a green 302. In this step, the return value is taken from the local catch, not the server.  8. How to calculate ramp-up period time? Ramp-up period is the total time interval, in seconds, that occurs for each request. If number of threads is set to 5 and ramp-up period is 10, then eachThe interval between requests is 10/5, which is 2 seconds. Ramp-up period is set to 0, which is simultaneous concurrent requests.  9. What is the difference between get and post?     They are 2 different implementations of the HTTP protocol. Get refers to the server getting the required parameters from the request URL. As you can see from the request in result, get can see the parameters, but the post is actively sending parameters to the server, so these parameters are not generally seen. 10. What are the causes that could lead to error generation?    a.   HTTP errors, including non-responsive, results not found, data errors, etc.;   b.   JMeter itself causes errors. 11. Why is the total value in the aggregate report result not a true sum? JMeter the definition of total in the result is not exactly the sum, for ease of use, its value represents the column's representative value, such as the Min value, and it's total is the minimum value of the column. Is the meaning that total has in each column.  12. is the thread number of  jmeter a feature that provides multiple different user concurrency? No, Thread number simply refers to concurrency, and if you need to implement multiple different user concurrency, we should use other methods, such as the way to create a CSV file outside of JMeter.   13. At the same time concurrent requests, if you need to simulate different users simultaneously to different server concurrent requests, how to implement it? The     method is flexible, and we can pre-write different servers in thread. or write a fixed variable value to a CSV file beforehand, which can also be easily modified. Then add the file to user Parameters.  14. What does User parameter mean by dummy?       The next line that simulates reading a file when its specific content is ${__csvread (${__property (User.dir)}${filename},next ())}. 15. What should I do when a test object jumps between multiple servers?     When the program runs, some HTTP and implicit functions carry additional server IPs, which we can get from their return values.  16.   Why is the test object an HTTP and https promiscuous occurrence?    https is a plusProtocol, HTTP is generally not recommended for security, but in some places, using HTTPS is too complex or difficult to implement, using the HTTP protocol.   17. What is the default port for HTTP and HTTPS? The default port for    apache Server (Http) is 80;   ssl (HTTPS), which is the default port of 443.  18. Why do some pages fail when run, but don't affect the results at the end?     Reasons are more, it is worth mentioning that because there is no dependency on the mainstream page, so even if such a page error, it will not affect the operation of normal results, but this will affect the results of the test and analysis results.  19. Why did the script start running with errors and later scripts to run?     There are settings in the thread group, and if Continue is selected, the entire thread will run until the end, even if there is an error in the previous script. Selecting Stop thread ends the current thread, and selecting Stop test ends all thread. The recommended option is stop Thread.  20.     in regular Expression extractor you will see that the value of the template is $1$, which means    $1$ refers to the value in the first (). If regular expression has more than one value, you can avoid unnecessary hassles with this method.  21.   What does the (. *) in  regular expression mean?     That is a regex (regular expression). ’.’ Equivalent to the '? ' in the SQL language, indicating dispensable. ' * ' means 0 or more. ' () ' indicates that a value needs to be taken. (. *) to express a string of any length.  22.   What to note when reading regular expression?     must ensure the absolute uniqueness of the values taken.  23.     How can I tell what situation I need to add regular Expression Extractor?     Check the Send Parameters in HTTP request, if there is a parameter that is not given in the previous page, it will be found in the original file,and add regular Expression extractor to the HTTP request of its previous page.  24. What does it mean when an empty HTTP request is sometimes present in a script that gets automatically?     is because there are some errors in getting the script, which is why the script tool. This error is not involved in running at run.  25. Why is there a rate of N/A in the running results?     may be jmeter due to its own problems, running again can get the correct results.  26. What are the common HTTP error codes?     400 cannot resolve this request.     403 Forbidden: Access is denied.     404 Cannot find a file or directory.     405 The HTTP action used to access the page is not licensed.     410 file has been deleted.     500 Server internal error.     501 Header value specifies that the configuration is not executed.     An invalid response was received by the 502 Web server as a gateway or proxy server.   27. What does the send parameters in the Http request refer to?     refers to the values written in code and the values obtained in the custom variables, which are the parameters needed to run the page.   28.parameters in the page is constantly passing?     Yes. After the parameter is generated, it is passed to the desired page in the page. So we can catch it when the dynamic parameter is generated, or it can be captured on the previous page of the desired page. (However, there may be errors, preferably in the resulting page fetch)   29. Is the user operation fully simulated when using the JMeter test? Does the result be exactly the same as the user's operation?     Yes. The JMeter fully simulates the user operation, so the operation records are all written to the DB. Error data can be generated when a run fails, depending on whether the script check is rigorous or the error data goes into DB, causing a lot of trouble for the program to run.  

JMeter Note 1

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.