wiktorn / Overpass-API

Overpass API docker image
MIT License
133 stars 47 forks source link

Timeout error for trivial query #78

Closed nilsnolde closed 2 years ago

nilsnolde commented 2 years ago

I just started using the API again, I did that weeks ago already and I remember it working, local and with overpass-turbo.

However, now it doesn't seem to work. I pulled your 0.7.55.9 image and have the following docker-compose:

version: '3.8'
services:
  overpass:
    image: wiktorn/overpass-api:0.7.55.9
    container_name: overpass_original
    ports:
      - 31942:80
    volumes:
      - ./data:/db
    environment:
      - OVERPASS_META=no 
      - OVERPASS_MODE=init 
      - OVERPASS_PLANET_URL=https://download.geofabrik.de/europe/guernsey-jersey-latest.osm.bz2
      - OVERPASS_DIFF_URL=https://download.geofabrik.de/europe/guernsey-jersey-updates/
      - OVERPASS_UPDATE_SLEEP=160000 
      - OVERPASS_SPACE=1000000000

it's a tiny channel island, so it takes only 2 mins to spin up. the following curl curl "http://localhost:31942/api/interpreter?data=node(5137693924)%3Bout%20geom%3B" to just request this node ̣ results in HTML with the message runtime error: open64: 0 Success /osm3s_v0.7.55_osm_base Dispatcher_Client::request_read_and_idx::timeout. The server is probably too busy to handle your request.. looking into the dispatcher logs I see lines like these:

2021-10-01 10:47:05 [20] waited idle for 8 cycles.
2021-10-01 10:47:05 [20] waited idle for 8 cycles.
2021-10-01 10:47:06 [68] Dispatcher_Client::request_read_and_idx::timeout /osm3s_v0.7.55_osm_base 0 Success 172.26.0.1
2021-10-01 10:47:06 [20] waited idle for 8 cycles.
2021-10-01 10:47:06 [20] hangup of process 68.
2021-10-01 10:54:05 [78] request_read_and_idx() start
2021-10-01 10:54:05 [20] waited idle for 4186 cycles.
2021-10-01 10:54:06 [20] waited idle for 8 cycles.
2021-10-01 10:54:06 [20] waited idle for 8 cycles.

I'm not familiar enough with overpass to interpret the very frequent waited idle for 8 cycles. lines and I have no idea why it's having read timeouts for such a trivial query. I checked the OSM file from geofabrik, it's legit, I even spun up a valhalla container to see if another app can read the .bz2 file, the graphs built.

do you have any idea @wiktorn ? probably I'm overlooking smth really basic :sweat_smile:

wiktorn commented 2 years ago

When I started with the same arguments I had the same issue. Removing OVERPASS_SPACE=1000000000 resolved it.

nilsnolde commented 2 years ago

Oh boy.. thanks a bunch! So it’s not safe to use that setting? I’ll try around a little and see what the limits are without explicitly setting it the max memory