TransWikia.com

Slow rendering with layers when making WMS call on GeoServer

Geographic Information Systems Asked on July 16, 2021

I am making WMS calls (L.tileLayer.wms) to GeoServer and rendering the layers on a Leaflet map for a production environment, so I have maybe about 100+ concurrent users that might be constantly rendering layers

The issue that I am running into is that the WMS call to GeoServer can be super slow that the layers do not render at all. I can see in the Network calls that the WMS call is still pending. I was wondering how I can optimize GeoServer (or Tomcat) to speed up the layer rendering?

For background, I am using GeoServer version 2.17.2, hosting it on a AWS EC2 instance, and using Tomcat to run GeoServer. As for the CPU and Memory for the EC2 instance, the CPU is at 8 and 16GB for memory. For the store, I am using a PostGIS Database that is AWS RDS and all of my data is spatially indexed. Here is some info about the connection parameters:

Max Connection: 150
Min Connection: 1
Fetch size: 1000
Batch insert size: 100
Connection timeout: 20
Max Connection: 150
Max Connection: 150

I have already done GeoWebCaching for all of my layers on GeoServer already and all of my layers are vector data. I am not using raster data at all for this.

I am not sure what else I can do to optimize GeoServer to render my layers faster.. Should I upgrade the EC2 instance to have a higher CPU and memory to ensure faster speed? Or maybe do improvements on Tomcat? Some of my layers consist of 10,000+ rows so they can be fairly large datasets.

Another thing I would like to add is that I cannot access the Geoserver UI at all when the rendering of the layers are super slow. It takes forever for it to load the Geoserver webpage / it doesn’t load whatsoever unless I restart the tomcat

2 Answers

I have had this problem before, ill see if i can explain what I remember. The problem existed with Apache. We had load balancing implemented which enabeld concurrent apache tomcat sessions. This improved performance. Sometimes we would notice that one of the ports would just stop responding or returning a result.

There was a cache associated with each apache session. We needed to clear each day.

So - load balanced or not, check out your cache settings on apache. https://tomcat.apache.org/tomcat-9.0-doc/config/resources.html

Another way you can eliminate what is the problem in the stack, is when users are having the issue, logon to the Geoserver server itself, and try previewing layers. If the layers are responding in the layer preview in a suitable manner, then you can eliminate that part of the stack as being the problem and look 'upwards'. If they are still slow, then you can eliminate the 'upward' part, and look down (geoserver or database).

Answered by nr_aus on July 16, 2021

Geoserver supports horizontally and vertically scalled architectures, This is achieved by applying cluster extension on geoserver.

A vertical architecture provides you with some nodes that work alongside a master node and helps you to respond too many requests simultaneously.

You need also a load balancer to manage received requests. I used it for my application and I could see a big change so that the performance was improved and the response time decreased significantly.

Remember JAVA_OPTION in order to increase java heap size should be considered.

Here you can find detailed information about both architectures and you can compare them.

Answered by ArashMad on July 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP