mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 05:52:17 +00:00
docs update
This commit is contained in:
43
docs/benchmark/README.md
Normal file
43
docs/benchmark/README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# HTTP Hosts Benchmarking
|
||||
|
||||
This repository contains tools and scripts for benchmarking HTTP hosts performance.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before running the benchmarks, you need to create a path list (`path_list_500k.txt`). You have two options:
|
||||
|
||||
1. Generate from real-world server logs using `nginx_to_path_list.py`
|
||||
2. Generate randomly (Note: real-world usage patterns are typically non-random, e.g., ocean tiles are rarely accessed)
|
||||
|
||||
## Important Notes
|
||||
|
||||
- Run the benchmarks on `localhost`, and not over the internet! Otherwise you'd be just testing your internet speed.
|
||||
- The benchmark uses [wrk](https://github.com/wg/wrk) HTTP benchmarking tool
|
||||
|
||||
## Usage
|
||||
|
||||
Basic command:
|
||||
```bash
|
||||
wrk -c10 -t4 -d10s -s /data/ofm/benchmark/wrk_custom_list.lua http://localhost
|
||||
```
|
||||
|
||||
### Parameters Explained
|
||||
|
||||
- `-c10`: Number of connections to keep open
|
||||
- `-t4`: Number of threads to use
|
||||
- `-d10s`: Duration of the test (10 seconds)
|
||||
- `-s`: Script file to use
|
||||
|
||||
### Thread Count Considerations
|
||||
|
||||
- `-t1`: More accurate results as the URL list is loaded exactly in sequence
|
||||
- `-t4`: Better reflects real-world usage patterns
|
||||
|
||||
## Results
|
||||
|
||||
Benchmark results can be found in [results.md](results.md)
|
||||
|
||||
## Contributing
|
||||
|
||||
Feel free to submit your results including which hosts were used.
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import json
|
||||
|
||||
|
||||
# This script parses a nginx server log and creates a text file
|
||||
# which can be used in the Lua script.
|
||||
# The path file is not suppied in this repo.
|
||||
|
||||
with open('access.jsonl') as fp:
|
||||
json_lines = fp.readlines()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local counter = 1
|
||||
local lines = {}
|
||||
local url_base = "/planet/20231221_134737_pt/" -- trailing slash
|
||||
local url_base = "/planet/fake_version/" -- trailing slash
|
||||
local path_list_txt = "/data/ofm/benchmark/path_list_500k.txt"
|
||||
|
||||
for line in io.lines(path_list_txt) do
|
||||
@@ -129,6 +129,7 @@ def loadbalancer(hostname, user, port, noninteractive):
|
||||
@common_options
|
||||
def debug(hostname, user, port, noninteractive):
|
||||
c = get_connection(hostname, user, port)
|
||||
run_http_host_sync(c)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
wrk -c10 -t4 -d10s -s /data/ofm/benchmark/wrk_custom_list.lua http://localhost
|
||||
|
||||
# -t1 => more correct, since the url list is loaded exactly in sequence
|
||||
# -t4 => reflecting real world usage
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user