Load Testing

June 1, 2022 ยท View on GitHub

You can run load tests to calculate the maximum throughput for your deployment. This section shows how to run tests using the FIWARE load testing tool and some reports of tests run in a demo scenario.

1. Run your load tests

  1. Clone load-tests repository locally.

  2. Configure the load test on /src/test/resources/test.conf

  3. Execute the test locally:

    mvn install gatling:test -Dgatling.simulationClass=simulations.nosec.v2.EntityUpdateWithSingleSubscriptionSimulation
    

2. Load test example reports

In order to calculate a starting configuration, you can check the load test reports in this section.

2.1 Load tests set up

Bear in mind that all the tests have been executed with the following versions of the components:

ComponentChart VersionApp VersionRelease Date
Orion-LD1.0.21.0.1Jan, 2022
MongoDB11.0.44.4.12Feb, 2022
QuantumLeap0.1.180.9.0-devMay, 2022
TimeScale0.11.02.6.1Apr, 2022
Keycloak8.0.017.0.1Mar, 2022
Keycloak PostgreSQL8.0.014.2.0Feb, 2022
PEP Proxy0.1.01.0.0May, 2022

2.2 Idle results

This table shows the idle consumption of all the components of the deployment:

ComponentReplicasCPUMemory
Orion-LD2<0.170MB
MongoDB2<0.1338MB
QuantumLeap2<0.1110MB
TimeScale3<0.1312MB
Keycloak1<0.11GB
Keycloak PostgreSQL2<0.1170MB
PEP Proxy2<0.1420MB
Grafana1<0.1230MB
Grafana Metrics1<0.1200MB
AirQuality Simulator1<0.1300MB
TOTAL170.145GB

2.3 Load tests results

ScenarionumDevicesnumUpdatesupdateDelayDurationReq/sOK/KOReport
#11003001s547s55.10930200 / 0Link
#23003001s1638s55.10490315 / 285Link
#3500501s517s49.59125688 / 312Link
  • Scenario: This is the scenario number. You can use this number to check resource consumption of the test in the tables below.
  • numDevices: Number of simultaneous devices reporting data.
  • numUpdates: Number of reports per device during the load test.
  • updateDelay: Time between reports.
  • Duration: This value is part of the Gatling report and shows the number of seconds that the scenario took to execute.
  • Req/s: This value is part of the Gatling report and shows the number of successful requests from the Gatling application running locally.
  • OK/KO: This value is part of the Gatling report and shows the number of correct and failed requests from the Gatling application running locally.
  • Report: Link to the corresponding Gatling report page.

2.3.1 Scenario 1

ComponentReplicasCPU MinCPU MaxCPU AvgMEM MinMEM MaxMEM Avg
Orion-LD20.020.090.0531.16 MiB34.40 MiB32.46 MiB
MongoDB20.080.200.15264.72 MiB294.98 MiB283.47 MiB
QuantumLeap20.000.330.2369.56 MiB94.17 MiB87.32 MiB
TimeScale30.030.100.07323.75 MiB347.16 MiB336.56 MiB
Keycloak11.884.713.49833.83 MiB924.51 MiB891.65 MiB
Keycloak PostgreSQL20.010.030.02134.27 MiB137.59 MiB135.41 MiB
PEP Proxy20.080.370.17351.36 MiB371.70 MiB362.94 MiB

2.3.2 Scenario 2

ComponentReplicasCPU MinCPU MaxCPU AvgMEM MinMEM MaxMEM Avg
Orion-LD20.040.090.0628.45 MiB34.88 MiB31.84 MiB
MongoDB20.120.320.23301.05 MiB430.62 MiB362.06 MiB
QuantumLeap20.050.340.2393.90 MiB94.41 MiB94.07 MiB
TimeScale30.030.120.08345.18 MiB439.01 MiB390.26 MiB
Keycloak12.244.943.83739.38 MiB1.05 GiB961.84 MiB
Keycloak PostgreSQL20.010.030.02143.84 MiB147.87 MiB145.74 MiB
PEP Proxy20.080.310.16299.29 MiB585.83 MiB343.41 MiB

2.3.3 Scenario 3

ComponentReplicasCPU MinCPU MaxCPU AvgMEM MinMEM MaxMEM Avg
Orion-LD20.030.080.0628.45 MiB32.63 MiB29.91 MiB
MongoDB20.150.320.23360.81 MiB459.20 MiB400.15 MiB
QuantumLeap20.060.230.1993.90 MiB94.17 MiB94.00 MiB
TimeScale30.020.130.07443.46 MiB521.72 MiB458.30 MiB
Keycloak11.674.873.391.08 GiB1.09 GiB1.09 GiB
Keycloak PostgreSQL20.010.030.02132.92 MiB136.04 MiB134.06 MiB
PEP Proxy20.080.240.16323.41 MiB332.26 MiB328.28 MiB

3. Limits and Requests

Load tests help us to estimate the resources (CPU and Memory) that each component will demand when they run under high pressure. To get a good QoS for our pods, we are going to set CPU and memory requests and limits for all the components of our deployment:

ComponentReplicasCPU ReqCPU LimMEM ReqMEM Lim
Orion-LD210m250m50Mi1GB
MongoDB250m500m300Mi1.5GB
MongoDB - Arbiter150m500m300Mi1.5GB
MongoDB - Metrics250m200m50Mi500Mi
QuantumLeap210m500m50Mi250Mi
TimeScale310m250m300Mi800Mi
Keycloak1100m7400Mi2GB
Keycloak PostgreSQL210m250m50Mi250Mi
PEP Proxy250m1300Mi800Mi
Grafana110m1100Mi1GB
Grafana Metrics110m250m50Mi250Mi
AirQuality Simulator110m1300Mi800Mi