<div dir="ltr">Hi,<div><br></div><div>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: <a href="https://github.com/pedros007/debian-mapserver">https://github.com/pedros007/debian-mapserver</a></div><div><br></div><div>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:</div><div><br></div><div><div>      [508072.641250] Memory cgroup out of memory: Kill process 21147 (mapserv) score 143 or sacrifice child</div><div>      [508072.646072] Killed process 21147 (mapserv) total-vm:672384kB, anon-rss:449172kB, file-rss:0kB, shmem-rss:0kB</div><div><br></div><div>I can dramatically lower my memory footprint by adding this directive to every raster LAYER as suggested by  <a href="https://github.com/mapserver/mapserver/issues/4389">https://github.com/mapserver/mapserver/issues/4389</a></div><div><br></div><div>      <span style="color:rgb(36,41,46);font-family:-apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">PROCESSING "CLOSE_CONNECTION=ALWAYS"</span></div><div><br></div><div>With all of that, I have a few questions:</div><div><br></div><div>1.  With the default CLOSE_CONNECTION=DEFER on a raster layer, are raster file handles ever closed?</div><div>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.</div><div>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)?</div><div><br></div>Thanks!<br><div class="gmail_signature">Pete</div><div class="gmail_signature"><br></div>
</div></div>