1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
5 .. _distribution-s3p-label:
7 Policy Distribution component
8 #############################
10 72h Stability and 4h Performance Tests of Distribution
11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
16 The stability and performance tests are performed on VM's running in the OpenStack cloud environment in the ONAP integration lab. There are two separate VMs, one for running backend policy services which policy distribution needs, and the other for the policy distribution service itself and Jmeter.
18 **OpenStack environment details**
20 - Version: Windriver Titanium
22 **Policy Backend VM details (VM1)**
24 - OS: Ubuntu 18.04.5 LTS
25 - CPU: 8 core, Intel Xeon E3-12xx v2 (Ivy Bridge), 2693.668 MHz, 16384 kB cache
28 - Docker version 19.03.8, build afacb8b7f0
29 - Java: openjdk 11.0.8 2020-07-14
31 **JMeter and Distribution VM details (VM2)**
33 - OS: Ubuntu 18.04.5 LTS
34 - CPU: 8 core, Intel Xeon E3-12xx v2 (Ivy Bridge), 2693.668 MHz, 16384 kB cache
37 - Docker version 19.03.8, build afacb8b7f0
38 - Java: openjdk 11.0.8 2020-07-14
42 VM1 & VM2: Common Setup
43 -----------------------
44 Make sure to execute below commands on both VM1 & VM2
46 Update the ubuntu software installer
56 sudo apt install -y openjdk-11-jdk
58 Ensure that the Java version that is executing is OpenJDK version 11
63 openjdk 11.0.8 2020-07-14
64 OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)
65 OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)
71 # Add docker repository
72 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
73 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
76 # Check available docker versions (if necessary)
77 apt-cache policy docker-ce
80 sudo apt install -y docker-ce=5:19.03.8~3-0~ubuntu-bionic docker-ce-cli=5:19.03.8~3-0~ubuntu-bionic containerd.io
82 Change the permissions of the Docker socket file
86 sudo chmod 666 /var/run/docker.sock
88 Check the status of the Docker service and ensure it is running correctly
92 $ systemctl status --no-pager docker
93 docker.service - Docker Application Container Engine
94 Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
95 Active: active (running) since Wed 2020-10-14 13:59:40 UTC; 1 weeks 0 days ago
96 # ... (truncated for brevity)
99 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
101 Clone the policy-distribution repo to access the test scripts
105 git clone https://gerrit.onap.org/r/policy/distribution
108 VM1 Only: Install Simulators, Policy-PAP, Policy-API and MariaDB
109 ----------------------------------------------------------------
111 Modify the setup_components.sh script located at:
113 - ~/distribution/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh
115 Ensure the correct docker image versions are specified - e.g. for Guilin-RC0
117 - nexus3.onap.org:10001/onap/policy-api:2.3.2
118 - nexus3.onap.org:10001/onap/policy-pap:2.3.2
120 Run the setup_components.sh script to start the test support components:
124 ~/distribution/testsuites/stability/src/main/resources/distributionsetup/setup_distribution.sh
126 After installation, ensure the following docker containers are up and running:
131 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
132 a187cb0ff08a nexus3.onap.org:10001/onap/policy-pap:2.3.2 "bash ./policy-pap.sh" 4 days ago Up 4 days 0.0.0.0:7000->6969/tcp policy-pap
133 2f7632fe90c3 nexus3.onap.org:10001/onap/policy-api:2.3.2 "bash ./policy-api.sh" 4 days ago Up 4 days 0.0.0.0:6969->6969/tcp policy-api
134 70fa27d6d992 pdp/simulator:latest "bash pdp-sim.sh" 4 days ago Up 4 days pdp-simulator
135 3c9ff28ba050 dmaap/simulator:latest "bash dmaap-sim.sh" 4 days ago Up 4 days 0.0.0.0:3904->3904/tcp message-router
136 60cfcf8cfe65 mariadb:10.2.14 "docker-entrypoint.s…" 4 days ago Up 4 days 0.0.0.0:3306->3306/tcp mariadb
139 VM2 Only: Install Distribution
140 ------------------------------
142 Modify the setup_distribution.sh script located at:
144 - ~/distribution/testsuites/stability/src/main/resources/distributionsetup/setup_distribution.sh
146 Ensure the correct docker image version is specified - e.g. for Guilin-RC0:
148 - nexus3.onap.org:10001/onap/policy-distribution:2.4.2
150 Run the setup_distribution.sh script to install the distribution service, provide the IP of VM1 (twice) as the arguments to the script:
154 ~/distribution/testsuites/stability/src/main/resources/distributionsetup/setup_distribution.sh <vm1-ipaddr> <vm1-ipaddr>
156 Ensure the distribution container is running.
161 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
162 9a8db2bad156 nexus3.onap.org:10001/onap/policy-distribution:2.4.2 "bash ./policy-dist.…" 29 hours ago Up 29 hours 0.0.0.0:6969->6969/tcp, 0.0.0.0:9090->9090/tcp policy-distribution
165 VM2 Only: Install JMeter
166 ------------------------
168 Download and install JMeter
172 # Install required packages
173 sudo apt install -y wget unzip
177 wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.1.1.zip
178 unzip -qd jmeter apache-jmeter-5.1.1.zip
179 rm apache-jmeter-5.1.1.zip
182 VM2 Only: Install & configure visualVM
183 --------------------------------------
185 VisualVM needs to be installed in the virtual machine running Distrbution (VM2). It will be used to monitor CPU, Memory and GC for Distribution while the stability tests are running.
189 sudo apt install -y visualvm
191 Run these commands to configure permissions
195 # Create Java security policy file for VisualVM
196 sudo cat > /usr/lib/jvm/java-11-openjdk-amd64/bin/visualvm.policy << EOF
197 grant codebase "jrt:/jdk.jstatd" {
198 permission java.security.AllPermission;
200 grant codebase "jrt:/jdk.internal.jvmstat" {
201 permission java.security.AllPermission;
205 # Set globally accessable permissions on policy file
206 sudo chmod 777 /usr/lib/jvm/java-11-openjdk-amd64/bin/visualvm.policy
208 Run the following command to start jstatd using port 1111
212 /usr/lib/jvm/java-11-openjdk-amd64/bin/jstatd -p 1111 -J-Djava.security.policy=/usr/lib/jvm/java-11-openjdk-amd64/bin/visualvm.policy &
214 Run visualVM to connect to localhost:9090
220 This will load up the visualVM GUI
222 Connect to Distribution JMX Port.
224 1. Right click on "Local" in the left panel of the screen and select "Add JMX Connection"
225 2. Enter the Port 9090. this is the JMX port exposed by the dsitribution container
226 3. Double click on the newly added nodes under "Local" to start monitoring CPU, Memory & GC.
228 Example Screenshot of visualVM
230 .. image:: images/distribution-s3p-vvm-sample.png
233 Stability Test of Policy Distribution
234 +++++++++++++++++++++++++++++++++++++
239 The 72 hour Stability Test for policy distribution has the goal of introducing a steady flow of transactions initiated from a test client server running JMeter. The policy distribution is configured with a special FileSystemReception plugin to monitor a local directory for newly added csar files to be processed by itself. The input CSAR will be added/removed by the test client(JMeter) and the result will be pulled from the backend(PAP and PolicyAPI) by the test client (JMeter).
241 The test will be performed in an environment where Jmeter will continuously add/remove a test csar into the special directory where policy distribuion is monitoring and will then get the processed results from PAP and PolicyAPI to verify the successful deployment of the policy. The policy will then be undeployed and the test will loop continuously until 72 hours have elapsed.
247 The 72h stability test will run the following steps sequentially in a single threaded loop.
249 - **Delete Old CSAR** - Checks if CSAR already exists in the watched directory, if so it deletes it
250 - **Add CSAR** - Adds CSAR to the directory that distribution is watching
251 - **Get Healthcheck** - Ensures Healthcheck is returning 200 OK
252 - **Get Statistics** - Ensures Statistics is returning 200 OK
253 - **CheckPDPGroupQuery** - Checks that PDPGroupQuery contains the deployed policy
254 - **CheckPolicyDeployed** - Checks that the policy is deployed
255 - **Undeploy Policy** - Undeploys the policy
256 - **Delete Policy** - Deletes the Policy for the next loop
257 - **Check PDP Group for Deletion** - Ensures the policy has been removed and does not exist
259 The following steps can be used to configure the parameters of the test plan.
261 - **HTTP Authorization Manager** - used to store user/password authentication details.
262 - **HTTP Header Manager** - used to store headers which will be used for making HTTP requests.
263 - **User Defined Variables** - used to store following user defined parameters.
265 ========== ===============================================
266 **Name** **Description**
267 ========== ===============================================
268 PAP_HOST IP Address or host name of PAP component
269 PAP_PORT Port number of PAP for making REST API calls
270 API_HOST IP Address or host name of API component
271 API_PORT Port number of API for making REST API calls
272 DURATION Duration of Test
273 ========== ===============================================
275 Screenshot of Distribution stability test plan
277 .. image:: images/distribution-s3p-testplan.png
280 Running the Test Plan
281 ---------------------
283 Edit the /tmp folder permissions to allow the testplan to insert the CSAR into the /tmp/policydistribution/distributionmount folder
287 sudo mkdir -p /tmp/policydistribution/distributionmount
288 sudo chmod -R a+trwx /tmp
290 From the apache JMeter folder run the test for 72h, pointing it towards the stability.jmx file inside the testplans folder and specifying a logfile to collect the results
294 ~/jmeter/apache-jmeter-5.1.1/bin/jmeter -n -t ~/distribution/testsuites/stability/src/main/resources/testplans/stability.jmx -Jduration=259200 -l ~/20201016-1715-distr-stability.jtl &
302 - Stability test plan was triggered for 72 hours.
303 - No errors were reported
307 .. csv-table:: Stability Results - Summary Report
308 :file: csv/20201016-1715-distr-stability-summary.csv
311 .. csv-table:: Stability Results - Aggregate Report
312 :file: csv/20201016-1715-distr-stability-aggregate.csv
315 **VisualVM Screenshots**
317 .. image:: images/20201016-1715-distr-stability-20201018T2040-monitor.png
318 .. image:: images/20201016-1715-distr-stability-20201018T2040-threads.png
321 Performance Test of Policy Distribution
322 +++++++++++++++++++++++++++++++++++++++
327 The 4h Performance Test of Policy Distribution 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.
329 It also tests that distribution can handle multiple policy CSARs and that these are deployed within 30 seconds consistently.
335 The performance test is based on the same setup as the distribution stability tests.
341 Performance test plan is different from the stability test plan.
343 - Instead of handling one policy csar at a time, multiple csar's are deployed within the watched folder at the exact same time.
344 - We expect all policies from these csar's to be deployed within 30 seconds.
345 - There are also multithreaded tests running towards the healtchcheck and statistics endpoints of the distribution service.
348 Running the Test Plan
349 ---------------------
351 Edit the /tmp folder permissions to allow the Testplan to insert the CSAR into the /tmp/policydistribution/distributionmount folder.
355 sudo mkdir -p /tmp/policydistribution/distributionmount
356 sudo chmod -R a+trwx /tmp
358 From the apache JMeter folder run the test for 4h, pointing it towards the performance.jmx file inside the testplans folder and specifying a logfile to collect the results
362 ~/jmeter/apache-jmeter-5.1.1/bin/jmeter -n -t ~/distribution/testsuites/performance/src/main/resources/testplans/performance.jmx -Jduration=14400 -l ~/20201020-1730-distr-performance.jtl &
369 - Performance test plan was triggered for 4 hours.
370 - No errors were reported
374 .. csv-table:: Performance Results - Summary Report
375 :file: csv/20201020-1730-distr-performance-summary.csv
378 .. csv-table:: Performance Results - Aggregate Report
379 :file: csv/20201020-1730-distr-performance-aggregate.csv
382 **VisualVM Screenshots**
384 .. image:: images/20201020-1730-distr-performance-20201020T2025-monitor.png
385 .. image:: images/20201020-1730-distr-performance-20201020T2025-threads.png