mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
work
This commit is contained in:
29
scripts/benchmark/wrk_custom_list.lua
Normal file
29
scripts/benchmark/wrk_custom_list.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
local counter = 1
|
||||
local lines = {}
|
||||
local base_path = "/planet/20231208_091355/tiles/"
|
||||
local file_path = "/data/ofm/benchmark/path_list_small.txt"
|
||||
|
||||
for line in io.lines(file_path) do
|
||||
table.insert(lines, base_path .. line)
|
||||
end
|
||||
|
||||
local function getNextUrl()
|
||||
-- Get the next URL from the list
|
||||
local url_path = lines[counter]
|
||||
counter = counter + 1
|
||||
|
||||
-- If we've gone past the end of the list, wrap around to the start
|
||||
if counter > #lines then
|
||||
counter = 1
|
||||
end
|
||||
|
||||
return url_path
|
||||
end
|
||||
|
||||
request = function()
|
||||
-- Return the request object with the current URL path
|
||||
local path = getNextUrl()
|
||||
local headers = {}
|
||||
headers["Host"] = "ofm"
|
||||
return wrk.format('GET', path, headers, nil)
|
||||
end
|
||||
5
scripts/http_host/mount_btrfs.sh
Normal file
5
scripts/http_host/mount_btrfs.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
mkdir -p mnt_ro
|
||||
sudo mount -v \
|
||||
-t btrfs \
|
||||
-o ro \
|
||||
image.btrfs mnt_ro
|
||||
17
scripts/http_host/nginx_site.conf
Normal file
17
scripts/http_host/nginx_site.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
server {
|
||||
server_name ofm tiles.openfreemaps.org;
|
||||
# test with
|
||||
# curl -H "Host: ofm" http://localhost/planet/20231208_091355/tiles/7/72/48.pbf
|
||||
|
||||
|
||||
#access_log /data/ofm/logs/nginx-access.log access_json;
|
||||
access_log off;
|
||||
error_log /data/ofm/logs/nginx-error.log;
|
||||
|
||||
location /planet/20231208_091355 {
|
||||
gzip off;
|
||||
|
||||
alias /data/ofm/runs/planet_20231208_091355/mnt_ro/extract;
|
||||
autoindex on; # Enables listing of directory
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sudo umount mnt || true
|
||||
rm -rf mnt
|
||||
sudo umount mnt_rw || true
|
||||
rm -rf mnt_rw
|
||||
rm -f image.btrfs
|
||||
|
||||
|
||||
@@ -16,21 +16,21 @@ mkfs.btrfs -v \
|
||||
|
||||
# https://btrfs.readthedocs.io/en/latest/btrfs-man5.html#mount-options
|
||||
# compression doesn't make sense, data is already gzip compressed
|
||||
mkdir -p mnt
|
||||
mkdir -p mnt_rw
|
||||
sudo mount -v \
|
||||
-t btrfs \
|
||||
-o noacl,nobarrier,noatime,max_inline=4096 \
|
||||
image.btrfs mnt
|
||||
image.btrfs mnt_rw
|
||||
|
||||
|
||||
sudo chown ofm:ofm -R mnt
|
||||
sudo chown ofm:ofm -R mnt_rw
|
||||
|
||||
../../tile_gen/venv/bin/python ../../tile_gen/extract.py output.mbtiles mnt/extract \
|
||||
../../tile_gen/venv/bin/python ../../tile_gen/extract.py output.mbtiles mnt_rw/extract \
|
||||
> "extract_out.log" 2> "extract_err.log"
|
||||
|
||||
sudo umount mnt
|
||||
sudo umount mnt_rw
|
||||
|
||||
../../tile_gen/venv/bin/python ../../tile_gen/shrink_btrfs.py image.btrfs
|
||||
|
||||
|
||||
# pigz -k image.btrfs --fast
|
||||
|
||||
|
||||
Reference in New Issue
Block a user