3

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
  • 1900x1200 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.

  • Which renderer are you using? – BradHards Dec 13 '14 at 2:57
  • Do I have a choice? I don't think I've come across this so far so if there is a default I'm probably using that one. – tomfumb Dec 13 '14 at 4:39
  • 1
    OK, just wondered if you were using the Marlin rasteriser. The default depends on your JVM. See geo-solutions.it/blog/… – BradHards Dec 13 '14 at 4:54
  • @BradHards thanks for the tip - I set up the Marlin renderer and it resulted in a significant performance gain in high-concurrency environments and also removed the spike in response time for larger vector icons (raster performance remains unchanged). – tomfumb Dec 15 '14 at 23:37
2

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.

  • 1
    I'm not sure I agree - as I said in my edit raster icons don't show the same relationship, but also the vector rendering time plateaus around the high-30/low-40 pixels. The SLD snippet does show how I'm measuring size - with the content of the <Size> element – tomfumb Dec 15 '14 at 13:28
  • The vector images would need to be rasterized and with more pixels that becomes more work. – bugmenot123 Jan 10 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.