Load testing the application server
Use the Test Tool to measure application server performance by simulating the load that would be generated by users performing multi-step interactions in your NexJ deployment. The Test Tool evaluates how your application server performs under varying levels of stress to identify and prevent performance bottlenecks.
The Test Tool analyzes application server performance using a series of metrics. These include the number of tests and iterations, number of requests processed, rate of requests processed, and number of errors encountered. To help you assess the efficiency and stability of your application server, the Test Tool replicates thousands of users simultaneously performing actions in your NexJ CRM deployment.
The Test Tool is available in NexJ Studio. To access the Test Tool, click the arrow next to the Run Tool button .
Scripts for load tests
The Test Tool evaluates application server performance by executing load test scripts. Each test script is a set of instructions that reproduce user interactions with a NexJ application.
Run test scripts on your deployed application server to:
- Identify potential performance issues.
- Ensure application customizations perform as expected.
- Determine the need for hardware upgrades.
- Test different stages of the development cycle to ensure that the latest builds perform as expected and isolate detrimental code changes.
- Ensure that the current application server configuration is capable of supporting user and load requirements.
Test scripts are XML files with a .test extension. They contain blocks of Scheme code in <Script>
elements which are executed by the Test Tool. The enclosing XML is used to specify execution order, conditions, and time delays between blocks.
They are located in the following directory: nexj_studio/workspace/your_project/meta/tests
.
Test scripts are model-specific and are not included in a new installation of NexJ Studio. You need to create new test scripts specific to your NexJ deployment. You can also customize existing scripts that are included in base models.
Configuring the load test tool
The Test Tool used for load testing is available in NexJ Studio. To access the Test Tool, click the arrow next to the Run Tool button .
The Test Tool has a single configurable interface where you will define the model, application server, and playback settings. Modify these settings before running the Test Tool to ensure your application server is appropriately evaluated. The Test Tool has the following settings:
Model options determine which model the Test Tool will use to perform the test:
Current
The test script runs against the current working model that has been directly edited and contains customizations, mixins, and upgrades.
Base Model
The test script runs against the base model.
Published Model JAR
The test script runs against a published model JAR file that is located on your local machine or network drive. Server and Connection options specify the application server that will be evaluated:
Test
The Test checkbox is used to filter the Server and Connections file selections.
Server
The application server that the test script will be run on.
Connections
The connections file you want to use to run the test script on the application server. Options specify the test script that will be used and how it will run:
Test Script
The test script that will be used to test the application server.
URL
The target server. This is the URL of the system the Test Tool will be logging in to and performing actions on.
Number of Users
The number of users that will be simulated in this test.
User Startup Delay
The delay between each user initiating the test script. This factor is multiplied by the delay value (in each <Delay>
test element in the test script) to determine how long to wait before processing the next request.
Duration
The length that the test script will run for. Values can be entered using different measurements of time: seconds (s), minutes (min), or hours (h).
Step Delay Factor
The delay between each step in the test script being initiated. This factor is multiplied by the delay value (in each <Delay>
test element in the test script) to determine how long to wait before processing the next request.
Log Output Directory
The directory where the log file will be saved once the test script is completed.
User Mode options set the user accounts that will be used to run the test script:
Single Login
If a single user account will be used to run the test script, specify its user name and password. The user name and password must be entered in the following format: username:password
User File
If multiple user accounts will be used in the test script, specify the file path to a text file containing each user name and password. The user names and passwords in the text file must be structured in the following format:username:password
Each line in the text file must have the credentials of one user account. If the number of users specified is greater than the number of user accounts available in the file, multiple copies of the same user account will be logged in.
In most cases, this scenario should be avoided, if possible.
Advanced Options contain the test script's VM arguments:
VM Arguments
Displays the VM arguments associated with the test script specified in the above configuration.
Running a load test on the application server
Use the Test Tool in NexJ Studio to evaluate the performance of your application server.
To load test the application server:
- Start the application server.
- In the NexJ Studio toolbar, click the arrow beside the Run Tool button and select Test Tool.
The Test Tool dialog opens. Set the Model, Server and Connections, Options, and User Mode configurations.
- Click Run to activate the Test Tool.
The test script is executed and its activity is displayed in the Console. If the test script is run successfully, the Console will display: Exit code = 0
.
The Test Tool has tested the performance of your application server. A log file has been saved to the specified output directory.
Open the log file using a spreadsheet application or text editor to view the results.
Interpreting the results of load testing
The result of each Test Tool execution is output to a log file. The log file is a tab-delimited text file which can be opened using a spreadsheet application or text editor. For best results, view log files using a spreadsheet application such as Microsoft Excel.
Log files are organized into rows and columns. Each row contains the results from an interval of the test and each column is a test metric.
The following metrics are included in a log file. They appear in the following order from left to right:
users
Total users logged during the test.
tests
Number of tests completed.
iterations
Number of test iterations that is equal to the number of tests.
dyn_reqs
Number of dynamic requests sent to and processed by the application server.
dyn_rate
Average number of dynamic requests per second that were sent to and processed by the application server.
dyn_duration_sec
Average duration of request responses in seconds.
dyn_duration_p90
90th percentile of the duration of request responses in seconds.
dyn_duration_dev
Standard deviation of the duration of request responses in seconds.
dyn_errors
Number of errors that occurred during the sampling interval.
stat_reqs
Number of static requests sent to and processed by the application server.
stat_rate
Average number of static requests per second that were sent to and processed by the application server.
stat_duration_sec
Average duration of static request responses in seconds.
stat_duration_p90
90th percentile of the duration of static request responses in seconds.
stat_duration_dev
Standard deviation of the duration of static request responses in seconds.
stat_errors
Number of static errors that occurred during the sampling interval.
An empty line in a log file denotes the end of a warm-up period or the end of the test script. If the number of users was gradually increasing prior to the empty line this indicates the end of a warm-up period. Otherwise, the empty line signifies the end of the test script.
The last line of a log file is a summary of the test script. It summarizes all metrics collected during the test period, excluding warm-up period.