I wanted to load test my GCP instances so went looking for a new tool and found Locust. I've used siege and some other web-based paid services before but I just wanted something fun to test the smallest GCP instances with.
Best installed on a dev machine with decent specs if you want to hammer something I guess. I opened my Debian WSL2 and installed python3.
sudo apt install python3
Then I had to install pip
sudo apt install python3-venv python3-pip
Then finally I can install Locust
pip3 install locust
However the install kept failing with
I tried installing as sudo, updating pip with
sudo pip install --upgrade setuptools and the updates in this StackOverflow.
Then I saw a bit further up in the error I was missing a file
I installed libffi-dev to fix the issue then ran the locust install again with success.
apt install libffi-dev
The I realised that I was going to have to mess about opening ports from the Debian WSL2 instance to browse to it from the Windows host, got bored with this tangent as really I was meant to be load testing the GCP instance so installed Python on Windows, ran the pip3 install command with no issues and cracked on setting up a Locust test. The whole windows install took minutes :-)
(edit: actually no messing with ports, when installing Hugo on WSL2 Windows took care of port forwarding localhost:1313 and it just worked when I browsed to localhost from the host machine)
This was my test to check a couple of bookstack pages:
from locust import HttpUser, task class HelloWorldUser(HttpUser): @task def hello_world(self): self.client.get("/docs") self.client.get("/docs/books/technical/page/locust")
Then I ran
locust and browsed to http://localhost:8089/
Then I went and actually tried to use the site for real, hard-refreshing pages and just getting a feel for how fast these instances were with no optimisation and some load. Happily the second size up GCP instance is easily enough to run a small web server.