Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 1 | .. This work is licensed under a |
| 2 | .. Creative Commons Attribution 4.0 International License. |
| 3 | .. http://creativecommons.org/licenses/by/4.0 |
| 4 | |
| 5 | .. _apex-s3p-label: |
| 6 | |
| 7 | .. toctree:: |
| 8 | :maxdepth: 2 |
| 9 | |
| 10 | Policy APEX PDP component |
| 11 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 12 | |
| 13 | Setting up Stability Tests in APEX |
| 14 | ++++++++++++++++++++++++++++++++++ |
| 15 | |
| 16 | Introduction |
| 17 | ------------ |
| 18 | |
| 19 | The 72 hour Stability Test for apex-pdp has the goal of introducing a steady flow of transactions initiated from a test client server running JMeter. The pdp is configured to start a rest server inside it and take input from rest clients (JMeter) and send back output to the rest clients (JMeter). |
| 20 | |
| 21 | The input events will be submitted through rest interface of apex-pdp and the results are verified using the rest responses coming out from apex-pdp. |
| 22 | |
| 23 | The test will be performed in a multi-threaded environment where 20 threads running in JMeter will keep sending events to apex-pdp in every 500 milliseconds for the duration of 72 hours. |
| 24 | |
| 25 | Setup details |
| 26 | ------------- |
| 27 | |
| 28 | The stability test is performed on VM's running in OpenStack cloud environment. There are 2 seperate VM's, one for running apex pdp & other one for running JMeter to simulate steady flow of transactions. |
| 29 | |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 30 | |
| 31 | Install & Configure VisualVM |
| 32 | ---------------------------- |
| 33 | |
| 34 | VisualVM needs to be installed in the virtual machine having apex-pdp. It will be used to monitor CPU, Memory, GC for apex-pdp while stability test is running. |
| 35 | |
| 36 | Install visualVM |
| 37 | |
| 38 | .. code-block:: bash |
| 39 | |
| 40 | sudo apt-get install visualvm |
| 41 | |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 42 | Login to VM using graphical interface in separate terminal window. |
| 43 | |
| 44 | .. code-block:: bash |
| 45 | |
| 46 | ssh -X <user>@<VM-IP-ADDRESS> |
| 47 | |
| 48 | Open visualVM |
| 49 | |
| 50 | .. code-block:: bash |
| 51 | |
| 52 | visualvm & |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 53 | |
huaxing | d51d906 | 2020-05-20 15:21:53 +0800 | [diff] [blame] | 54 | Connect to apex-pdp JVM's JMX agent |
| 55 | 1. Right click on "Local" in the left panel of the screen and select "Add Local JMX Connection..." |
| 56 | 2. Enter localhost:9911 for "Connection", and click OK |
| 57 | 3. Double click on the newly added nodes under "Local" to start monitoring CPU, Memory & GC. |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 58 | |
| 59 | Sample Screenshot of visualVM |
| 60 | |
huaxing | d51d906 | 2020-05-20 15:21:53 +0800 | [diff] [blame] | 61 | .. image:: images/stability-visualvm1.PNG |
| 62 | .. image:: images/stability-visualvm2.PNG |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 63 | |
| 64 | Test Plan |
| 65 | --------- |
| 66 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 67 | The 72 hours stability test will run the following steps in 5 threaded loop. |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 68 | |
| 69 | - **Send Input Event** - sends an input message to rest interface of apex-pdp. |
| 70 | - **Assert Response Code** - assert the response code coming from apex-pdp. |
| 71 | - **Assert Response Message** - assert the response message coming from apex-pdp. |
| 72 | |
| 73 | The following steps can be used to configure the parameters of test plan. |
| 74 | |
| 75 | - **HTTP Header Manager** - used to store headers which will be used for making HTTP requests. |
| 76 | - **HTTP Request Defaults** - used to store HTTP request details like Server Name or IP, Port, Protocol etc. |
| 77 | - **User Defined Variables** - used to store following user defined parameters. |
| 78 | |
| 79 | ================== ============================================================================ ============================ |
| 80 | **Name** **Description** **Default Value** |
| 81 | ================== ============================================================================ ============================ |
| 82 | wait Wait time after each request (in milliseconds) 500 |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 83 | threads Number of threads to run test cases in parallel. 5 |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 84 | threadsTimeOutInMs Synchronization timer for threads running in parallel (in milliseconds). 5000 |
| 85 | ================== ============================================================================ ============================ |
| 86 | |
| 87 | |
| 88 | Download and update the jmx file presented in the apex-pdp git repository - `jmx file path <https://gerrit.onap.org/r/gitweb?p=policy/apex-pdp.git;a=tree;f=testsuites/apex-pdp-stability/src/main/resources;h=99d373033a190a690d4e05012bc3a656cae7bc3f;hb=refs/heads/master>`_. |
| 89 | |
| 90 | - HTTPSampler.domain - The ip address of VM which the apex container is running |
| 91 | - HTTPSampler.port - The listening port, here is 23324 |
| 92 | - ThreadGroup.druation - Set the duration to 72 hours (in seconds) |
| 93 | |
| 94 | Use the CLI mode to start the test |
| 95 | |
| 96 | .. code-block:: bash |
| 97 | |
| 98 | ./jmeter.sh -n -t ~/apexPdpStabilityTestPlan.jmx -Jusers=1 -l ~/stability.log |
| 99 | |
| 100 | Stability Test Result |
| 101 | --------------------- |
| 102 | |
| 103 | **Summary** |
| 104 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 105 | Stability test plan was triggered for 72 hours injecting input events to apex-pdp from 5 client threads. |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 106 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 107 | Once the test has complete - we can generate a HTML test report via the following command |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 108 | |
| 109 | .. code-block:: bash |
| 110 | |
huaxing | d51d906 | 2020-05-20 15:21:53 +0800 | [diff] [blame] | 111 | ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g stability.log -o ./result/ |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 112 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 113 | ============================================== ================================ ============= ============ ============================ |
| 114 | **Number of Client Threads running in JMeter** **Total number of input events** **Success %** **Error %** **Average Time per Request** |
| 115 | ============================================== ================================ ============= ============ ============================ |
arkadiusz.adamski | 32bad8e | 2021-03-31 09:26:46 +0100 | [diff] [blame^] | 116 | 5 129326 100% 0% 6716.12 |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 117 | ============================================== ================================ ============= ============ ============================ |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 118 | |
huaxing | d51d906 | 2020-05-20 15:21:53 +0800 | [diff] [blame] | 119 | .. image:: images/stability-jmeter.PNG |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 120 | |
arkadiusz.adamski | 32bad8e | 2021-03-31 09:26:46 +0100 | [diff] [blame^] | 121 | download:`result.zip <apex-s3p-results/apex_s3p_results.zip>` |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 122 | |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 123 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 124 | Stability Test of Apex PDP |
| 125 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 126 | |
| 127 | The 72 hour Stability Test for apex-pdp has the goal of introducing a steady flow of transactions using jMeter. |
| 128 | |
| 129 | The input event will be submitted through the rest interface of DMaaP , which then triggers a grpc request to CDS. Based on the response, another DMaaP event is triggered. |
| 130 | |
| 131 | This test will be performed in an OOM deployment setup. The test will be performed in a multi-threaded environment where 5 threads running in JMeter will keep sending events for the duration of 72 hours. |
| 132 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 133 | Test Plan |
| 134 | --------- |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 135 | |
| 136 | The 72 hours stability test will run the following steps in a 5 threaded loop. |
| 137 | |
| 138 | - **Create Policy** - creates a policy using the policy/api component |
| 139 | - **Deploy Policy** - deploys the policy in the existing PdpGroup |
| 140 | - **Check Health** - checks the health status of apex |
| 141 | - **Send Input Event** - trigger 'unauthenticated.DCAE_CL_OUTPUT' event of DMaaP. |
| 142 | - **Get Output Event Response** - check for the triggered output event. |
| 143 | - **Undeploy Policy** - undeploys the policy from PdpGroup |
| 144 | - **Delete Policy** - deletes the policy using the policy/api component |
| 145 | |
| 146 | The following steps can be used to configure the parameters of the test plan. |
| 147 | |
| 148 | - **HTTP Header Manager** - used to store headers which will be used for making HTTP requests. |
| 149 | - **HTTP Request Defaults** - used to store HTTP request details like Server Name or IP, Port, Protocol etc. |
| 150 | - **User Defined Variables** - used to store the following user defined parameters: |
| 151 | |
| 152 | ================== ============================================================================ ============================ |
| 153 | **Name** **Description** **Default Value** |
| 154 | ================== ============================================================================ ============================ |
| 155 | wait Wait time after each request (in milliseconds) 120000 |
| 156 | threads Number of threads to run test cases in parallel. 5 |
| 157 | threadsTimeOutInMs Synchronization timer for threads running in parallel (in milliseconds). 150000 |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 158 | PAP_PORT Port number of PAP for making REST API calls |
| 159 | API_PORT Port number of API for making REST API calls |
| 160 | APEX_PORT Port number of APEX for making REST API calls |
| 161 | DMAAP_PORT Port number of DMAAP for making REST API calls |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 162 | ================== ============================================================================ ============================ |
| 163 | |
| 164 | |
| 165 | Download and update the jmx file presented in the apex-pdp git repository - `jmx file path <https://gerrit.onap.org/r/gitweb?p=policy/apex-pdp.git;a=tree;f=testsuites/apex-pdp-stability/src/main/resources;h=99d373033a190a690d4e05012bc3a656cae7bc3f;hb=refs/heads/master>`_. |
| 166 | |
| 167 | - HTTPSampler.domain - The ip address of the VM in which the apex container is running |
| 168 | - HTTPSampler.port - The listening port, here is 23324 |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 169 | - ThreadGroup.duration - Set the duration to 72 hours (in seconds) |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 170 | |
| 171 | Use the CLI mode to start the test |
| 172 | |
| 173 | .. code-block:: bash |
| 174 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 175 | nohup ./jmeter.sh -n -t ~/apexPdpStabilityTestPlan.jmx -Jusers=1 -l ~/stability.log |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 176 | |
| 177 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 178 | Stability Test Results |
| 179 | ---------------------- |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 180 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 181 | The stability test plan was triggered for 72 hours, injecting input events to apex-pdp pod from 5 client threads running in JMeter. |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 182 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 183 | The stability tests were executed as part of a full ONAP OOM deployment in Nordix lab. |
| 184 | |
| 185 | Once the tests complete, we can generate an HTML test report via the command: |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 186 | |
| 187 | .. code-block:: bash |
| 188 | |
| 189 | ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g stability.log -o ./result/ |
| 190 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 191 | ============================================== ================================ ============= ============ ============================ |
| 192 | **Number of Client Threads running in JMeter** **Total number of input events** **Success %** **Error %** **Average Time per Request** |
| 193 | ============================================== ================================ ============= ============ ============================ |
arkadiusz.adamski | 32bad8e | 2021-03-31 09:26:46 +0100 | [diff] [blame^] | 194 | 5 129326 100% 0% 6716.12 |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 195 | ============================================== ================================ ============= ============ ============================ |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 196 | |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 197 | |
| 198 | **JMeter Screenshot** |
| 199 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 200 | .. image:: images/apex_s3p_jm-1.png |
| 201 | .. image:: images/apex_s3p_jm-2.png |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 202 | |
arkadiusz.adamski | 32bad8e | 2021-03-31 09:26:46 +0100 | [diff] [blame^] | 203 | download:`result.zip <apex-s3p-results/apex_s3p_results.zip>` |
aditya.puthuparambil | 9d4e96e | 2020-06-02 12:10:24 +0100 | [diff] [blame] | 204 | |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 205 | Setting up Performance Tests in APEX |
| 206 | ++++++++++++++++++++++++++++++++++++ |
| 207 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 208 | The Performance test is performed on a similar setup to the Stability test. JMeter will send a large number of REST requests and will then retrieve those requests. |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 209 | |
arkadiusz.adamski | 32bad8e | 2021-03-31 09:26:46 +0100 | [diff] [blame^] | 210 | Performance test plan will be the same as the stability test plan except for some differences listed below: |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 211 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 212 | - Increase the number of threads from 5 to 60. |
| 213 | - Reduce test time to ninety minutes. |
| 214 | - Calculate the amount of requests handled in the time frame. |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 215 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 216 | Run Test |
| 217 | -------- |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 218 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 219 | Running the performance test will be the same as the stability test. That is, launch JMeter pointing to corresponding *.jmx* test plan. The *API_HOST* , *API_PORT* , *PAP_HOST* , *PAP_PORT* are already set up in *.jmx*. |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 220 | |
| 221 | .. code-block:: bash |
| 222 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 223 | nohup ./jmeter.sh -n -t ~/performance.jmx -Jusers=1 -l ~/perf.log |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 224 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 225 | Once the tests have completed, run the following the gather results. |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 226 | |
| 227 | .. code-block:: bash |
| 228 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 229 | ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g perf.log -o ./performance_result/ |
huaxing | d51d906 | 2020-05-20 15:21:53 +0800 | [diff] [blame] | 230 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 231 | Performance Test Result |
| 232 | ----------------------- |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 233 | |
| 234 | **Summary** |
| 235 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 236 | Performance test was triggered for 90 minutes. The results are shown below. |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 237 | |
| 238 | **Test Statistics** |
| 239 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 240 | ============================ =========== ========= ================================== |
| 241 | **Total Number of Requests** **Success** **Error** **Average Time Taken per Request** |
| 242 | ============================ =========== ========= ================================== |
| 243 | 9870 100 % 0 % 5506.09 ms |
| 244 | ============================ =========== ========= ================================== |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 245 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 246 | **JMeter Screenshot** |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 247 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 248 | .. image:: images/apex_perf_jm_1.png |
Pamela Dragosh | ba45dc6 | 2020-04-16 09:27:44 -0400 | [diff] [blame] | 249 | |
waynedunican | 9a10ba3 | 2020-10-27 16:23:47 +0000 | [diff] [blame] | 250 | .. image:: images/apex_perf_jm_2.png |