tuning Geoserver on windows for production

I develop my website using a MacBook Pro retina, and deploy on windows. And I noticed that my Macbook Pro is a lot faster than the standard GeoServer install. I use Geoserver only to serve the WMS layers, vector data which is stored in postgis.

So I needed to tune GeoServer on Windows for optimal performance. I googled around, and found I needed to make the following changes:

  • make sure jvm runs in -server mode
  • make sure jvm is allocated enough memory
  • optimise jvm settings
  • install native JAI/ImageIO binaries
  • switch to production logging

I used the standard Geoserver binary install, so to tune the jvm settings, you have to edit c:\program files\Geoserver xxx\wrapper\wrapper.conf and add the following lines:

# Java Additional Parameters
wrapper.java.additional.1=-Djetty.home=.
wrapper.java.additional.2=-DGEOSERVER_DATA_DIR="%GEOSERVER_DATA_DIR%"
wrapper.java.additional.3=-server 
wrapper.java.additional.4=-Xmx2048M -Xms2048m 
wrapper.java.additional.5=-XX:SoftRefLRUPolicyMSPerMB=36000 
wrapper.java.additional.6=-XX:MaxPermSize=128m 
wrapper.java.additional.7=-XX:NewRatio=2 

to be able to run the jvm in server mode, I had to copy $JAVA_HOME\bin\client to $JAVA_HOME\bin\server which feels like an awesome hack.

But Geoserver does seem a lot quicker.

I read the wms shootout benchmarks (2011) and one of the results showed that MapServer was a lot quicker on linux (vs. windows).

So that has got me wondering though, what possible other things I could do to improve performance.

E.g.

  • deploy geoserver on linux vs windows?
  • switch containers: jetty vs tomcat vs jboss, or doesn't that make much of a difference?
  • or how hard would it be to switch to a "quicker" wms, e.g. mapnik/mapserver

So since none of this questions I can find answered somewhere on the web (at least not easily, and i asked), I will probably be doing some benchmarks for myself soon.


Comments
Andrea Aime 2013-12-22 20:44:00 UTC

The first step to optimize GeoServer performance on Windows is... switching to Linux :-p (GeoServer anedoctically gets the same speedup as MapServer with the switch, although we never made specific benchmarks for it, but noticed a 30% speedup in other java workloads). Switching to Tomcat helps too, yes, sometimes, quite a bit, depending on your load. Then install the ImageIO native encoders and the Turbo JPEG one (you'll be stuck to a 32 bit JVM to use the former, not a big deal normally). Have a look at those two for news of incoming features that matter in this regard (benchmarks run on Linux only, also in this case): http://osgeo-org.1560.x6.nabble.com/Faster-PNG-encoder-some-WMS-tests-td5083309.html http://osgeo-org.1560.x6.nabble.com/New-PNG-encoder-OpenJDK-7-Woot-td5084608.html

nathanvda 2013-12-23 01:22:41 UTC

Waaaaaahhhhhh Andrea!! Thank you for your comments. Good to know about the 30% speedup. That is impressive. If I give demos to client I always use my macbook pro instead of our windows server, which does not make sense, but is much quicker :) (and OSX is then not completely optimised, no native ImageIO, but great cpu and ssd and a *nix system). Those two posts seem really interesting: the new PNG encoder, and the comparison Oracle JDK vs Open JDK. Quite a bit surprised that the Open JDK is faster, nice to know. At least you have given me some very useful points to try out and consider. Thank you very much for your time!

Add comment

Recent comments

Tags