Components: - GeoServer uses the geotools library for the heavy lifting (gis data formats, referencing, data structures) - image processing provided by the java advanced imaging library; with JAI-EXT providing GIS operations (to respect concepts like no-data) - image formats provided by image-is library, with imageio-ext for GIS formats
A goal of the image processing is to be lazy and only do working when output is required ... for example when writing content out. So the native and reproject requests are taking the same time to setup; but when starting to write the result out the data will be pulled through an image processing chain - and the work required for reprojecting is much greater. There is a fast-path that engages when output and input line up; allowing the output to be written out directly from sampling the input. In other cases (say when requesting several layers as a single getmap everything must be drawn; and then the result encoded into an output image. I hope this helps - your developer logging may indicate if the "fast-path" was taken? Jody On Wed, Oct 19, 2022 at 2:45 AM Pa Pu <ppprim...@gmail.com> wrote: > Hi all, > > I posted this issue on stackoverflow > <https://stackoverflow.com/questions/74114071/geoserver-bottleneck-when-writing-response-image> > but it was recommended to me to ask rather here: > > I've come across a bottleneck that occurs when writing the final png file > from a WMS request. I'm rendering a geotiff (tiled, LZW compressed, with > external overviews, 90 MB file), reprojecting the layer from native CRS to > EPSG:4326. When requesting an image of the same size in native CRS, the > request takes around 100 ms, when reprojected, the request takes on average > around 7000 ms. > > I had a look in logs with GEOSERVER_DEVELOPER_LOGGING options and both > requests (native/reprojected) are taking similar amount of time except when > writing the final png output image, where the request for reprojected image > gets stucked: > > 2022-10-18 14:12:02,059 DEBUG [org.geoserver.wms.map] - Writing png image > ... > 2022-10-18 14:12:09,139 DEBUG [org.geoserver.wms.map] - Writing png image > ... done! > > Using these log messages, I was able to look up following function in java: > > public void formatImageOutputStream( > RenderedImage image, OutputStream outStream, WMSMapContent > mapContent) > > As I'm not sure what this function does, could anyone advise me where to > look next? The server is a virtual machine with Windows Server running in > HyperV, multiple cores and plenty of memory allocated to java. The issue > seems to be affecting all layers, however same rasters and layers are > working fine in other Geoserver instances that I run on physical machines. > I understand this might not be a Geoserver issue but I would still love to > hear your suggestions on where I could investigate. > > Thanks a lot. > > Geoserver version: 2.20.2 Container: Tomcat 9.0 (jre1.8.0_321) > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users > -- -- Jody Garnett
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users