mediagis / nominatim-docker

100% working container for Nominatim
Creative Commons Zero v1.0 Universal
1.08k stars 442 forks source link

psycopg2.OperationalError: server closed the connection unexpectedly #348

Closed tamis-laan closed 2 years ago

tamis-laan commented 2 years ago

I'm using docker to run a nominatim instance:

  # Nominatim geocoder
  nominatim:
    image: mediagis/nominatim:4.0
    volumes:
      - nominatim-data:/var/lib/postgresql/12/main
    environment:
      PBF_URL: https://download.geofabrik.de/europe/netherlands-latest.osm.pbf
      REPLICATION_URL: https://download.geofabrik.de/europe/netherlands-updates/
    shm_size: 3gb
    restart: always
    deploy:
      resources:
        limits:
          memory: 6G

At first start the container starts the indexing process, after hours and hours is crashes. I attached a screenshot to show the output: screenshot

It then restarts and drops the database content.

Hardware Configuration (please complete the following information):

philipkozeny commented 2 years ago

Seems like you only allow docker to use 6GB of ram, which is probably too low. You can try to set environment variables documented in https://github.com/mediagis/nominatim-docker/tree/master/4.0#postgresql-tuning & https://nominatim.org/release-docs/4.0.1/admin/Installation/#tuning-the-postgresql-database to reduce RAM usage and give it another go.