Jmeter-How to perform performance testing on Linux [1]

Source: Internet
Author: User
Tags nginx server

The previous approach to performing performance testing in Windows was the JMeter-a complete interface test script,

Before Windows performs a performance test, there are 1 performance test scripts to start with.

But is this performance test script directly available on Linux? Of course you can.

When is that not possible? Parameterization is not possible, because a local. csv file needs to be read, and the path needs to be modified a little.

As a result, there is another article, Jmeter-building a Jmeter test script for Linux-a total of 3 steps.

So, already, you've built a jmeter test script that's ready for Linux to use.

So this document is about how to use this "Linux-ready jmeter test Script" on Linux. It's not possible to do things like windows, so it doesn't have to be written, so write about it.

preparatory work

actions for uploading files: uploading test script files (TESTPLANFORLINUX.JMX), parameterized data Files (moives.csv)

// in the bin directory of the jmeter installation file, upload these 2 files

Action 1:$cd the/home/username/jakarta-jmeter-2.5/bin///linux command is: CD

Action 2: Upload movies.csv//linux command is: RZ

Action 3: Upload testplanforlinux.jmx//linux command is: RZ

// Upload file operation: Upload a script file for statistical test results (that is, the few written. awk script files, written in awk. )

// in the test results directory, upload these 3 files

// The test result file we set in Jmeter is saved in the following path: /.. /result/testresult.csv

Action 1:$cd the/home/username/result//linux command is: CD

Action 2: Upload getnum.awk,Success.awk,timeattribute.awk//linux command is: RZ

// Delete file operations

// in the test results directory, you must delete the first 1 performance test results files before performing the next 1 performance tests

// Why do I need to clear? Because we perform 1 rounds of performance testing each time, we only count the results of this round. It's useless to keep the old data.

Action Method 1:$rm testresult.csv

Operation Method 2:$echo "" >/home/username/jakarta-jmeter-2.5/testresult.csv

// in the test server [is the compressed nginx server , if the direct deletion (RM) out of the result file, may cause unable to continue writing results to " result file ", so " operation method 2" is a conservative and secure method. ]

Perform tests

$CD/home/username/jakarta-jmeter-2.5/bin/

$./jmeter-n-T TESTPLANFORLINUX.JMX

    • - N tells JMeter to run JMeter script in a non-graphical format
    • - T specifies the script file to run

If the Linux system prompts for performance test scripts that cannot be performed, refer to the following common permissions issues:

    • "Su" differs from "su–" , and it is best to remember to use "su–".

   when executing "su–" , this indicates that the user wants to transform the identity into rootand uses the root environment to set the parameter file. ]

    • In the jakarta-jmeter-2.5/bin directory, maximize the permissions of the jmeter file. The Linux command is:$chmod 777 JMeter
    • It is also possible that the test machine does not have Javainstalled, so install Java . [Refer to the jmeter-installation jdk-configuration Jmeter operating environment-is the premise of using Jmeter]

methods of real-time monitoring and testing

// go to the test results directory

Action:$CD/home/username/result

//Look at every 1 rows to return the results. If you return to $, the hosts are correct and the script is correct.

Operation:tail–f testresult.csv

Action: If you need to abort live view, execute the shortcut key CTRL + C

// real-time view total number of results returned. For example, in the process of running a script to see how many records are currently returned. For example, be sure to see how many records are returned after the script has finished running.

Operation:wc–l testresult.csv

Jmeter-How to perform performance testing on Linux [1]

Related Article

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.