camptocamp / docker-mapserver

https://hub.docker.com/r/camptocamp/mapserver/
BSD 2-Clause "Simplified" License
42 stars 30 forks source link

Postgis Connection lost #304

Open kesslerf opened 2 years ago

kesslerf commented 2 years ago

Hey, Our Mapserver seems to lose the connection to the used DB (both are stored in docker containers) after some (varying) time. I tried to play with the environment variables, as I thought it might have to do with idle connections that get terminated.

      BUSY_TIMEOUT: 10
      IDLE_TIMEOUT: 10
      IO_TIMEOUT: 10

This however didnt lead to closed connections after 10 seconds which I assumed are the unit for this values. Is there like a minimum threshold or can I set all of them to 0 to never terminate the connections automatically?

kesslerf commented 2 years ago

Ok I should probably add that I am using a docker-compose file: mapserver: image: camptocamp/mapserver:7.6-20-04 ports:

sbrunner commented 2 years ago

Those values are used by Apache to integrate MapServer, to not close the database connections you should add in your layer in the MapFile: PROCESSING "CLOSE_CONNECTION=DEFER"

kesslerf commented 2 years ago

Thank you for the Answer. I will try it and report if it helped.

kesslerf commented 2 years ago

Unfortunately this didnt work. I still get a connection timeout.