Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Setup

Environment:

OS: Zorin OS 16.2

RAM: 32 GB

CPU: Intel® Core™ i7-10610U CPU @ 1.80GHz × 8Linux Laptop,  RAM, CPU

Data: 

Included in ZIP file (at bottom)

  1. All data under 1 anchors
    1. Under /openroadm-devices we have list of 10,000 openroadm-device[..]
  2. tree-size per 'device' fragments 86 fragments
  3. KB per anchor 333KB ?devices: 333 KB


Single-large object request

Query: cps/api/v1/dataspaces/openroadm/anchors/owb-msa221-anchor/node?xpath=/openroadm-devices/openroadm-device[@device-id='C201-7-13A-5A1']&include-descendants=true

Durations are average of 100 measurements

...

1 object containing all node as descendants (mainly one big list)

Query: cps/api/v1/dataspaces/openroadm/anchors/owb-msa221-anchor/node?xpath=/openroadm-device&include-descendants=true

All queries ran 10-reames

PatchDevicesE2E duration (s)Fragment Query duration (s)Service duration (s)Object Size (
KB
MB)Object Size #FragmentsGraph

1) Baseline

https://gerrit.onap.org/r/c/cps/+/133482

1,00011.8
0
<0.
031
1 *12
11
0.
740333
386,000

Image Added

2,00028.5
0
<0.
049
1 *280.
401666
7172,000
5,00087.0
0
<0.
158
1 *86
.814
1,
664,985
7430,000
10,000201.0
0
<0.
445
1*2013.
008
3
,329,970
860,
006
000

2)

https://gerrit.onap.org/r/c/cps/+/133511/2**

1,0000.50.
223
20.
321332,997
30.386,
006
000

Image Added

2,0001.00.
417
40.
558665,994
60.7172,
006
000
5,0002.51.
087
11.
439
4
1664985
1.7430,
006
000
10,0007.
0 ??? Was this wrong ?!
2.
928
94.
049
0
3329970
3.3860,
006
000
1,0003.01.
262
31.
691
7
332997
0.386,
006
000

Image Added

2,0005.52.
317
33.
173
2
665994
0.7172,
006
000
5,00011.05.
433
45.
591
6
1664985
1.7430,
006
000
10,00025.411.
698
713.
661
6
3329970
3.3860,
006
000

*Only initial Hibernate query

** 

Graphs:

ttps://gerrit.onap.org/r/c/cps/+/133482:

Image Removed

https://gerrit.onap.org/r/c/cps/+/133511/2:

Image Removed

https://gerrit.onap.org/r/c/cps/+/133511/12:

Image Removed

Conclusions:

...

, hibernate will lazily fetch data later which is reflected in E2E time

Observations:

  1. PathsSet #2  did perform better than the latest patch! Need to compare Daniel Hanrahan will follow up

Get nodes parallel

Fetch 1 device from a database with 10,000 devices

Bash parallel Curl commands, 1 thread executed 10 Sequential requests with no delays, average response times are reported

Query: cps/api/v1/dataspaces/openroadm/anchors/owb-msa221-anchor/node?xpath=/openroadm-devices/openroadm-device[@device-id='C201-7-13A-5A1']

...

&include-descendants=true

Patch: https://gerrit.onap.org/r/c/cps/+/133511/12

288499007344567134
ThreadsE2E duration (s)Succes RatioFragment Query duration (s)
10.082100%0.2382
20.091100%0.0991
30.120100%1230.1271
50.1803100%0.1802
100.399.9%0.2833
200.599.5%0.4875
501.099.4%1.0.982
1002.399.7%2.2713
2007.699.7%6.2252
50017.141.4%13.8338
10001,00015.3063 (many connection errors)26.0%11.8669

Graph:

Image Removed

Conclusions:

...

Graphs:

  1. Average E2E Execution Time
  2. Internal Method Counts (total)

Image Added

Observations

  1. From 10 Parallel request (of 10 sequential request) the client can't always connect and we see time out error (succes ratio <100%)
    1. Sequential request are fired faster than actual responses so from DB perspective they are almost parallel request as well 
  2. Database probably already become bottleneck with 2 threads, effectively firening a total of 20 call very quickly. Its know that the DB connection pool/internal will slow down from 12 or more 'parallel' request

Get 1000 nodes in Parallel with varying thread count

In this test, 1000 requests are sent using curl, but with varying thread count (using --parallel-max option).

Code Block
languagebash
echo -e "Threads\tTime"
for threads in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 20 30 40 50; do
	echo -n -e "$threads\t"
	/usr/bin/time -f "%e" curl --silent --output /dev/null --fail --show-error \
		--header "Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=" \
		--get "http://localhost:8883/cps/api/v1/dataspaces/openroadm/anchors/owb-msa221-anchor/node?xpath=/openroadm-devices/openroadm-device\[@device-id='C201-7-[1-25]A-[1-40]A1'\]&include-descendants=true" \
		--parallel --parallel-max $threads --parallel-immediate
done

Note the above curl command performs 1000 requests. It is based on globbing in the URL - curl allows ranges such as [1-25]  in the URL, for example:

  http://example.com/archive[1996-1999]/vol[1-4].html

which would expand into a series of 16 requests to:

  • http://example.com/archive1996/vol1.html
  • http://example.com/archive1996/vol2.html
  • ...
  • http://example.com/archive1999/vol4.html

Results

ThreadsTime (s)SpeedupComments
1140.41.0
271.62.02 threads is 2x faster than 1 thread
348.52.9
437.23.8
531.04.5
626.65.3
723.85.9
821.66.5
920.07.0
1018.77.510 threads is 7.5x faster than 1 thread
1117.77.9
1216.88.4There are exactly 12 CPU cores (logical) on test machine
1316.78.4
1416.78.4
1516.88.4
2016.88.4
3016.78.4
4016.88.4
5016.78.4

Graphs

Image Added

Observations

  • There were no failures during the tests (e.g. timeouts or refused connections).
  • Performance increases nearly linearly with increasing thread count, up to the number of CPU cores.
  • Performance stops increasing when the number of threads equals the number of CPU cores (expected).
  • Verbose statistics show that each individual request takes around 0.14 seconds, regardless of thread count (but with multiple CPU cores, requests are really done in parallel).

Data sheets

View file
nameCpsPerformance.xlsx
height250
View file
nameperformanceTest.zip
height250
View file
namePerformance test.postman_collection.json
height250

Test scripts overview 

- performanceTest.sh
   Get 1000 times single large object from thousands of devices (1000, 2000, ..., 10000) and create metric after each run
- performanceRootTest.sh
   Get 10 times the whole data tree as one object from thousands of devices (1000, 2000, ..., 10000) and create metric after each run
- parallelGetRequestTest.sh
   Get one devices parallel from a database with 10000 devices, executed 10 times sequential

- buildup.sh
   Create the dataspace, create the schemaset, create the anchor and create the root node
- owb-msa221.zip
   The schemaset for the tests
- outNode.json
   The input for the root node creation
- createThousandNode.sh
   Helper script for the database creation
- innerNode.json
   The input for the sub node creation
- createMetric.sh
   Helper script for metric creation