Generates realistic traffic for load testing tile servers. Useful for:
- Measuring throughput, latency and concurrency of your tile serving stack.
- Identifying bottlenecks such as network, disk I/O, filesystem, CPU.
You could benchmark using random tiles instead, but 70% of those will be ocean.
Install siege via apt install siege
or another package manager.
Create a urls.txt from anonymized tile requests to openstreetmap.org for the week of 2021-08-08:
python create_urls.py [--bbox=MIN_LON,MIN_LAT,MAX_LON,MAX_LAT] [--maxzoom=19]
The output urls.txt will contain about 10,000 rows, with server parameters you can edit:
PROT=http
HOST=localhost
PORT=8080
PATH=
EXT=pbf
$(PROT)://$(HOST):$(PORT)/$(PATH)9/271/168.$(EXT)
$(PROT)://$(HOST):$(PORT)/$(PATH)9/264/186.$(EXT)
...
Then run your load test:
siege --file=urls.txt
The frequency distribution of zooms will match the real data:
0 | 2122775 β
1 | 2216794 β
2 | 6397943 β
3 | 12472472 ββ
4 | 16428098 βββ
5 | 27779242 βββββ
6 | 38843942 ββββββ
7 | 41504547 βββββββ
8 | 49778705 ββββββββ
9 | 56767305 βββββββββ
10 | 72384991 βββββββββββ
11 | 71587598 βββββββββββ
12 | 99260380 βββββββββββββββ
13 | 135358540 ββββββββββββββββββββ
14 | 135036605 ββββββββββββββββββββ
15 | 136459409 ββββββββββββββββββββ
16 | 102903474 ββββββββββββββββ
17 | 66522472 ββββββββββ
18 | 37851474 ββββββ
19 | 6217710 β
- The sequence of requests generated will not exhibit the same spatial correlation as real users panning and zooming.