Introduction
The goal of performance testing is to load the system sufficiently so that we can be confident that we will not face any issues in production. This also goes hand-in-hand with monitoring; testing in a representative environment will give us an indication as to how the system will behave. We can then monitor the production environment for the same behaviors, and will be better placed to describe the patterns we see. Load testing should not be performed as a "success or fail" activity, but should be used to develop a deeper understanding of how user requests use up the resources available to the SOA Suite application. It is important that any monitoring performed on a testing system does not interfere with its performance, but we strongly advocate having comprehensive monitoring in your production environment. Replicating this monitoring in the test environment should be sufficient to give you all the metrics that you need.
When designing a set of tests, it is important to ensure that the tests match the real life pattern of use as much as possible; this includes parameters such as the following:
- Number of requests per second
- Size of requests
- Pattern of requests
While testing, we want to monitor the behavior of the test system, looking at things such as the following:
- CPU usage
- Free memory
- Resource usage (database connections, JMS connections, and file handles)
- Disk usage
For more information on the metrics refer to Chapter 2, Monitoring Oracle SOA Suite.
SOA Suite comes bundled with a set of testing tools; the soa-infra
web application allows you to fire http
requests on composites (go to http://our-soa-server-1-ip:7001/soa-infra
, and give it a whirl), and Enterprise Manager Fusion Middleware Control will allow us to test the flow of a SOA composite, and ensure that all of the components are available and linked together. However, this leaves us with a gap—how can we apply sufficient levels of load to be confident that our composite will stand up to the production load? While Enterprise Manager provides a basic end-to-end testing framework, it is not primarily a testing framework; it can affect how your application behaves and its results are not always reliable. So in this chapter, we'll focus on using the open source tool Apache JMeter. We will start with how to create simple performance tests for your SOA application, and then move on to designing a suite of tests that will enable us to simulate a realistic user load.
When performance testing a system, our goal is to measure the performance of the system under test, not the performance testing framework itself, and we want to minimize any overhead that the performance testing and monitoring frameworks have on the system. It is therefore important that we ensure we have sufficient load generating capacity, so that when we say that the limit of the system is 5000 requests per second, we are sure that it is the limit of our SOA Suite application, and not the load testing framework; that is 5000 requests per second. For this reason, we have recipes in this chapter on using multiple boxes to generate load for testing, and on using Cloud servers, such as EC2, to generate the load.