GeoServer WMS结合OpenLayers与OSM数据性能缓慢问题求助
地图服务渲染性能优化求助
我是GIS领域新手,基于PostgreSQL/PostGIS、GeoServer、OpenLayers及OSM数据搭建地图服务,当前仅覆盖北美大陆,但在缩放级别2下渲染包含道路、边界和土地利用属性的完整地图耗时约20秒,无法满足使用需求。
数据库配置
| 类型 | 服务商 | 版本 | 内存 | 虚拟CPU | 存储容量 | 存储类型 | 提供的IOPS | 存储吞吐量 |
|---|---|---|---|---|---|---|---|---|
| Postgresql | AWS RDS | 13.7 | 128GB | 16 | 2TB | gp3 SSD | 12,000 | 500 Mibps |
数据库调优参数
| Shared Buffers | Work Mem | Main. Work Mem | AutoVac Work Mem | Checkpt Timeout | Max Wal Size | Checkpt Completion Target | Max Wal Senders | Random Page Cost |
|---|---|---|---|---|---|---|---|---|
| 125 MB | 3 GB | 10 GB | 2GB | 60 Min | 10GB | 0.9 | 5 | 1.0 |
目前仅1位用户使用该服务,数据库CPU利用率从未超过20%,我认为数据库并非问题所在,但仍希望帮忙检查配置。
GeoServer配置
GeoServer运行在ECS集群的Docker容器中,实例为t3.2xlarge,配置32.0 GB内存和8 vCPU。相关配置包含以下截图:
- DataStore配置
- 服务器状态
- 系统状态1
- 系统状态2
GeoServer似乎并未充分利用分配的CPU或内存。
前端OpenLayers代码
let extent: Ext.Extent let locations_layer: VectorLayer<VectorSource<Geometry>> if (location_list.length > 0) { console.log(bbox) extent = createExtentFromBoundingBox(JSON.parse(bbox)) console.log(extent) const location_features = createLocationFeatures(JSON.parse(location_list)); console.log(location_features) const locations_source = new VectorSource({ features: location_features }); locations_layer = new VectorLayer({ source: locations_source }); } else { extent = null } const view = new View({ center: [0, 0], zoom: 2 }); const main_roads = new Tile({ source: new TileWMS({ url: 'http://3.129.23.222/geoserver/wms', params: { LAYERS: 'atlas-workspace:planet_osm_roads', TILED: true }, serverType: 'geoserver', transition: 0 }) }); const polygon = new Tile({ source: new TileWMS({ url: 'http://3.129.23.222/geoserver/wms', params: { LAYERS: 'atlas-workspace:planet_osm_polygon', TILED: true }, serverType: 'geoserver', transition: 0 }) }); const supporting_roads = new Tile({ source: new TileWMS({ url: 'http://3.129.23.222/geoserver/wms', params: { LAYERS: 'atlas-workspace:planet_osm_line', TILED: true }, serverType: 'geoserver', transition: 0 }) }); const points = new Tile({ source: new TileWMS({ url: 'http://3.129.23.222/geoserver/wms', params: { LAYERS: 'atlas-workspace:planet_osm_point', TILED: true }, serverType: 'geoserver', transition: 0 }) }); map = new Map({ target: target, view: view, layers: [polygon, supporting_roads, main_roads, points] }) view.fit(extent); });
服务可访问地址:http://3.19.245.25:8080/
我已查阅大量在线资料但仍未解决问题,恳请提供帮助。
内容的提问来源于stack exchange,提问作者jamesnebeker
相关产品推荐
相关产品推荐

