{"id":19840716,"url":"https://github.com/graphhopper/graphhopper-load-test","last_synced_at":"2026-05-12T18:36:43.385Z","repository":{"id":39878171,"uuid":"245512485","full_name":"graphhopper/graphhopper-load-test","owner":"graphhopper","description":"Load testing of the GraphHopper architecture.","archived":false,"fork":false,"pushed_at":"2024-05-22T09:40:48.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-11T11:36:51.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphhopper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-06T20:40:41.000Z","updated_at":"2024-05-22T09:40:52.000Z","dependencies_parsed_at":"2024-11-12T12:41:41.929Z","dependency_job_id":null,"html_url":"https://github.com/graphhopper/graphhopper-load-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphhopper%2Fgraphhopper-load-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphhopper%2Fgraphhopper-load-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphhopper%2Fgraphhopper-load-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphhopper%2Fgraphhopper-load-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphhopper","download_url":"https://codeload.github.com/graphhopper/graphhopper-load-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241210035,"owners_count":19927771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T12:27:56.117Z","updated_at":"2026-05-12T18:36:43.350Z","avatar_url":"https://github.com/graphhopper.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Load testing\n\nThis tool will allow you to load test the GraphHopper API. It uses [Locust](https://locust.io) to\nrun a swarm of users on the infrastructure.\nThe business logic of what endpoints to hit and with what parameters is saved in `personas/`.\n\n## Build\n\nIf you have admin permissions to `graphhopper/load-testing`, you can run `make push` to build and\npush the Docker image to Docker Hub.\n\nOtherwise you can run `make build` to build the Docker image without pushing it.\n\n## Run\n\n### Docker or no Docker?\n\nThis application is mainly written in Python. If you don't want to deal with Python's packaging,\nyou can use Docker. In this case prepend all the commands that you see below with \n`docker run graphhopper/load-testing`. So if you see `./run -h`, you can use\n`docker run graphhopper/load-testing ./run -h` to run the command.\n\nIf, on the other hand, you're familiar with Python and its packaging system, you can first set up\nyour environment as you see fit (e.g. using virtual environment). The only thing that is required\nis to install the packages in `requirements.txt`, usually done with `pip install -r requirements.txt`.\n\n### Get current version\n\nTo print the current version of the app, run:\n\n    ./run --version\n\n### Get help\n\nRun the following to see the help page on how to run this tool.\n\n    ./run -h\n\n### Basic usage\n\n    ./run -p vrp -d 10s -u 10 \u003cexample.com\u003e\n\nIn its most basic form, all you need to do to start a load testing session, is to configure:\n* Persona used with `-p`. E.g. for VRP, use `vrp`. Check the help (`./run -h`) to see all the\n  available personas.\n* Duration with `-d`, e.g. `300s` for 300 seconds or `20m` for 20 minutes.\n* The number of users with `-u`. In general, each user will run the associated task every second or\n  so. Technically, the wait time is [`random.expovariate`](https://docs.python.org/3.7/library/random.html#random.expovariate)(1),\n  meaning an average of 1 second. Though VRP is more complex as it does an optimize and then\n  solutions. The ramp-up of users will be instantaneous as the ramp-up is set to the number of\n  users.\n* The base URL. This is where the base of the service is deployed. A few examples:\n  * If you're testing the matrix service at `/matrix` on HTTPS, then the base URL would be\n    `https://example.com/`.\n  * If you're testing the VRP service at `/api/1/vrp` on port 8080, then the base URL would be\n    `http://example.com:8080/api/1`.\n* [optional] set the API key using `--api-key [key]`\n\n### Three ways of running\n\nThere are currently three ways of running a load test. This is not ideal, the reasons are purely\ntechnical and it would be best to have just one, but here we are.\n\n* Using `./run`. This is mostly the best way. It is a wrapper around Locust. In this variation, it\n  runs the `locust` CLI command, setting the needed parameters and environment variables for us.\n* Using `./run --custom-output`. This one uses the Python programmatic API to the Locust library,\n  so it's the most extensible option. Currently we have our own custom output, for times when you\n  don't want to get all the output of intermediate results.\n* Using `locust` (`docker run graphhopper/load-testing locust`). This is for times when you want to\n  use some Locust functionality that is not yet included in `./run`. If this happens, we should\n  probably add support for the missing feature in the `./run` command.\n\n### Debugging errors\n\nIf you want more information about failed requests, use the `--debug` switch and it will display the\nactual error for every error that happens in real time.\n\n### Configuring VRP\n\nVRP has some additional configurations that we can use when running a load test. You can set the\nlikelyhood of using TomTom data with `--vrp-tomtom-probability`,\nset VRP profiles with `--vrp-profiles`, set the max VRP vehicle profiles with `--vrp-max-profiles`\nand set the max locations with `--vrp-max-locations`.\n\nRead more about it on the `./run -h` help page.\n\n### Running in master/worker mode\n\nMost of the times, running one instance of the load test is not enough. I can reliable use around\n300 users per running instance, it seems to not handle more. So in order to run with more users, we\nneed to run Locust in a master/worker configuration.\n\nYou run the master once and then the workers how many times you want, I go for `users/300`. For\nexample, if I want to do 1800 users, I will run 6 workers (6 * 300 = 1800).\n\n    # master\n    ./run --debug -p vrp -d 600s -u 600 --master --expect-workers=2 \u003cexample.com\u003e\n\n    # worker\n    ./run --debug -p vrp --vrp-max-locations 5 --worker --master-host=\u003cmaster-ip\u003e \u003cexample.com\u003e\n\nThe `\u003cmaster-ip\u003e` can be `127.0.0.1`, if you're running other instances on the same machine, which\nwe do a lot.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphhopper%2Fgraphhopper-load-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphhopper%2Fgraphhopper-load-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphhopper%2Fgraphhopper-load-test/lists"}