Added postgresql indexes
This commit is contained in:
1 parent
d7c2817f9f
commit
50e60e634d
3 files changed
+65
-71
No files matched your search
@@ -1,4 +1,6 @@
|
||||
# openstreetmap-tile-server
|
||||
BASED ON https://github.com/Overv/openstreetmap-tile-server
|
||||
ADDED: postgresql indexes to make it faster.
|
||||
|
||||
This container allows you to easily set up an OpenStreetMap PNG tile server given a `.osm.pbf` file. It is based on the [latest Ubuntu 18.04 LTS guide](https://switch2osm.org/manually-building-a-tile-server-18-04-lts/) from [switch2osm.org](https://switch2osm.org/) and therefore uses the default OpenStreetMap style.
|
||||
|
||||
@@ -10,7 +12,7 @@ First create a Docker volume to hold the PostgreSQL database that will contain t
|
||||
|
||||
Next, download an .osm.pbf extract from geofabrik.de for the region that you're interested in. You can then start importing it into PostgreSQL by running a container and mounting the file as `/data.osm.pbf`. For example:
|
||||
|
||||
docker run -v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf -v openstreetmap-data:/var/lib/postgresql/10/main overv/openstreetmap-tile-server import
|
||||
docker run -v /absolute/path/to/luxembourg.osm.pbf:/data.osm.pbf -v openstreetmap-data:/var/lib/postgresql/10/main kosar/openstreetmap-tile-server import
|
||||
|
||||
If the container exits without errors, then your data has been successfully imported and you are now ready to run the tile server.
|
||||
|
||||
@@ -18,7 +20,7 @@ If the container exits without errors, then your data has been successfully impo
|
||||
|
||||
Run the server like this:
|
||||
|
||||
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main -d overv/openstreetmap-tile-server run
|
||||
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main -d kosar/openstreetmap-tile-server run
|
||||
|
||||
Your tiles will now be available at `http://localhost:80/tile/{z}/{x}/{y}.png`. The demo map in `leaflet-demo.html` will then be available on `http://localhost:80`. Note that it will initially quite a bit of time to render the larger tiles for the first time.
|
||||
|
||||
@@ -27,7 +29,7 @@ Your tiles will now be available at `http://localhost:80/tile/{z}/{x}/{y}.png`.
|
||||
Tiles that have already been rendered will be stored in `/var/lib/mod_tile`. To make sure that this data survives container restarts, you should create another volume for it:
|
||||
|
||||
docker volume create openstreetmap-rendered-tiles
|
||||
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main -v openstreetmap-rendered-tiles:/var/lib/mod_tile -d overv/openstreetmap-tile-server run
|
||||
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main -v openstreetmap-rendered-tiles:/var/lib/mod_tile -d kosar/openstreetmap-tile-server run
|
||||
|
||||
## Performance tuning
|
||||
|
||||
@@ -35,13 +37,13 @@ Tiles that have already been rendered will be stored in `/var/lib/mod_tile`. To
|
||||
|
||||
The import and tile serving processes use 4 threads by default, but this number can be changed by setting the `THREADS` environment variable. For example:
|
||||
|
||||
docker run -p 80:80 -e THREADS=24 -v openstreetmap-data:/var/lib/postgresql/10/main -d overv/openstreetmap-tile-server run
|
||||
docker run -p 80:80 -e THREADS=24 -v openstreetmap-data:/var/lib/postgresql/10/main -d kosar/openstreetmap-tile-server run
|
||||
|
||||
### AUTOVACUUM
|
||||
|
||||
The database use the autovacuum feature by default. This behavior can be changed with `AUTOVACUUM` environment variable. For example:
|
||||
|
||||
docker run -p 80:80 -e AUTOVACUUM=off -v openstreetmap-data:/var/lib/postgresql/10/main -d overv/openstreetmap-tile-server
|
||||
docker run -p 80:80 -e AUTOVACUUM=off -v openstreetmap-data:/var/lib/postgresql/10/main -d kosar/openstreetmap-tile-server
|
||||
|
||||
## Benchmarks
|
||||
|
||||
@@ -58,14 +60,14 @@ If you encounter such entries in the log, it will mean that the default shared m
|
||||
|
||||
To raise it use `--shm-size` parameter. For example:
|
||||
|
||||
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main --shm-size="192m" -d overv/openstreetmap-tile-server run
|
||||
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main --shm-size="192m" -d kosar/openstreetmap-tile-server run
|
||||
|
||||
For too high values you may notice excessive CPU load and memory usage. It might be that you will have to experimentally find the best values for yourself.
|
||||
|
||||
## License
|
||||
|
||||
```
|
||||
Copyright 2019 Alexander Overvoorde
|
||||
Copyright 2019 Bogdan Kosarevskyi
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
Reference in new issue
Block a user