[mapserver-users] Understanding MapServer Memory Usage with WMS raster layers

Peter Schmitt pschmitt at gmail.com
Wed Oct 25 10:42:51 PDT 2017


Hi,

I am using MapServer as a WMS endpoint serving rasters. My configuration
has Supervisord running 8 mappserv processes which are listening on a
socket and dispatched via Nginx FastCGI. This all runs in the following
Docker image: https://github.com/pedros007/debian-mapserver

I noticed my memory utilization monotonically increases over time only
drops when there's a log in dmesg on the host Linux OS (... /not/ in the OS
of the Docker container) like the following:

      [508072.641250] Memory cgroup out of memory: Kill process 21147
(mapserv) score 143 or sacrifice child
      [508072.646072] Killed process 21147 (mapserv) total-vm:672384kB,
anon-rss:449172kB, file-rss:0kB, shmem-rss:0kB

I can dramatically lower my memory footprint by adding this directive to
every raster LAYER as suggested by
https://github.com/mapserver/mapserver/issues/4389

      PROCESSING "CLOSE_CONNECTION=ALWAYS"

With all of that, I have a few questions:

1.  With the default CLOSE_CONNECTION=DEFER on a raster layer, are raster
file handles ever closed?
2.  What does the config variable GDAL_CACHEMAX do in relation to
CLOSE_CONNECTION = DEFER or ALWAYS?  I assume with processing directive
CLOSE_CONNECTION=ALWAYS, GDAL_CACHEMAX does nothing for me.
3.  My Mapfile actually reads rasters at /vsicurl/ URLs.  I assume that
VSI_CACHE=TRUE and VSI_CACHE_SIZE are a LRU cache which is in addition to
the GDAL cache and any OS/host level caching of open file handles. Is the
same data cached separately in up to 3 places (GDAL cache, Host cache and
VSI cache)?

Thanks!
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20171025/c738a347/attachment.html>


More information about the mapserver-users mailing list