We have a setup that contains 4 geoserver instances being hosted in JBoss across 2 machines. We also have a load balancer machine which contains an Apache Server and a Tomcat Server. Our environment contains a GeoWebCache instance that has all of the requested layers configured. Each layer has 4 WMS URL’s specified (1 for each geoserver instance serving the tile).

It has never been a problem in the past but over the last month our load has greatly increased. In doing some load testing we determined that the vast majority of the incoming requests to the GeoWebCache are going to the first configured WMS URL in the geowebcache.xml for each layer. Is there any way to configure GeoWebCache through the geowebcache.xml to balance the requests across all 4 of the WMS URL’s that we have configured? Also, please note that there is 1 layer that gets more traffic than all of the rest.

  • I wish I had a better understanding of load-balanced setups, but my gut instinct is that all the machines should be capable of standing alone and serving identical data endpoints for all four layers—rather than one layer/endpoint per machine—and that you might achieve higher availability if each machine represented a subdomain, for example, a.domain.com, b.domain.com, c.domain.com, and d.domain.com. I'm just brainstorming here, though.
    – elrobis
    Feb 23, 2016 at 16:01
  • Each geoserver instance is identical. I just meant that the 1 layer gets more attention than the others from my consumers. That layer has 4 <wmsUrl> configured. One for each geoserver instance. The issue is that it seems that GWC always tries the first configured <wmsUrl> which basically floods that instance instead of spreading the load.
    – Jason King
    Feb 23, 2016 at 16:43
  • GWC should point to the load balancer that passes requests to the GeoServers. Thus the load is balanced.
    – Ian Turton
    Feb 23, 2016 at 17:09
  • I understand that what you're describing is one way to do it but the schema definition indicates that I shouldn't need to do that. geowebcache.org/schema/1.3.0/geowebcache.xsd "A list of URLs to backend servers than can render tiles for this layer. They are used in a round robin fashion for load balancing and automatic failover. The only time you can ommit this element is if you expect the layer to be merged with that from another source."
    – Jason King
    Feb 23, 2016 at 17:32
  • Just because you can describe it doesn't mean that it is implemented that way. You can inspect the code to check how it's done or go with a load balancer that you control.
    – Ian Turton
    Feb 23, 2016 at 19:05

1 Answer 1


The geowebcache website provides a good guide on resource allocation and modifying the geowebcache.xml file.

Each GWC internally synchs to avoid two requests end up working on the same meta tile, but by default separate GWC instances do not and will end up wasting time. In case you want to make sure two separate instances do not end up working on the same metatile you have two options:

    make it unlikely for two instances to work on the same metatile by using sticky sessions in the load balancer (very often requests for the tiles making up a metatile originate from the same client)  
    switch to file based locking so that the GWC instances properly synch up activity
  • I only have 1 instance of GWC running on the Tomcat Server. It's a standalone GWC instance vs. the internal instances for each Geoserver. I need to be able to have GWC at least take turns sending the requests for layers to the specified WMS URLs instead of flooding the first configured one.
    – Jason King
    Feb 23, 2016 at 16:42
  • I've found additional resources from geowebcache website here and from Boundless Geo here as well as another post that mimics your request here
    – whyzar
    Feb 23, 2016 at 16:49
  • I too came across those resources. For example: Not many people know that GWC can proxy requests for a layer to multiple WMS servers directly, by simply round robin individual requests to them. This can be achieved by the <wmsUrl> element of the <wmsLayer> element, by appending a list of valid WMS URL as follows: <wmsUrl> <string>serv:8082/geoserver/wms</string> <string>serv:8083/geoserver/wms</string> <string>serv:8084/geoserver/wms</string> <string>serv:8085/geoserver/wms</string> </wmsUrl> The issue is that in GWC 1.3.0 I've verified that this isn't happening.
    – Jason King
    Feb 23, 2016 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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