Load Testing for WSO2 Governance Registry
JProfiler and JMeter Tools are used to perform load tests for WSO2 Governance Registry.
To configure JProfiler in Non GUI mode:
After creating a JProfiler session, it is necessary to create triggers to get the snapshots saved from time to time. These snapshots can be analyzed after completing the tests. Use the following steps to add a trigger in JProfiler. Please note that you have to be using JProfiler7, which is the latest version currently available.
- In the Session Settings window, go to Triggers Settings.
- Click the Add Trigger button. The Create Trigger dialog box appears.
- Choose Timer as the Tigger Type and click the Next button.
- There you can configure the timer. The timer intervals are defined as 2 minutes.
- Click the Next button.
- You can define the action in the screen that displays. Click on Add Action button and choose Save Snapshot.
- Click the Ok button to proceed.
- Enter the snapshot file name and select the “add a unique number to the snapshot file name” checkbox.
- Then you can finish the Trigger Wizard.
- After completing the JProfiler Session settings, open the .JProfiler7/config.xml file and find the relevant Session ID.
- If you are using remote profiling, copy the local .JProfiler7/config.xml file into the remote .profiler7 folder.
After setting the above configurations, add the following line into the wso2server.sh file:
-agentpath:<JPROF_LOCATION>/bin/linux-x64/libJProfilerti.so=offline,id=<SESSION_ID>,config=/home/ubuntu/.JProfiler7/config.xml
Once the server is started, the snapshot file is stored under server home.
Jmap:
If you are unable to use JProfiler, you can use Jmap to measure the heap size. The following command can be used to save the heap dump:
jmap -dump:live,format=b,file=heap.bin <pid> heap.hprof
To deploy load test service:
- Download the load test project and build it [http://people.wso2.com/~chandana/org.wso2.carbon.governace.loadtest/].
- Place the load test JAR file into the
<GREG_HOME>/repository/components/dropins
folder. - Once the Governance Registry server is started, the LoadTestServcie is deployed.
- Using the deployed LoadTestServcie we can perform the following operations:
- addServices
- listService
- findService
Database size measuring script:
Once a relevant number of services are deployed into the database, the database size can be measured using the following script.
Note that this script is for MySQL database.
SELECT table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 3) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;
Load Test Steps:
- Start the Governance Registry server instance.
- Add the following number of services: 10,50,100, 500,1000, 3000, 5000, 10000 into the Governance Registry instance using JMeter script (G-Reg Load Test - Pre.jmx) [http://people.wso2.com/~chandana/Jmeter%20Script/].
- Reduce the indexing start time to 60 seconds and keep the system idle for 7 minutes after adding the services.
Test 1:
Complete the following tests and measure the execution time (execution time print in the console).
- Database Size
- Add service execution Time
- Time to list all artifacts
- Time to find specific artifact( first 3 tests search 9th position and other test searches 99th position)
- Using Heap dumps measure the heap usage.
Test 2:
For different number of services, change the client concurrency level using the JMeter script and measure the response time for “Search specific service” as mentioned above and analyze the memory using a memory snapshot.
Calculations:
- All calculations can be made using Excel and min, max and average values can be calculated using inbuilt functions
- All graphs are made using ChatGo website.