Various Load Testing Tools Animesh Das May 23, 2014 Animesh Das () Various Load Testing Tools May 23, 2014 1 / 39
Outline 3 Open Source Tools 1 Load Testing 2 Tools available for Load Testing 4 Proprietary Tools 5 JMeter 6 References Animesh Das () Various Load Testing Tools May 23, 2014 2 / 39
Load Testing Load Testing Load testing is the process of putting demand on a system or device and measuring its response. Load testing is performed to determine a systems behavior under both normal and anticipated peak load conditions. A Load Test generally measures : Response Times Throughput Rates Resource Utilization Breaking Point This testing is most relevant for multi-user systems; often one built using a client/server model, such as web servers / Databases. Animesh Das () Various Load Testing Tools May 23, 2014 3 / 39
Load Testing Database Load Testing helps you design and simulate usage traffic which can be used to test your Database application infrastructure for performance, reliability and scalability. Load Testing of Database applications involves testing the performance and scalability of your Database application with varying user load. Load and performance testing analyzes software intended for a multi-user audience by subjecting the software to different numbers of virtual and live users while monitoring performance measurements under these different loads. Animesh Das () Various Load Testing Tools May 23, 2014 4 / 39
Tools available for Load Testing Tools for Load Testing Most of the load testing tools could be grouped in the following categories: IO subsystem testing tools RDBMS Level testing tools ApplicationLevel testing tools (DB Side) Application Level testing tools (Apps Side) Animesh Das () Various Load Testing Tools May 23, 2014 5 / 39
Open Source Tools Open Source Tools Swingbench is a free load generator (and benchmarks) designed to stress test an Oracle database Swing-Bench consists of a load generator, a coordinator and a cluster overview. Consists of the following: SwingBench Data Generator Trace Analyser Database Monitor CPU Monitor DB Time Monitor Animesh Das () Various Load Testing Tools May 23, 2014 6 / 39
Open Source Tools Data Generator is a utility to populate,create and load tables with semi random data. Users can specify, sequences, random text, random numbers, database columns and files as sources for tables. The program uses a xml configuration file to determine the structure of the table(s) it is to create and populate. Animesh Das () Various Load Testing Tools May 23, 2014 7 / 39
Open Source Tools Fig: SwingBench [1] Animesh Das () Various Load Testing Tools May 23, 2014 8 / 39
Open Source Tools Monitor DB is a simple SQL visualisation tool Fig: MonitorDB [1] Animesh Das () Various Load Testing Tools May 23, 2014 9 / 39
Open Source Tools Fig: Database Time Monitor [1] Animesh Das () Various Load Testing Tools May 23, 2014 10 / 39
way Fig: TPC-C Transaction Counter Animesh Das () Various Load Testing Tools May 23, 2014 11 / 39 HammerDB Open Source Tools HammerDB is an open source database load testing and benchmarking tool for Oracle, SQL Server, TimesTen, PostgreSQL, Greenplum, Postgres Plus Advanced Server, MySQL and Redis. [2]
DBMonster Open Source Tools DBMonster is an application to generate random data for testing SQL database driven applications under heavy load. Animesh Das () Various Load Testing Tools May 23, 2014 12 / 39
JMeter Open Source Tools The Apache JMeter desktop application is open source software, a 100% pure Java 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. [3] Animesh Das () Various Load Testing Tools May 23, 2014 13 / 39
SQL Load Generator Open Source Tools SQL Load Generator is used to run multiple concurrent queries against SQL Server. The user can choose the number of concurrent queries to run, provide different queries, choose SQL or domain accounts, and provide application name settings. SLG was developed using C# 3.5. Animesh Das () Various Load Testing Tools May 23, 2014 14 / 39
Open Source Tools MySQLSlap MySQLSlap is a Load Emulation Client. It runs in 3 stages : Create schema, table, and optionally any stored programs or data to use for the test. This stage uses a single client connection. Run the load test. This stage can use many client connections. Clean up (disconnect, drop table if specified). This stage uses a single client connection. Animesh Das () Various Load Testing Tools May 23, 2014 15 / 39
Proprietary Tools Benchmark Factory for Databases DELL Oracle Real Application Testing Oracle Database I/O calibration feature ORacle IO Number ( ORION ) Animesh Das () Various Load Testing Tools May 23, 2014 16 / 39
JMeter A portable tool that can run on any Java Virtual Machines Being a JVM based software, is platform independent. [4] JMeter can load test various types of servers like: Web - HTTP, HTTPS SOAP (Simple Object Access Protocol ) Database via JDBC LDAP (Lightweight Directory Access Protocol) JMS (Java Message Service) Mail - SMTP(S), POP3(S) and IMAP(S) Animesh Das () Various Load Testing Tools May 23, 2014 17 / 39
Samplers Proprietary Tools Samplers perform the actual work of JMeter. Each sampler (except Test Action) generates one or more sample results. The sample results have various attributes (success/fail, elapsed time, data size etc) and can be viewed in the various listeners. The one used for databases is JDBC Request This sampler lets you send an JDBC Request (an SQL query) to a database. Animesh Das () Various Load Testing Tools May 23, 2014 18 / 39
Logic Controllers and Listeners Logic Controllers determine the order in which Samplers are processed. Listeners perform several roles in addition to listening to the test results. They also provide means to view, save, and read saved test results. Few examples : Sample Result Save Configuration Graph Results View Results Tree Aggregate Report View Results in Table Monitor Results Response Time Graph Summary Report Animesh Das () Various Load Testing Tools May 23, 2014 19 / 39
Configuration Elements and Assertions Configuration elements can be used to set up defaults and variables for later use by samplers. Note that these elements are processed at the start of the scope in which they are found, i.e. before any samplers in the same scope. Assertions are used to perform additional checks on samplers, and are processed after every sampler in the same scope. Timers help in adding time delays in execution of threads and are of many types ranging from Fixed Timer to Gaussian Timer. Animesh Das () Various Load Testing Tools May 23, 2014 20 / 39
Pre and Post Processor The JDBC PreProcessor enables you to run some SQL statement just before a sample runs. This can be useful if your JDBC Sample requires some data to be in DataBase and you cannot compute this in a setup Thread group. The JDBC PostProcessor enables you to run some SQL statement just after a sample has run. This can be useful if your JDBC Sample changes some data and you want to reset state to what it was before the JDBC sample run. Animesh Das () Various Load Testing Tools May 23, 2014 21 / 39
Test Plan and ThreadGroup The Test Plan is where the overall settings for a test are specified. Definition of Global Variables, eg. SERVER then later referenced as $(SERVER) A Thread Group defines a pool of users that will execute a particular test case against your server. In the Thread Group GUI, you can control the number of users simulated (num of threads), the ramp up time (how long it takes to start all the threads), the number of times to perform the test, and optionally, a start and stop time for the test. ( Also scheduler ) Animesh Das () Various Load Testing Tools May 23, 2014 22 / 39
Functions and Variables JMeter functions are special values that can populate fields of any Sampler or other element in a test tree. A function call looks like this: ${ functionname(var1,var2,var3)} Variables are referenced as follows: ${VARIABLE} Animesh Das () Various Load Testing Tools May 23, 2014 23 / 39
Name threadnum samplername machineip machinename time log logn StringFromFile FileToString CSVRead XPath counter Comment get thread number get the sampler name (label) get the local machine IP address get the local machine name return current time in various formats log (or display) a message (and return the value) log (or display) a message (empty return value) read a line from a file read an entire file read from CSV delimited file Use an XPath expression to read from a file generate an incrementing number Animesh Das () Various Load Testing Tools May 23, 2014 24 / 39
intsum longsum Random RandomString UUID BeanShell javascript jexl, jexl2 property P setproperty split V eval add int numbers add long numbers generate a random number generate a random string generate a random type 4 UUID run a BeanShell script process JavaScript (Mozilla Rhino) evaluate a Commons Jexl expression read a property read a property (shorthand method) set a JMeter property Split a string into variables evaluate a variable name evaluate a variable expression Animesh Das () Various Load Testing Tools May 23, 2014 25 / 39
WorkBench Proprietary Tools The WorkBench simply provides a place to temporarily store test elements while not in use, for copy/paste purposes, or any other purpose you desire. Animesh Das () Various Load Testing Tools May 23, 2014 26 / 39
MySQL Database Test Uses the MySQL database driver. A JDBC Driver enables a Java application to communicate with the Database To install mysql-connector-java-5.1.30-bin.jar add to JMeter./lib directory The Thread Group tells JMeter the number of users you want to simulate, how often the users should send requests, and the how many requests they should send. Animesh Das () Various Load Testing Tools May 23, 2014 27 / 39
Need a valid database, database table, and user-level access to that table. Database and Database Tables created using HammerDB and used it for load testing purposes. Added ThreadGroup : Settings : Users : 50 Ramp Up Period : 1 Loop : 100 Ramp Up Period : eg. 50 users and a 10 second Ramp-Up Period, then the delay between starting users would be 200 milliseconds (10 seconds / 50 users = 0.2 user per second). Animesh Das () Various Load Testing Tools May 23, 2014 28 / 39
Fig: Thread Group Animesh Das () Various Load Testing Tools May 23, 2014 29 / 39
Adding JDBC Connection Configuration Module Add Config Element JDBC Connection Configuration Variable name (here: mydatabase) bound to pool. This needs to uniquely identify the configuration. It is used by the JDBC Sampler to identify the configuration to be used. Database URL: jdbc:mysql://localhost:3306/tpcc JDBC Driver class: com.mysql.jdbc.driver Username: root Password: password Animesh Das () Various Load Testing Tools May 23, 2014 30 / 39
way Fig: Connection Configuration Animesh Das () Various Load Testing Tools May 23, 2014 31 / 39
VariableName : mydatabase ( Variable Reference ) Query : select * from district ; Adding more than one Request Modules : JMeter sends requests in the order that you add them to the tree. Animesh Das () Various Load Testing Tools May 23, 2014 32 / 39
Fig: JDBC Request Animesh Das () Various Load Testing Tools May 23, 2014 33 / 39
Final : Listeners The final element you need to add to your Test Plan is a Listener. This element is responsible for storing all of the results of your JDBC requests in a file and presenting the results. Added Summary Report Response Time Graph Graph Results Results Tree Animesh Das () Various Load Testing Tools May 23, 2014 34 / 39
Fig: Graph Results Animesh Das () Various Load Testing Tools May 23, 2014 35 / 39
Fig: Results Tree Animesh Das () Various Load Testing Tools May 23, 2014 36 / 39
Fig: Response Data Animesh Das () Various Load Testing Tools May 23, 2014 37 / 39
way Fig: Summary Report Animesh Das () Various Load Testing Tools May 23, 2014 38 / 39
References I References [1] SwingBench. Available at http://dominicgiles.com.. [2] HammerDB. Available at http://hammerora.sourceforge.net/.. [3] JMeter Documentation. Available at http://jmeter. apache.org/usermanual/build-db-test-plan.html.. [4] JMeter for Ubuntu. Available at http://jmeter.apache.org.. Animesh Das () Various Load Testing Tools May 23, 2014 39 / 39