"Go" JMeter Getting Started: How to build and use JMeter test environment

Source: Internet
Author: User
Tags microsoft sql server 2005 test web server apache tomcat

I. Description of the tool

Apache jmeter is a 100% Java Desktop application designed to load the features of the tested software and measure the performance of the software being tested. The design JMeter was originally designed to test Web applications and later expanded other functions. JMeter can perform performance tests for static and dynamic resources (Servlets, Perl scripts, Java objects, data queries s, FTP services, and so on). JMeter can simulate a large amount of server load, Network load, software object load, and fully test the performance of the software through different loading types. and JMeter provides graphical performance analysis.

 Second, the use of the environment

JMeter can run on Solaris, Linux, Windows (98, NT, 2000,2003). jdk1.4 above. This article focuses on building steps for the environment of Web Server and DB server that use JMeter to test the Windows environment, and getting started with stress testing using JMeter.

  Third, software download

JDK1.5 http://java.sun.com/javase/downloads/index.jsp

Apache Tomcat 5.5 http://tomcat.apache.org/download-55.cgi

jakarta-jmeter-2.2 http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi

Sqljdbc_1.1.1501.101_enu.exe http://www.microsoft.com/downloads/details.aspx? familyid=6d483869-816a-44cb-9787-a866235efc7c&displaylang=en

  Iv. Installation of JDK

Download Jdk-1_5_0_09-nb-5_0-win-ml.exe, which is installed by default and is typically installed in the C:\Program Files\java directory.

On the desktop select "My Computer" (right-click), Advanced, environment variable, in "System variables"---> "new", enter in variable name: CLASSPATH, variable Value input: C:\Program files\java\jdk1.5.0_09\lib\dt. JAR; C:\Program Files\java\jdk1.5.0_09\lib\tools. JAR; C:\Program Files\java\jdk1.5.0_09\bin; then press "new", enter in the variable name: Java_home, enter in the variable: C:\Program files\java\jdk1.5.0_09, modify the PATH variable, Add%java_home%/bin; then make sure;

  V. Apache TOMCAT Installation

Download Apache-tomcat-5.5.20.exe Direct Click to follow the default path to install, generally installed in the C:\Program files\apache software foundation\tomcat 5.5 path.

  Vi. installation of JMeter

Unzip the Jakarta-jmeter-2.2.zip file to the C drive and unzip it to the C:\jakarta-jmeter-2.2 directory.

On the desktop select "My Computer" (right-click), Advanced, environment variable, in "System variables"---> "new", enter in the variable name: jmeter_home, enter the variable value: C:\jakarta-jmeter-2.2, then modify the CLASSPATH variable, Add%jmeter_home%\lib\ext \apachejmeter_core.jar;%jmeter_home%\lib\jorphan.jar;%jmeter_home%\lib\ to the variable value Logkit-1.2.jar; Then make sure you can.

  Vii. installation of Sqljdbc Drive

Because you need to test Ms SQL 2005, so you need to install the SQLJDBC driver, you can download the Sqljdbc_1.1.1501.101_enu.exe directly, click can be extracted directly into the C:\Program files directory, Then modify the Add classpath =c:\program Files\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.0\enu\sqljdbc.jar, and then OK.

It is also generally necessary to copy the C:\Program Files\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.1\enu\auth\x86\sqljdbc_auth.dll under the directory to C # Windows\System32, otherwise you will be prompted not to find Sqljdbc_auth.dll.

Using JDBC to connect to the MS SQL 2005 database, you need to set the ICP/IP protocol to start after the database is installed, as follows:

(1) Open SQL Server Configuration Manager;

(2) Go to SQL Server 2005 Network configuration->protocols for SQLEXPRESS;

(3) Set TCP/IP to Enabled (enable);

(4) Double-click the TCP/IP entry to go to the Addresses page

(5) TCP port is set to 1433 in IP all;

(6) Restart the service;

How to properly use the JDBC driver can be found in: http://msdn2.microsoft.com/zh-cn/library/ms378526.aspx

At this point, the JMeter test environment is basically installed, and the environment can test Web server and DB Server (MS SQL2005).

VIII. Distributed Web Server stress test setup

As a pure Java GUI application, JMeter's CPU and memory consumption is staggering, so when it comes to simulating thousands of concurrent users, using a single machine to emulate all concurrent users is a bit of a problem, and even causes 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 make sure one of the machines acts as a controller, and the other machine as the agent. 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 agents;

2. Locate the bin directory under the JMeter installation directory of the controller machine, 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:1099,192.168.0.2:1099"--1099 of which are jmeter The default RMI port number for communication between the controller and the agent;

4. Save the file and restart the Jmeter.bat on the controller machine and enter the run-to-Remote Start menu item.

In the specific implementation process, you need to pay attention to set the path system environment variables, otherwise you will be prompted to find Rmiregistry.exe, this is the RMI registration program, in the bin directory of the JDK. Also be aware that port 1099 is not disabled.

See also: http://www.informit.com/guides/content.asp?g=java&seqNum=274&rl=1

  Nine, JDBC Connection Configuration

When testing DB server performance, set the database URL and the JDBC driver class correctly, as follows:

Database Url:jdbc:sqlserver://192.166.6.37:1433;databasename=jia_online;

JDBC Drive Class:com.microsoft.sqlserver.jdbc.SQLServerDriver

Username and password are the user names and passwords that open the database.

Note: Please install the SQLJDBC driver correctly.

Go jmeter Getting Started: How to establish and use a JMeter test environment

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.