"JMeter" JMeter running under Linux

Source: Internet
Author: User

Before using JMeter to do performance testing, basically use their own laptop.

The following analysis is carried out considering the network transmission and utilization of system resources:

1 on the notebook, start-cmd "ping Server" to get the transfer time. "Ping the Server" on a Linux machine to get the transmission time, the two time is similar, think does not affect the test result

2 generally I used to test the Linux test machine and notebook computer, are 4 cores 8G.

But! Today the company network is very bad! Seriously affected my test. Endurance, simply on the Linux test calculation.

Just one line of command: SH jmeter.sh-n-T http.jmx-l result_*.jtl

Steps:

One installation JMeter

1 Add the JMeter of your notebook to the compression pack Jmeter.zip

2 uploading Jmeter.zip to a Linux server: I uploaded it to/opt/soft in RZ mode.

3 Unzip, enter path/opt/soft/jmeter/bin

4 See if Jmeter.sh is able to execute, and if it cannot add execute permission, I chmod 777 jmeter.sh directly, can use SH jmeter.sh-v to detect whether the command is available.

Ii. writing a test plan

1 in GUI mode, create a new test plan, save and upload to the Linux machine corresponding directory, can add the corresponding timer in the test plan, aggregation report and so on.

2 Find your test plan in the Linux directory, vim open for editing

<stringprop name= "Threadgroup.num_threads" >200</stringProp>   number of threads <stringprop name= " Constanttimer.delay ">100</stringProp> fixed timer at the time interval of the added components of the corresponding parameters can be found in the inside, for parameter adjustment as long as the edit here is OK.

Three result files

The result file is a previously saved RESULT.JTL format file

The file can be viewed using the aggregated report in GUI mode, you can open the Add Aggregation report, click "Browse ..." on the Add a thread group, such as test plan, GUI interface, JMeter button to find the Jtl file you just generated. The statistics results are analyzed.

Four here are some of the commands we can use when running test scripts in non-GUI mode:

    • -H help print out useful information and exit
    • -N Non-GUI mode run JMeter in non-GUI mode
    • -t test file, JMeter test script file to run
    • Files that record results with-l log file
    • -R remote execution, starting remote service
    • -H proxy Host, setting up the proxy host used by JMeter
    • -p proxy port, setting the port number of the proxy host used by JMeter

Example:jmeter-n-t test1.jmx-l logfile1.jtl-h 192.168.1.1-p 8080

Five questions

1) Error in Nonguidriver Java.lang.NullPointerException the cause of this error, there are two scenarios: Scenario 1, the low version of JMeter running a high-version test plan (the test plan was compiled on a higher version of JMeter). Workaround: Run the plan with the same or a later version of JMeter. Scenario 2, a test plan generated using a third-party plug-in is run on a jmeter that does not have the third-party plug-in. Workaround: Install the plug-in on JMeter or rebuild the test plan that does not contain the plug-in. 2) wrote a SCF pressure test jar package, because the network communication relationship, put on the same server to run. It didn't take long to see a process CPU soar to 600% (8 cores) and load to more than 50. The service side has not been able to deal with. Thinking that the service is not going to look carefully, CPU more than 600 of the process is my jmeter execution command, because I did not limit on the jmeter side, so the request went crazy. Later, the timer is added, limiting the number of requests per second, and the service is functioning properly.

"JMeter" JMeter running under Linux

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.