Atlaslog / Field Notes / Services & tile access
Field note · Services & tile access
GetCapabilities takes a minute and clients time out
Quick answer
GetCapabilities returns in 40 to 60 seconds with an 18 MB document, while a single GetMap takes 200 ms. With 1200 or more layers each publishing a full SRS list, metadata assembly is the bottleneck rather than rendering.
Symptom
- Clients abort at 30 seconds with 504 Gateway Time-out nginx/1.24.0.
- curl reports size_download around 18 MB and time_total around 58 s.
- The layer tree spinner ends in service unavailable while a single GetMap still answers in 200 ms.
Checklist
- Time the request with curl time_total to separate server time from network time.
- Read size_download; anything above 5 MB means the document needs trimming.
- Check the layer count and whether every layer publishes every SRS.
- Check whether capabilities caching is enabled, since otherwise metadata is rebuilt on each request.
- Check JVM heap and GC pauses in the server log.
Fix
Publish only EPSG:4326 and EPSG:3857 per layer, enable capabilities caching, and put Nginx proxy_cache in front with proxy_cache_valid 200 10m and proxy_cache_lock on. Clients should load /geoserver/rest/layers.json for the layer tree instead of the full capabilities document.
Code
504 Gateway Time-out
nginx/1.24.0curl -o /tmp/cap.xml -w "状态 %{http_code} 大小 %{size_download} 耗时 %{time_total}s\n" \
"http://127.0.0.1:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities"
Watch out
- Adding RAM or CPU: the cost is document volume, not compute.
- Raising the client timeout to 120 seconds, which turns a slow layer tree into a two-minute one.
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Atlaslog (2026). GetCapabilities takes a minute and clients time out. https://www.jingweizhi.com/en/cookbook/wms-getcapabilities-timeout.html (accessed 2026-11-03).