|
| 1 | +# Locust Master Service Setup for Arkiv |
| 2 | + |
| 3 | +This guide explains how to set up the Locust master service for Arkiv load testing using systemd. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. Ensure you have Poetry installed: |
| 8 | + |
| 9 | + ```bash |
| 10 | + curl -sSL https://install.python-poetry.org | python3 - |
| 11 | + ``` |
| 12 | + |
| 13 | +2. Clone this repository to a location accessible by the systemd service user (e.g., `/root/locus-master/loadtest-yagna`): |
| 14 | + |
| 15 | + ```bash |
| 16 | + git clone <repository-url> /root/locus-master/loadtest-yagna |
| 17 | + cd /root/locus-master/loadtest-yagna |
| 18 | + ``` |
| 19 | + |
| 20 | +3. Install dependencies using Poetry: |
| 21 | + |
| 22 | + ```bash |
| 23 | + poetry install |
| 24 | + ``` |
| 25 | + |
| 26 | +## Arkiv Service Setup |
| 27 | + |
| 28 | +1. Copy the systemd service file to the systemd directory: |
| 29 | + |
| 30 | + ```bash |
| 31 | + sudo cp stress-l3/systemd/locust-arkiv.service /etc/systemd/system/ |
| 32 | + ``` |
| 33 | + |
| 34 | +2. **Important**: Update the `WorkingDirectory` path in `/etc/systemd/system/locust-arkiv.service` to match the actual location where you cloned the repository. The default path in the example file is `/root/locus-master/loadtest-yagna`. |
| 35 | + |
| 36 | +3. Activate and start the service: |
| 37 | + |
| 38 | + ```bash |
| 39 | + sudo systemctl daemon-reload |
| 40 | + sudo systemctl enable locust-arkiv.service |
| 41 | + sudo systemctl start locust-arkiv.service |
| 42 | + sudo systemctl status locust-arkiv.service |
| 43 | + ``` |
| 44 | + |
| 45 | + To view logs: `sudo journalctl -u locust-arkiv.service -f` |
| 46 | + |
| 47 | +## Service Configuration |
| 48 | + |
| 49 | +The service file (`stress-l3/systemd/locust-arkiv.service`) is configured to: |
| 50 | + |
| 51 | +- Run Locust in master mode |
| 52 | +- Bind the web interface to `0.0.0.0` (accessible from all network interfaces) |
| 53 | +- Automatically restart on failure with a 5-second delay |
| 54 | +- Start automatically on system boot |
| 55 | + |
| 56 | +**Note**: Scripts for running distributed nodes are placed in https://github.com/golemfactory/gitops |
| 57 | + |
| 58 | +## Stopping the Service |
| 59 | + |
| 60 | +To stop the service: |
| 61 | + |
| 62 | +```bash |
| 63 | +sudo systemctl stop locust-arkiv.service |
| 64 | +``` |
| 65 | + |
0 commit comments