Using Apache JMeter to perform load testing against database
Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions. Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load. This tutorial will only demonstrate a simple SQL load testing example against Oracle via JDBC. Step 1: Download Apache JMeter The Apache JMeter is downloadable at http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi . We chose the binary version on 2.3.2 for our windows xp workstation. Step 2: Installation The installation could be done by extracting the downloaded zip. That’s it. Step 3: JDBC access to oracle database To conduct the load testing against oracle database, setting up JDBC connection is required. It’s also easy to do that: copying ojdbc14.jar at $ORACLE_HOME/jdbc/lib to folder lib under Apache JMeter installation destination. Step 4: Start Apache JMeter Launching batch file jmeter.bat in folder bin will start Apache JMeter as following.
OraclePoint.com
Step 5: Adding new “Thread Group”
OraclePoint.com
For my testing example, I had the following configuration about “Thread Group” Number of Threads(users): 10 Ramp-Up Period (in seconds): 1 Loop Count: 10 Step 6: Adding JDBC connection
OraclePoint.com
OraclePoint.com
The JDBC setting for this example are:
Database URL: jdbc:oracle:thin:@your_db_server_IP:1521:jonathan JDBC Driver class: oracle.jdbc.driver.OracleDriver Username: scott Password: tiger
Step 7: Adding JDBC request
OraclePoint.com
In Query box, you can type any sql you want to test against oracle database. Step 8: Adding aggregate report
OraclePoint.com
Step 9: Saving Test Plan
OraclePoint.com
Step 10: Run Testing
OraclePoint.com
OraclePoint.com
In Summary This is quite simple demo to show how to use Apache JMeter to do loading test against oracle database via JDBC. Apache JMeter offers a way to test SQL loading and performance. By examining above report, we have no idea to tell that throughput at 33.8/min is good or not. The feasible way to use Apache JMeter more effectively is to perform typical sql statement on idle time and peak time to get threshold about performance. And, those threshold will be the criteria to evaluate further sql loading test and performance.
OraclePoint.com