Skip to main content

Load and stress tests

TruBudget uses load and stress tests to ensure the system's stability. Some tests are triggered automatically after a major release, others run on each push to the remote repository or get triggered manually. The automated testing strategy allows to regularly check the system minimal requirements and adjust them as needed. Furthermore, developer get detailed information about the system allowing to search for flaws i.e. bottlenecks.

There are three types of load/stress tests:

  • Stress test: Classic stress to bring the core part of the system (API/Blockchain) to their limits. Although the system capacities are entirely used, the system should not crash nor be unusable
  • Smoke Tests: Smoke test are regular load-test, configured for minimal load. They are used for sanity checks.
  • Stability Test: The whole system and it's interconnecting services such as Email Service and Storage Service are tested. This test, in terms of requests and users per second, is set up similarly to the stress test.

TruBudget uses k6 to define and run load and stability tests. Tests can be run both locally and using Docker. We highly recommend using docker since the provided script spins up a complete test setup including Grafana and Influx. However, if you choose to run the tests locally, k6 needs to be installed. An optional Grafana and Influx instance are not required, but recommended in order to analyze the data generated by the tests.

note

Per default, the test script will run a smoke test against your local TruBudget instance. However, if you want to test a remote instance, the target URL can be changed in api/loadtest/k6-tests/script.js by modifying the BASE_URL constant. The test type can be changed in the provided script (api/loadtest/runTests.sh) by modifying the --config parameter. Valid options are:

  • smoke.config.json: runs a smoke-test (1 virtual user)
  • load.config.json: runs a load-test (100 virtual user)
  • stress.config.json: runs a stress-test (400 virtual user)

Getting started

  1. Navigate to api/loadtest
  2. Configure the test as described above and add execution rights to runTests.sh
  3. Run ./runTests.sh

Visualizing

To visualize the generated data from the tests via Grafana:

  • Open Grafana
  • Navigate to Dashboard
  • In the left sidebar, click the + button > Import
  • Paste the Dashboard ID: 2587 or 11837
  • Click Load
  • Select the Influx data-source
  • Click Import
tip

Grafana has a bunch of pre-configured dashboards for k6 we recommend using one of the two predefined dashboards (2587 or 11837) mentioned above. However, if you want to browse the available dashboards, you can do it here. Also, feel free to contribute to the Grafana community by creating your own dashboard and publishing it to the Grafana Hub.

Minimum requirements

TruBudget can be deployed in different ways. To give your users the best experience, we tested TruBudget with different configurations. The minimum requirements aim to provide a working environment with 50 to 100 parallel user. The recommended environment is capable of handling 100 - 400 parallel user (using Kubernetes).

If you plan to deploy TruBudget on a single VM with following services: Blockchain, API and Frontend, we recommend the following for minimum setup:

Minimum
CPU†2 vCPU
RAM8 GB
Storage10 GB

If you plan to have more than 100 parallel users, we strongly recommend using Kubernetes. TruBudget load and stress tests are run against the minimum and recommend system requirements in a Kubernetes environment to ensure the correctness of the data below.

Blockchain:

MinimumRecommended
CPU†1 vCPU2 vCPU
RAM4 GB8 GB
Storage1 GB1* GB

Frontend:

MinimumRecommended
CPU†0.5 vCPU1 vCPU
RAM1 GB2 GB
Storage1 GB1 GB

API:

MinimumRecommended
CPU†0.5 vCPU1 vCPU
RAM2 GB8 GB
Storage1 GB1 GB

Export-Service:

MinimumRecommended
CPU†0.5 vCPU0.5 vCPU
RAM1 GB1 GB
Storage1 GB1 GB

Email-Service:

MinimumRecommended
CPU†0.5 vCPU0.5 vCPU
RAM1 GB1 GB
Storage1 GB1 GB

Storage-Service:

MinimumRecommended
CPU†1 vCPU2 vCPU
RAM1 GB2 GB
Storage1 GB50* GB
note

† Depending on your or your provider's infrastructure, the strength of one virtual CPU might vary. The above values are based on the Intel® Xeon® Platinum 8272CL processor (second generation Intel® Xeon® Scalable processors), Intel® Xeon® 8171M 2.1GHz (Skylake), Intel® Xeon® E5-2673 v4 2.3 GHz (Broadwell), or the Intel® Xeon® E5-2673 v3 2.4 GHz (Haswell) processors.

* Assuming you are using off-chain-storage.