Skip to content

Installing and configuring the Control Flow extension

The control-flow module for GeoServer allows the administrator to control the amount of concurrent requests actually executing inside the server, as well as giving an opportunity to slow down users making too many requests.

Installing the Resource Browser

Configuring the Control Flow extension requires adding a configuration file in the Geoserver data directory. To create that file easily, we will use the Resource Browser, which allows browsing the geoserver directory from the Geoserver web interface, and editing and managing resources used by GeoServer.

  • The Resource Browser Tool is included in GeoCat Map

Reference:

Configuring the Control Flow extension

The Control Flow extension is included in GeoCat Map. To configure it, follow these steps:

  1. Open the Resource Browser from the Geoserver web interface. To do so, first click on the Tools link

    and then click on the Resource Browser link.

  2. Click on the root folder in the folder browser panel. That will enable the New Resource button.

  3. Click on the New Resource button.

  4. In the Resource field enter /controlflow.properties

  5. In the Content field enter the following text:

    # if a request waits in queue for more than 60 seconds it's not worth executing,
    # the client will  likely have given up by then
    timeout=60
    # don't allow the execution of more than 100 requests total in parallel
    ows.global=100
    # don't allow more than 10 GetMap in parallel
    ows.wms.getmap=10
    # don't allow more than 4 outputs with Excel output as it's memory bound
    ows.wfs.getfeature.application/msexcel=4
    # don't allow a single user to perform more than 6 requests in parallel
    # (6 being the Firefox default concurrency level at the time of writing)
    user=6
    # don't allow the execution of more than 16 tile requests in parallel
    # (assuming a server with 4 cores, GWC empirical tests show that throughput
    # peaks up at 4 x number of cores. Adjust as appropriate to your system)
    ows.gwc=16
    
  6. Click on the OK button to save your changes.

Checking that the limits are active

The file is read when GeoServer starts, so restart GeoServer after creating or changing it.

When the Control Flow extension has rules loaded, OWS responses carry an X-Control-flow-delay-ms header, with the time the request waited in the queue:

curl -sI "https://<server>/geoserver/ows?service=WMS&request=GetCapabilities" | grep -i x-control-flow

If the header is missing, the extension found no configuration.

Data directories created from earlier GeoCat Map releases

The preconfigured data directories (default, standard, demo and training) used to ship this file as controlFlow.properties, with a capital F. The extension only reads controlflow.properties, so on Linux, including the Docker images, the file was ignored and no limits were applied. On Windows and macOS, whose file systems ignore case, it was read.

If your data directory was created from one of them, rename the file and restart GeoServer:

mv "$GEOSERVER_DATA_DIR/controlFlow.properties" "$GEOSERVER_DATA_DIR/controlflow.properties"

After rename consider that the limits will not have been applied before on your server. Please double check that the limits suit your intended work load after the change: requests over a limit wait in a queue, for up to timeout seconds. Raise ows.wms.getmap and ows.gwc on servers with more than 4 cores.