[mapserver-dev] Mapserver causes too many open files error

Tamas Szekeres szekerest at gmail.com
Sun Nov 26 12:00:38 PST 2017


Hi Devs,

We experienced an issue with mapserver 7.x (comparing to 6.x) that it
causes too many open file handles in a multi-threaded environment. Actually
the process is using the ASP.NET backend where the web requests are served
through the ASP.NET worker process by using a thread pool, and the process
should be considered as a long running process, where msCleanup is not
being called regularly.

By looking into the code the issue should probably be dedicated to the
global font cache approach implemented in mapserver 7. Since freetype keeps
the font files open, we get the number of fonts used in the mapfile
multiplied with the thread pool size which may exceed the number of stdio
open file handle limit as per
https://msdn.microsoft.com/en-us/library/kdfaxaay(v=vs.140).aspx

With the former approach (ie. 6.x) the font cache was implemented in the
renderers and the cache cleanup was happening on the renderer cleanup
in msFreeOutputFormat/msFreeMap.

Do you have any suggestions about a proper workaround to this?

I might think that we should either bind the font cache to each map objects
(like earlier) or use a single common font cache for the entire process. I
would probably prefer the first one as soon as we want to clean up every
resources what a rendering session allocates.

Thanks,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20171126/ae55a0c4/attachment.html>


More information about the mapserver-dev mailing list