GWC initialization thrashes CPU and filesystem at startup

Description

During system startup, GeoServer's GWC initialization does parallel loading of tile layer config objects on the ForkJoinPool.commonPool() which by one side thrashes the file system with many (as in as many cores) I/O threads, and by the other side is heavily locked on XStream synchronized blocks, as all threads share a single XStream instance for unmarshalling of GeoServerTileLayerInfo objects.

Once that's done, GWCInitializer loads all GeoServer LayerInfo and LayerGroupInfo objects from the catalog into an in-memory list and traverses it again on the ForkJoinPool.commonPool() to find which tile layers are not to be in-memory cached by GWC's CacheProvider. Although this doesn't incur in any I/O, wastes memory and processing power when there's no need to fetch all catalog's layers and layergroups into an ArrayList.

Environment

None

Status

Assignee

Gabriel Roldan

Reporter

Gabriel Roldan

Triage

None

Fix versions

Affects versions

None

Components

Priority

Medium
Configure