Skip to content
Merged
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 5.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Other places at Geofabrik follow the pattern `https://download.geofabrik.de/$CON
- `IMPORT_GB_POSTCODES`: Whether to download and import the GB postcode dump (`true`) or path to GB postcode dump in the container. (default: `false`)
- `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`)
- `GUNICORN_WORKERS`: Specifies how many Gunicorn worker processes should handle API requests. If not explicitly set, it defaults to the number of available CPU cores `(nproc)`. Increase this value to improve concurrent request handling capacity, but ensure it aligns with your server's CPU resources.
- `NOMINATIM_PASSWORD`: The password to connect to the database with (default: `qaIACxO6wMR3`)

The following run parameters are available for configuration:
Expand Down
9 changes: 8 additions & 1 deletion 5.1/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,20 @@ export NOMINATIM_QUERY_TIMEOUT=10
export NOMINATIM_REQUEST_TIMEOUT=60
echo "Warming finished"

# Set default number of workers if not specified
if [ -z "$GUNICORN_WORKERS" ]; then
GUNICORN_WORKERS=$(nproc)
fi

echo "Starting Gunicorn with $GUNICORN_WORKERS workers"

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

cd "$PROJECT_DIR"
sudo -u nominatim gunicorn \
--bind :8080 \
--pid $GUNICORN_PID_FILE \
--workers 4 \
--workers $GUNICORN_WORKERS \
--daemon \
--enable-stdio-inheritance \
--worker-class uvicorn.workers.UvicornWorker \
Expand Down