Developer’s Corner: Audit your GeoServer installation with the new monitoring extensions

When running one or more GeoServer in production it is often important to keep tabs on the server and its workload.

The monitoring community module, available among the nightly builds, allows to track requests flowing into the server and expose basic statistics about the traffic in terms of OGC services being used.
Configured in “history” mode it also stores all relevant request details into a database, allowing other tools to perform detailed usage analysis in post processing.

This is great, but has some limitations. In particular, but storing all request details into a single database table the speed at which the new request details are inserted decreases over time in most relational databases, adding overhead to GeoServer as well, especially during peak loads.

We recently developed an alternative storage that uses plain text files instead, with file rolling when the file reaches a configurable record count as well as every time midnight is reached.

All the request details are first collected and fed into a queue that is then read by a separate thread doing the actual logging: this ensures there is no significant overhead and that the logging happens without slowing down the main thread.

Separate applications, running offline periodically, can then grab the files generated and compute whatever statistics are deemed necessary without impacting on GeoSeGeoServerrver’s activity.

The logging by default builds XML files with all the details of a request, including the body of posts requests, as shown in this example file. However the Freemarker templates driving the logging allow the administrator to perform a completely different kind of logging, maybe duplicating the Apache log format or generate JSON documents instead.

See the online documentation for details on how it’s possible to configure the logging module.

Interested in hearing more about GeoServer performance monitoring and auditing? Let us know!

Regards,
the GeoSolutions Team.