0

I have a website and GeoServer running on an Ubuntu LAMP stack. GeoServer is running through Tomcat. Everything is working except WFS requests are taking way too long (~60 seconds). I have a reverse proxy setup.

ProxyVia On

ProxyPass "/geoserver/" "http://localhost:8080/geoserver/" retry=0 timeout=1000 
ProxyPassReverse "/geoserver/" "http://localhost:8080/geoserver/"

Here's a working wms request:

https://digitalcourthouse.com/geoserver/wms/gwc?service=WMS&request=GetMap&layers=DigitalCourthouse:wv2021gis&styles=&format=image/png8&transparent=true&version=1.1.0&visible=true&identify=true&info_format=application/json&tiled=true&type=WMS&copyright=DCH&width=256&height=256&srs=EPSG:3857&bbox=-9012231.382935423,4726254.332929021,-9011619.88670914,4726865.8291553

Here's is an example of an WFS that takes too long:

https://digitalcourthouse.com/geoserver/wfs?service=wfs&version=2.0.0&request=GetFeature&maxfeatures=25&srsName=EPSG:4326&outputFormat=json&CQL_FILTER=gispid = '08-03-0034-0002-0000'&typename=DigitalCourthouse:wv2021gis&contentType=application/json

And here is a WMS request via proxy.cgi that works:

https://digitalcourthouse.com/cgi-bin/proxy.cgi?url=https://digitalcourthouse.com/geoserver/wms/gwc?REQUEST=GetFeatureInfo&SERVICE=WMS&SRS=EPSG%3A4326&SRSNAME=EPSG%3A4326&STYLES=&TRANSPARENT=true&FEATURE_COUNT=1&VERSION=1.1.0&FORMAT=image%2Fpng8&BBOX=-80.97050428390504%2C39.01739984714393%2C-80.9293055534363%2C39.03208603788136&HEIGHT=881&WIDTH=1920&LAYERS=DigitalCourthouse%3Awv2021gis&QUERY_LAYERS=DigitalCourthouse%3Awv2021gis&SEARCHPARAMS=undefined&BUFFER=5&INFO_FORMAT=application%2Fjson&X=327&Y=466

How can I get the WFS request to load quicker, or how can I even diagnose why it's taking so long?

2
  • 1
    The usual culprit here is the database spatial indices. Because you have spatial indices set, right? Feb 9, 2022 at 4:58
  • 1
    The store where data comes seems to be very slow. Even this query without any WFS filters takes ages https://digitalcourthouse.com/geoserver/wfs?service=wfs&version=2.0.0&request=GetFeature&maxfeatures=25&srsName=EPSG:4326&outputFormat=json&typename=DigitalCourthouse:wv2021gis&contentType=application/json&count=1. Check the SQL queries that GeoServer is sending (logging level GEOTOOLS_DEVEL) and make your database to answer fast to them.
    – user30184
    Feb 9, 2022 at 6:25

1 Answer 1

1

IvanSanchez was right. I was missing a spatial index.

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.