Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ENABLE_WARMUP parameter #595

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 4.5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Other places at Geofabrik follow the pattern `https://download.geofabrik.de/$CON
- `IMPORT_TIGER_ADDRESSES`: Whether to download and import the Tiger address data (`true`) or path to a preprocessed Tiger address set in the container. (default: `false`)
- `THREADS`: How many threads should be used to import (default: number of processing units available to the current process via `nproc`)
- `NOMINATIM_PASSWORD`: The password to connect to the database with (default: `qaIACxO6wMR3`)
- `ENABLE_WARMUP`: Enable or disable database warmup. Skipping warmup allows the container to answer requests immediately but possibly slower. (default: true)

The following run parameters are available for configuration:

Expand Down
3 changes: 3 additions & 0 deletions 4.5/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ docker run -it \
#Sets the used threads at the import (default 16)
-e THREADS=10 \

#Enable or disable database warmup. Skipping warmup allows the container to answer requests immediately but possibly slower. (default: true)
-e ENABLE_WARMUP=true/false

#Sets the Docker tmpfs. Highly recommended for bigger imports like Europe. At least 1GB - ideally half of the available RAM.
--shm-size=60g \

Expand Down
27 changes: 17 additions & 10 deletions 4.5/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,25 @@ fi
tail -Fv /var/log/postgresql/postgresql-16-main.log &
tailpid=${!}

export NOMINATIM_QUERY_TIMEOUT=600
export NOMINATIM_REQUEST_TIMEOUT=3600
if [ "$REVERSE_ONLY" = "true" ]; then
echo "Warm database caches for reverse queries"
sudo -H -E -u nominatim nominatim admin --warm --reverse > /dev/null
if [ "$ENABLE_WARMUP" = "true" ] || [ -z "$ENABLE_WARMUP" ]; then
export NOMINATIM_QUERY_TIMEOUT=600
export NOMINATIM_REQUEST_TIMEOUT=3600

if [ "$REVERSE_ONLY" = "true" ]; then
echo "Warm database caches for reverse queries"
sudo -H -E -u nominatim nominatim admin --warm --reverse > /dev/null
else
echo "Warm database caches for search and reverse queries"
sudo -H -E -u nominatim nominatim admin --warm > /dev/null
fi

export NOMINATIM_QUERY_TIMEOUT=10
export NOMINATIM_REQUEST_TIMEOUT=60

echo "Warming finished"
else
echo "Warm database caches for search and reverse queries"
sudo -H -E -u nominatim nominatim admin --warm > /dev/null
echo "skipping database warmup"
fi
export NOMINATIM_QUERY_TIMEOUT=10
export NOMINATIM_REQUEST_TIMEOUT=60
echo "Warming finished"

echo "--> Nominatim is ready to accept requests"

Expand Down
Loading