[mapserver-users] Gallery: running mapserver in docker on kubernetes

Peter Schmitt pschmitt at gmail.com
Thu Aug 29 08:42:41 PDT 2019


> If anyone is interested by our docker image, you can find it here:
https://github.com/camptocamp/docker-mapserver

Thanks for sharing this, Yves!

Regarding /vsicurl/ performance you mentioned:

> We saw some drawback when displaying maps on low scale as too much files
should be read. Visicurl seems copy the files in the container. We need to
check this to confirm, but probably someone have a better understanding of
how visicurl and visis3 work.

There might be two things at play:  First, using cloud-optimized geotiffs
greatly reduces the number of curl requests required.  Secondly, a few GDAL
config options dramatically improved performance for me.  Here's what I've
had the best luck with (although your specific use case probably requires
different settings)

CONFIG "CPL_VSIL_CURL_ALLOWED_EXTENSIONS"      "vrt tif geojson zip gpkg"
CONFIG "GDAL_DISABLE_READDIR_ON_OPEN"       "YES"
CONFIG "GDAL_INGESTED_BYTES_AT_OPEN"      "262144" # Bytes. This is the
value required to have 1 CURL request when opening one of our COGs that has
many levels deep of overviews
CONFIG "VSI_CACHE"      "FALSE"
CONFIG "GDAL_CACHEMAX"      "80"       # MB
CONFIG "OGR_SQLITE_CACHE"                      "10"       # MB


I'm curious about this comment in your config: "mapserver has memory leaks,
this limit should improve long term memory usage"
https://github.com/camptocamp/docker-mapserver/blob/ba86f87b0ec1357ad5a8ae6159a005e24db64e3f/server/runtime/etc/apache2/conf-enabled/mapserver.conf#L1-L2

I've got a MapServer instance configured with > 100 million requests/year.
I also see some behavior suggesting a memory leak somewhere, but I have not
tracked it down. Here's my Dockerized MapServer, which uses NGINX to proxy
to MapServer via FCGI: https://github.com/pedros007/debian-mapserver

Here's my memory use for a Docker container running 8 mapserv processes.
300% in the scale corresponds to 3 GB of memory usage.
https://i.imgur.com/CXBDsuw.png

Cheers,
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20190829/d1a677c2/attachment-0001.html>


More information about the mapserver-users mailing list