1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
14 72 Hours Stability Test of Policy API
15 +++++++++++++++++++++++++++++++++++++
20 The 72 hour stability test of policy API has the goal of verifying the stability of running policy design API REST
21 service by ingesting a steady flow of transactions in a multi-threaded fashion to
22 simulate multiple clients' behaviours.
23 All the transaction flows are initiated from a test client server running JMeter for the duration of 72 hours.
28 The stability test was performed on a default Policy docker installation in the Nordix Lab environment.
29 JMeter was installed on a separate VM to inject the traffic defined in the
31 <https://git.onap.org/policy/api/tree/testsuites/stability/src/main/resources/testplans/policy_api_stability.jmx>`_
32 with the following command:
36 nohup apache-jmeter-5.6.2/bin/jmeter -n -t policy_api_stability.jmx -l stabilityTestResultsPolicyApi.jtl &
38 The test was run in the background via “nohup” and “&”, to prevent it from being interrupted.
43 The 72+ hours stability test will be running the following steps sequentially
44 in multi-threaded loops. Thread number is set to 5 to simulate 5 API clients'
45 behaviours (they can be calling the same policy CRUD API simultaneously).
46 Each thread creates a different version of the policy types and policies to not
47 interfere with one another while operating simultaneously. The point version
48 of each entity is set to the running thread number.
50 **Setup Thread (will be running only once)**
52 - Get policy-api Healthcheck
53 - Get Preloaded Policy Types
55 **API Test Flow (5 threads running the same steps in the same loop)**
57 - Create a new Monitoring Policy Type with Version 6.0.#
58 - Create a new Monitoring Policy Type with Version 7.0.#
59 - Create a new Optimization Policy Type with Version 6.0.#
60 - Create a new Guard Policy Type with Version 6.0.#
61 - Create a new Native APEX Policy Type with Version 6.0.#
62 - Create a new Native Drools Policy Type with Version 6.0.#
63 - Create a new Native XACML Policy Type with Version 6.0.#
64 - Get All Policy Types
65 - Get All Versions of the new Monitoring Policy Type
66 - Get Version 6.0.# of the new Monitoring Policy Type
67 - Get Version 6.0.# of the new Optimization Policy Type
68 - Get Version 6.0.# of the new Guard Policy Type
69 - Get Version 6.0.# of the new Native APEX Policy Type
70 - Get Version 6.0.# of the new Native Drools Policy Type
71 - Get Version 6.0.# of the new Native XACML Policy Type
72 - Get the Latest Version of the New Monitoring Policy Type
73 - Create Version 6.0.# of Node Template
74 - Create Monitoring Policy Ver 6.0.# w/Monitoring Policy Type Ver 6.0.#
75 - Create Monitoring Policy Ver 7.0.# w/Monitoring Policy Type Ver 7.0.#
76 - Create Optimization Policy Ver 6.0.# w/Optimization Policy Type Ver 6.0.#
77 - Create Guard Policy Ver 6.0.# w/Guard Policy Type Ver 6.0.#
78 - Create Native APEX Policy Ver 6.0.# w/Native APEX Policy Type Ver 6.0.#
79 - Create Native Drools Policy Ver 6.0.# w/Native Drools Policy Type Ver 6.0.#
80 - Create Native XACML Policy Ver 6.0.# w/Native XACML Policy Type Ver 6.0.#
81 - Create Version 6.0.# of PNF Example Policy with Metadata
83 - Get All TCA Policies
84 - Get All Versions of Monitoring Policy Type
85 - Get Version 6.0.# of the new Monitoring Policy
86 - Get Version 6.0.# of the new Optimization Policy
87 - Get Version 6.0.# of the new Guard Policy
88 - Get Version 6.0.# of the new Native APEX Policy
89 - Get Version 6.0.# of the new Native Drools Policy
90 - Get Version 6.0.# of the new Native XACML Policy
91 - Get the Latest Version of the new Monitoring Policy
92 - Delete Version 6.0.# of the new Monitoring Policy
93 - Delete Version 7.0.# of the new Monitoring Policy
94 - Delete Version 6.0.# of the new OptimizationPolicy
95 - Delete Version 6.0.# of the new Guard Policy
96 - Delete Version 6.0.# of the new Native APEX Policy
97 - Delete Version 6.0.# of PNF Example Policy having Metadata
98 - Delete Version 6.0.# of the new Native Drools Policy
99 - Delete Version 6.0.# of the new Native XACML Policy
100 - Delete Monitoring Policy Type with Version 6.0.#
101 - Delete Monitoring Policy Type with Version 7.0.#
102 - Delete Optimization Policy Type with Version 6.0.#
103 - Delete Guard Policy Type with Version 6.0.#
104 - Delete Native APEX Policy Type with Version 6.0.#
105 - Delete Native Drools Policy Type with Version 6.0.#
106 - Delete Native XACML Policy Type with Version 6.0.#
107 - Delete Node Template
110 **TearDown Thread (will only be running after API Test Flow is completed)**
112 - Get policy-api Healthcheck
113 - Get Preloaded Policy Types
121 No errors were found during the 72 hours of the Policy API stability run.
122 The load was performed against a non-tweaked Policy docker deployment.
126 ======================= ============= =========== =============================== =============================== ===============================
127 **Total # of requests** **Success %** **TPS** **Avg. time taken per request** **Min. time taken per request** **Max. time taken per request**
128 ======================= ============= =========== =============================== =============================== ===============================
129 730178 100% 2.8 1766 ms 127 ms 107029 ms
130 ======================= ============= =========== =============================== =============================== ===============================
132 .. image:: api-s3p-results/api-s3p-jm-1_J.png
136 The following graphs show the response time distributions. The "Get Policy Types" API calls are the most expensive calls that
137 average a 8.6 seconds plus response time.
139 .. image:: api-s3p-results/api-response-time-distribution_J.png
140 .. image:: api-s3p-results/api-response-time-overtime_J.png
142 **Memory and CPU usage**
144 The memory and CPU usage can be monitored by running "docker stats" command in the policy-api container.
145 A snapshot is taken before and after test execution to monitor the changes in resource utilization.
147 Memory and CPU usage before test execution:
149 .. image:: api-s3p-results/api_stat_before_72h.png
151 Memory and CPU usage after test execution:
153 .. image:: api-s3p-results/api_stat_after_72h.png
156 Performance Test of Policy API
157 ++++++++++++++++++++++++++++++
162 Performance test of policy-api has the goal of testing the min/avg/max processing time and rest call throughput for all the requests when the number of requests are large enough to saturate the resource and find the bottleneck.
167 The performance test was performed on a default Policy docker installation in the Nordix Lab environment.
168 JMeter was installed on a separate VM to inject the traffic defined in the
169 `API performance script
170 <https://git.onap.org/policy/api/tree/testsuites/performance/src/main/resources/testplans/policy_api_performance.jmx>`_
171 with the following command:
175 nohup apache-jmeter-5.6.2/bin/jmeter -n -t policy_api_performance.jmx -l performanceTestResultsPolicyApi.jtl &
177 The test was run in the background via “nohup” and “&”, to prevent it from being interrupted.
182 Performance test plan is the same as stability test plan above.
183 Only differences are, in performance test, we increase the number of threads up to 20 (simulating 20 users' behaviours at the same time) whereas reducing the test time down to 2.5 hours.
188 Running/Triggering performance test will be the same as stability test. That is, launch JMeter pointing to corresponding *.jmx* test plan. The *API_HOST* and *API_PORT* are already set up in *.jmx*.
192 ======================= ============= =========== =============================== =============================== ===============================
193 **Total # of requests** **Success %** **TPS** **Avg. time taken per request** **Min. time taken per request** **Max. time taken per request**
194 ======================= ============= =========== =============================== =============================== ===============================
195 56740 100% 6.3 6340 ms 72 ms 65557 ms
196 ======================= ============= =========== =============================== =============================== ===============================
198 .. image:: api-s3p-results/api-s3p-jm-2_J.png
203 The following graphs show the response time distributions.
205 .. image:: api-s3p-results/api-response-time-distribution_performance_J.png
206 .. image:: api-s3p-results/api-response-time-overtime_performance_J.png