Add load testing based on test cases - #35
Conversation
|
Ah, just saw the test cases by @ekkea. I'll re-make this PR with these cases as the basis instead. |
|
A few observations on the load testing:
Based on these observations, I've updated the Dockerfile with default configurations that should work for a four core machine. One can use the |
|
So in case of single client and a server with 4 CPUs, best configuration would probably be 1 Worker and 4 Threads? But in this case the number of workers shouldn‘t matter a lot. |
|
Yes, this should give you the fastest solving times in the case of a single user, but might give you large load spikes if the optimizer fails to solve the problem, as it would run for 25 seconds with all cores fully used, which might be fine, depending on what else is running on the system. |
|
@andig Any further clarification needed or objections to adding this PR to the repository? |
I've expanded the test suite to include examples read from JSON files. These files are also used to run a load test against the API.
The Makefile holds the configuration for these tests.
To run, execute
make run-gunicornin a shell.In a second shell, run
make loadtest.There are two setups tested: One where there are as many users as workers, and one, where there are twice as many.
An example output looks like the following
You can use environment variables before executing
make run-gunicornto alter the configuration of the solver, e.g.export OPTIMIZER_TIME_LIMIT=10 make run-gunicorn