How to build and use a JMeter test environment (beginner)

Source: Internet
Author: User
Tags generator sql server driver test web server apache tomcat

I. Description of the tool
The Apache JMeter is a 100% Java desktop application designed to load the functional characteristics of the tested software and measure the performance of the software being tested. Design JMeter was designed to test Web applications, and later expanded other functions. JMeter can complete performance testing for static resources and dynamic resources (Servlets, Perl scripts, Java objects, data query s, FTP services, etc.). JMeter can simulate a large number of server load, Network load, software object load, complete test software performance through different load types. and JMeter provides graphical performance analysis.
Ii. use of the environment
JMeter can be run on Solaris, Linux, Windows (n, NT, 2000,2003). jdk1.4 above. This article describes the environmental setup steps for using JMeter to test the Windows environment with Web server and DB server, as well as getting started with JMeter for stress testing.
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, this click the default installation, general installation to C:/Program Files/java directory.
On the desktop select "My Computer" (right), advanced, environment variables, in the "System variable"---> "new", in the variable name input: 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, and 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 OK;
V. Apache TOMCAT Installation
Download Apache-tomcat-5.5.20.exe Direct click on the default path installation, generally installed in C:/Program files/apache Software foundation/tomcat 5.5 path can be.
Vi. installation of JMeter
Extract jakarta-jmeter-2.2.zip files to C disk, the article is extracted to the c:/jakarta-jmeter-2.2 directory.
On the desktop select "My Computer" (right), advanced, environment variables, in the "System variable"---> "new", in the variable name input: jmeter_home, variable Value input: c:/jakarta-jmeter-2.2, and 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.
Installation of Sqljdbc Drive
Because the need to test MS SQL 2005, so you need to install SQLJDBC driver, you can download Sqljdbc_1.1.1501.101_enu.exe directly, click can be extracted directly to the C:/Program files directory, and then modify the add Classpath =c:/program files/microsoft SQL Server Driver/sqljdbc_1.0/enu/sqljdbc.jar JDBC, and then OK.
It is also generally necessary to copy the C:/Program Files/microsoft SQL Server, JDBC Driver/sqljdbc_1.1/enu/auth/x86/sqljdbc_auth.dll, in 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 up the ICP/IP protocol startup after the database is installed, as follows:
(1) Open SQL Server Configuration Manager;
(2) Go to SQL Server network configuration->protocols for SQLEXPRESS;
(3) Set TCP/IP to Enabled (enable);
(4) Double-click TCP/IP entry and go to IP addresses page
(5) The TCP port is set to 1433 in IP all;
(6) Restart the service;
How to use the JDBC driver correctly, see also: 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 settings
As a pure Java GUI application, JMeter for CPU and memory consumption is still very alarming, so when the need to simulate thousands of concurrent users, the use of a single machine to simulate all the concurrent users is somewhat inadequate, and even caused the Java memory overflow error. However, JMeter can also use multiple machines to run so-called agents to share the pressure of the load generator itself, like LoadRunner, and to get a larger number of concurrent users. According to the JMeter official document, you need to complete this configuration 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 that one of the machines acts as a controller, and that the other Machines act as agents. Then run the Jmeter-server.bat file on all agent machines-assuming we use two machines 192.168.0.1 and 192.168.0.2 as agents;
2. Locate the bin directory in the JMeter installation directory of the controller machine, and then locate the Jmeter.properties file and open it using Notepad or other text editing tools;
3. Find the "remote_hosts=" string in an 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 is 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 go to the Run-> Remote Start menu item.
In the implementation process, you need to be careful to set the path system environment variables, or you will be prompted to find Rmiregistry.exe, this is the RMI registration program, in the JDK bin directory. Also note that 1099 ports are not disabled.
See also: http://www.informit.com/guides/content.asp?g=java&seqNum=274&rl=1
Ix. JDBC Connection Configuration
When testing DB server performance, set the database URL and JDBC driver class correctly, generally 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 user names and passwords that open the database.
Note: Please install the SQLJDBC driver correctly.

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.