Comments (15)
Sure, and the docker build cache should handle that. But it is still build + push + deploy. With swarm its all just one command :)
Actually swarm works nicely with the UI too, it just defaults to headless. You just need to pass the somewhat awkwardly named parameter --headful
:)
from locust.
I’m not against this, but I think it is not super necessary either. When running tests you’re going to be making adjustments to the locustfile and restarting locust frequently anyway, so having things configurable in the UI doesnt add as much value as one might think.
It would be nice to be able to split Users and configuration though (maybe a yaml file containing user count, wait times, host, weights,…) Maybe after making such a feature it would be nice to also be able to set all those things in the UI. But we’d need to make that conceptual change first.
from locust.
Well clearly I made some false assumptions about the "real world" :)
I thought the whole point of having the web UI and having a docker image was to deploy. I use the web UI to set everything about how I want the test to run. That's why something like this is useful to me. I want to run certain tasks one day and other tasks another day.
It's not that it's difficult to redeploy, it's the it doesn't make sense to change things and redeploy when I'll just need to change them back.
I had a very simple time deploying a kubernetes cluster for distributed load testing. There just needs to be a different env variable for the workers and the master and then a bash file runs different commands based on that env variable.
from locust.
Yea, commenting stuff out sucks, but disabling/enabling whole user classes already supported with the class picker, right?
Ok! If it is easy to do then go ahead and try it out!
from locust.
Yeah I have a Dockerfile that sets the entry point as a bash file:
Aha, interesting. But every time you need to update the locustfile you need to build and push the docker image? I dont like that workflow :)
from locust.
Exactly, and anything can be a single command with a little bit of imagination :) Plus I would just have a Github action handle the build / push
Sounds pretty interesting, I'll have to try it. We really should have some documentation about all these plugins :)
from locust.
Yea, some day I want to merge swarm into locust. It is mentioned in the docs but people tend to miss it :)
Or maybe not. Maybe just add the docs to locust-core, so people find it.
from locust.
The idea behind this is that in the real world, the web UI is hosted, and then it makes a lot less sense to keep having to change the locust file and redeploy.
For me, there is a strong use case behind selecting the tasks that a user is ran with and the users weight (or fixed count). Depending on the requirements, we may want to test different tasks at different times, and there's currently no way to support this without commenting things out in the locust file and redeploying.
from locust.
"in the real world"? :)
I have never run locust in a "hosted" fashion , and I have almost never seen anyone else doing it. But I guess people can use it in a lot of different ways :) I find it more useful to set everything on command line (but I sometimes do miss the ability to set wait times and weights from there)
Btw, when you say "redeploying", is that something that is complicated for you? I just use locust-swarm for that (I've had some discussions with @DennisKrone about maybe distributing the locustfile from master->worker at startup, but it has not yet come to fruition - perhaps that would make it easier)
from locust.
Aha, interesting... do you have one big locustfile with lots of User definitions that you rarely change or what?
I dont mind adding features that make it possible to configure more stuff in the UI per se, but I prefer to make "redeploying" easier.
It should ideally be a single command and take <10 seconds (like it is with swarm today and maybe what it could be with automatically distributed locustfiles when using docker). If it is that fast then having access to configuration in the web ui is not needed because changing the locustfile is almost as fast.
But if you want to build it then I'm not completely against it, as long as it doesnt add a ton of complexity and is not a UI-only feature (the same settings should also be configurable on command line or using some sort of config file).
from locust.
I had a very simple time deploying a kubernetes cluster for distributed load testing. There just needs to be a different env variable for the workers and the master and then a bash file runs different commands based on that env variable.
That sounds interesting, but I dont understand exactly what you mean :) Can you share some more details on this? Could be good us as well (right now we use dedicated machines for load generation but would probably move to kubernetes if we could get a good enough solution working)
from locust.
Yeah it's exactly that, and I have a whole bunch of tasks that I can toggle on or off depending on what I want to test
The reason I prefer having control over what tasks get run is because I think commenting out tasks in the locust file and redeploying can't really be considered a feature :) Not to mention this is more explicit about what is being ran, and it even allows for changing the configuration in the edit modal mid test run
It would be a very simple change for the UI, it would only involve exposing a new route and then updating the user. Something like:
user_class_name = request.args.get("user_class")
user_class = environment.available_user_classes[user_class_name]
user_class.fixed_count = int(request.args.get("fixed_count", 0))
(the only slight complexity is we need to communicate with the workers in distributed mode)
I think if we wanted something like this to be configurable on the command line it could be done with some config file or inline config:
--user-config '{ "user_1": {"fixed_count": 1, "host": "http://localhost"}, "user_2": {"fixed_count": 3, "host": "http://localhost:5000"}}'
from locust.
Yeah I have a Dockerfile that sets the entry point as a bash file:
FROM locustio/locust:2.16.1
ADD locust locust
ADD requirements.txt .
ADD run.sh .
RUN pip install -r requirements.txt
User root
# Set script to be executable
RUN chmod 755 run.sh
User locust
ENTRYPOINT ["bash", "./run.sh"]
The bash file runs locust based on the LOCUST_MODE
env variable:
LOCUST="locust"
LOCUS_OPTS="-f ./locust/main.py --class-picker"
LOCUST_MODE=${LOCUST_MODE}
if [[ "$LOCUST_MODE" = "master" ]]; then
LOCUS_OPTS="$LOCUS_OPTS --master --master-port=$LOCUST_MASTER_PORT"
elif [[ "$LOCUST_MODE" = "worker" ]]; then
LOCUS_OPTS="$LOCUS_OPTS --worker --master-port=$LOCUST_MASTER_PORT --master-host=$LOCUST_MASTER_URL"
fi
$LOCUST $LOCUS_OPTS
Then you just create a Kubernetes deployment. One node just needs to have the env variable LOCUST_MODE=master
. The all the workers have LOCUST_MODE=worker
and the LOCUST_MASTER_URL
There's a pretty good article on this
The time it takes to deploy and the commands to deploy depend on where it is hosted right? :)
from locust.
Yeah exactly, but in an ideal world you would have no dependencies to install. You would just copy over your locust file and then the build would happen really quickly
from locust.
Locust Swarm looks pretty interesting, I wasn't previously aware of this. But then you don't get a pretty web UI eh :)
from locust.
Related Issues (20)
- User Classes with Empty Tasks Results in TypeError: 'NoneType' object is not iterable HOT 2
- how the requests # being counted in my test case ? HOT 1
- Fixed RPS load test HOT 3
- HTML Report cannot be displayed HOT 5
- The Charts presentation in the report downloaded by locust is problematic HOT 3
- How to view the load of the master when starting in a distributed manner HOT 1
- Incorrect RPS reported in statistics and graphs (distributed mode) HOT 13
- Load shapes not removing users when user_classes changes HOT 4
- The exit code for controlling the locust process has a bug HOT 3
- Can the data in the csv be statistically averaged according to the current number of users, rather than the average from the start of the pressure test to the present? HOT 11
- Show the reset button even after stopping a test HOT 1
- `SequentialTaskSet` handles task weights in an inconsistent way
- Use `itertools.cycle` in `SequentialTaskSet`
- ConnectionRefusedError and ConnectionResetError judgment abnormal HOT 3
- Exception: Tried to stop User in an unexpected state: stopping. This should never happen. HOT 2
- Specifying users in CLI should use a keyword parameter HOT 2
- Can interfaces under the same task support collapsing and show the overall data HOT 2
- How to reset the report data without stopping the stress test? Is there a similar interface? HOT 2
- Log a warning if getting locustfile from master takes more than 60s
- locust/webui/dist/index.html script errors. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from locust.