Skip to content

Seeding and refreshing

The primary benefit to GeoWebCache is that it allows for the acceleration of normal WMS tile request processing by eliminating the need for the tiles to be regenerated for every request. This page discusses tile generation.

You can configure seeding processes via the Web administration interface. See the Tile Layers page for more information.

Generating tiles

There are two ways for tiles to be generated by GeoWebCache. The first way for tiles to be generated is during normal map viewing. In this case, tiles are cached only when they are requested from a client, either through map browsing (such as in OpenLayers) or through manual WMS tile requests. The first time a map view is requested it will be roughly at the same speed as a standard GeoServer WMS request. The second and subsequent map viewings will be greatly accelerated as those tiles will have already been generated. The main advantage to this method is that it requires no preprocessing, and that only the data that has been requested will be cached, thus potentially saving disk space as well. The disadvantage to this method is that map viewing will be only intermittently accelerated, reducing the quality of user experience.

The other way for tiles to be generated is by seeding. Seeding is the process where map tiles are generated and cached internally from GeoWebCache. When processed in advance, the user experience is greatly enhanced, as the user never has to wait for tiles to be generated. The disadvantage to this process is that seeding can be a very time- and disk-consuming process.

In practice, a combination of both methods are usually used, with certain zoom levels (or certain areas of zoom levels) seeded, and the less-likely-viewed tiles are left uncached.

Seeder thread pool size

The seeder thread pool controls how many seeding threads can run concurrently. By default, the core pool size is 16 and the maximum pool size is 32.

Configuration via gwc-gs.xml

The primary configuration is in the GeoWebCache settings file (gwc-gs.xml in the GeoServer data directory). Add the following elements:

<GeoServerGWCConfig>
  ...
  <seederCorePoolSize>24</seederCorePoolSize>
  <seederMaxPoolSize>64</seederMaxPoolSize>
  ...
</GeoServerGWCConfig>
Property Description Default
seederCorePoolSize The number of threads to keep in the pool, even if they are idle. 16
seederMaxPoolSize The maximum number of threads allowed in the pool. 32

Override via environment variables

The XML configuration can be overridden at runtime using Java system properties or OS environment variables (useful for Docker and cloud deployments):

Override Property Overrides
GWC_SEEDER_CORE_POOL_SIZE seederCorePoolSize
GWC_SEEDER_MAX_POOL_SIZE seederMaxPoolSize

These are resolved from Java system properties first, then from OS environment variables. If the value is not set or is not a valid positive integer, the XML-configured (or default) value is used.

Example using Java system properties:

-DGWC_SEEDER_CORE_POOL_SIZE=24 -DGWC_SEEDER_MAX_POOL_SIZE=64

Example using environment variables:

export GWC_SEEDER_CORE_POOL_SIZE=24
export GWC_SEEDER_MAX_POOL_SIZE=64

If seederCorePoolSize (or its override) is set to a value greater than seederMaxPoolSize, the maximum pool size will be automatically adjusted upward to match the core pool size.

Increasing these values is useful when seeding many layers in parallel, especially in combination with a larger HTTP connection pool to the backend WMS.

Note

These settings control the seeder thread pool only and are separate from the metatiling threads setting in the GeoWebCache defaults page, which applies to user-initiated tile requests rather than seeding tasks.

Warning

Changes to seederCorePoolSize / seederMaxPoolSize in gwc-gs.xml (or via environment variables) require a GeoServer restart to take effect, as the thread pool is created once at startup.