Contribute to the DSpace Development Fund
The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.
To test the performance of our services (Eprints, DSpace, ...) we recommend the open source load testing tool Locust - https://locust.io
Installation
Instructions according to https://docs.locust.io/en/stable/installation.html
Lokal (Win, Linux, Mac) vs. RHEL8 ServerSide; both installed and tested. Better RHEL8 for more pressure during load tests.
python 3.11
gcc-c++
pip3.11
Port 8089 (open in firewall)
locust install: [locust]$ pip3.11 install locust
Simple scenarios ("Hello World" mode)
Configuration
Simply pass through the URL entered at the start in the input form ("Number of Users", "Spawn rate", "Host") and test it - e.g. test the homepage of your DS7 repo
vi locustfile.py
|
more on configs read https://docs.locust.io/en/stable/writing-a-locustfile.html#writing-a-locustfile
Start Locust
read Command Line Options
Attention: Standard http vs. https; Certs and Keys
[locust]$ locust --tls-cert /etc/pki/tls/certs/SERVERNAME/cert.pem --tls-key /etc/pki/tls/certs/SERVERNAME/privkey.pem
[2024-01-22 14:40:56,153] INFO/locust.main: Starting web interface at https://0.0.0.0:8089
[2024-01-22 14:40:56,166] INFO/locust.main: Starting Locust 2.20.1
UI
call Browser https://zizoradspace7trial.uzh.ch:8089/ and start loadtests. First easy with 1 user.
(Attention: use trailing slash)
See charts, failures, statistics and many more...
Real
test scenarios (static & dynamic content)
Homepage
SubPage Communities
Search
Login Process incl. Token Autentication
and these scenarios according to the storybook in locustfile.py with
1 user
10 parallel users
nnn parallel users
Preliminary work / tests
Before the various authentication procedures for login, session handling (credentials, tokens, cookies, etc.) and workflow steps (dashboard, upload, metadata edit) are run through with try & error, it is advisable to test the individual work steps via the APIs beforehand using CURL.
For e.g. Before login ba POST method, receive TOKEN via GET. Read (insert Link)
Configuration (“complex” Mode)
vi locustfile.py
|
Notes
- 2 types of users (anonymous, registered user), login with token handling
- further, sequential storybook possible: login, workflow, upload, edit metadata, logout
Grafic Output (10 User)
Grafic Output (100 User)
Error rate increases as soon as system is overloaded
Links
- https://locust.io/
- https://docs.locust.io/en/stable/
- https://docs.locust.io/en/stable/writing-a-locustfile.html#writing-a-locustfile
- https://medium.com/dana-engineering/load-testing-at-web-application-api-using-locust-2b297c5771ab
- https://www.blazemeter.com/blog/locust-python