GeoServer NetCDF – Resolving Open Files Issue When Reading NetCDF

geoservernetcdf

I have plenty of NetCDFs stored in my GeoServer. When I'm visualising a NetCDF layer with my front-end, I can see the number of reading files growing by using this command (22142 is my tomcat PID) :

ls -l /proc/22142/fd | wc -l

From 200 open files I have 300+ open files when I'm visualising NetCDF.: OK. But when I close my visualization page, the number of open files decreases but not to 200. And it keeps growing while I keep displaying layers, until reaching max open file limit.

Why aren't some files closed when GeoServer obviously don't need to access them anymore?

Best Answer

Because opening a NetCDF file is a pretty expensive operation (it's not just opening the file, but reading and interpreting the file structure, variables, times, and so on), so there is a raster reader cache that avoids it.

OGC services are stateless, GeoServer has no idea about your "visualization page". You can drop those caches using the "reset" button in the "Server status" page.

Related Question