[GIS] GeoServer rendering performance significantly affected by vector icon size

geoserverperformancesldwms

I'm having the craziest GeoServer experience right now and I was hoping to get some input on what might be causing this behaviour.

I'm using Apache Bench to benchmark rendering performance for a layer via GeoServer's WMS interface and accidentally discovered that the vector icon size has a very significant effect on performance. The image I'm rendering:

  • 25,000 point features
  • Single rendering rule in SLD
  • 1900×1200 pixels
  • Request concurrency is 5
  • GeoServer is 2.6.1
  • JVM is Oracle Java 7 SE
  • Not using native JAI

The SLD's single rendering rule looks like this:

<PointSymbolizer>
    <Graphic>
      <Mark>
        <WellKnownName>circle</WellKnownName>
        <Fill>
          <CssParameter name="fill">#FF0000</CssParameter>
          <CssParameter name="fill-opacity">1.0</CssParameter>
        </Fill>
      </Mark>
      <Size>
        <ogc:Literal>50</ogc:Literal>
      </Size>
    </Graphic>
</PointSymbolizer>

This chart shows how response time for the same request varies based on icon size

enter image description here

As this is a vector icon I had assumed that rendering any size had as much impact on performance as any other size, but it appears that beyond a certain size (perhaps 16px) performance begins to suffer and beyond 30px it drops dramatically.

This has obvious implications for how I author future SLDs but right now I am more interested in why this would happen. Any thoughts?

EDIT: With a little more investigation I have found that increasing the (scaled) size of a PNG icon gives a much more linear increase in rendering time and there is a size, for this particular layer, when PNG icons become faster than vector icons. I have also seen that the relationship between icon size and performance is more linear with a smaller number of features. As it looks like the number of features and icon size both interact to affect performance I can only assume this is related to memory usage, I'm just not sure exactly how.

Best Answer

You actually forgot to mention, nor included it in the graph, how you measure "icon size": 1) width/height on the X-axis, 2) pixel area of icon in number of pixels

I guess it is 1), based on regular icon sizes.

That probably explains your graph: the increase in icon area size as measured in number of pixels is quadratic, each doubling of the width, increases the area by a factor 4.

So the number of pixels that need to be processed / generated / rendered for your vector icons, increases considerably with the "size" / width of the icon, which seems roughly consistent with the results in your graph.

Related Question