SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
GeoServer on steroids
All you wanted to know
about how to make GeoServer faster
but you never asked
(or you did and no one answered)
Ing. Andrea Aime
Ing. Simone Giannecchini
GeoSolutions
GeoSolutions
 Founded in Italy in late 2006
 Expertise
• Image Processing, GeoSpatial Data Fusion
• Java, Java Enterprise, C++, Python
• JPEG2000, JPIP, Advanced 2D visualization
 Supporting/Developing FOSS4G projects
 GeoServer, MapStore
 GeoNetwork, GeoNode, Ckan
 Clients
 Public Agencies
 Private Companies
 http://www.geo-solutions.it
FOSS4G 2015, Seoul
14th-19th September 2015
Contents
 Preparing raster data
 Preparing vector data
 Optimizing styling
 Output tuning
 Tiling and caching
 Resource control
 Deploy configurations
FOSS4G 2015, Seoul
14th-19th September 2015
Preparing raster inputs
FOSS4G 2015, Seoul
14th-19th September 2015
Raster data checklist
FOSS4G 2015, Seoul
14th-19th September 2015
 Objectives
 Fast extraction of a subset of the data
 Fast extraction of the desired resolution
 Check-list
 Avoid having to open a large number of files per
request
 Avoid parsing of complex structures and slow
compressions
 Get to know your bottlenecks
 CPU vs Disk Access Time vs Memory
 Experiment with
 Format, compression, different color models, tile
size, overviews, GeoServer configuration
Problematic input formats
FOSS4G 2015, Seoul
14th-19th September 2015
 PNG/JPEG direct serving
 Bad formats (especially in Java)
 No tiling (or rarely supported)
 Chew a lot of memory and CPU for
decompression
 Mitigate with external overviews
 Any input ASCII format (GML grid, ASCII grid)
 JPEG2000
 Extensible and rich, not (always) fast, can be
difficult to tune for performance (might require
specific encoding options)
 MrSID (can work, needs tuning)
 ECW (licensing issues)
GeoTIFF for the win
FOSS4G 2015, Seoul
14th-19th September 2015
 To remember: GeoTiff is a swiss knife
 But you don’t want to cut a tree with it!
 Tremendously flexible, good for for most (not all)
use cases
 BigTiff pushes the GeoTiff limits farther
 Use GeoTiff when
 Overviews and Tiling stay within 4GB
 No additional dimensions
 Consider BigTiff for very large file (> 4 GB)
 Support for tiling
 Support for Overviews
 Can be inefficient with very large files + small
tiling
GeoTIFF preparation
FOSS4G 2015, Seoul
14th-19th September 2015
 (Optional) Use gdal_warp to transform the data in
the most used output reference system (mind, any
reprojection ruins the data a bit)
 Use gdal_translate to add inner tiling and fix
eventual issues with coordinate reference system
 Add compression options if you disks are
small/slow/not local (consider JPEG compression with
YCBCR color interpretation for photos, LZW/Deflate
for scientific data)
 Use gdaladdo to add internal overviews (remember
to replicate compression here)
Possible structures
FOSS4G 2015, Seoul
14th-19th September 2015
Single GeoTiff
with internal tiling
and overviews
(GeoTiff < 2GB,
BigTiff < 20-50GB)
Mosaic of GeoTiff, each one
with internal tiling and overviews
(< 500GB, not too many files)
Pyramid
1
2
3
Choosing formats and layouts
FOSS4G 2015, Seoul
14th-19th September 2015
 Use ImageMosaic when:
 A single file gets too big (inefficient seeks, too much
metadata to read, etc..)
 Multiple Dimensions (time, elevation, others..)
 Avoid mosaics made of many very small files
 Single granules can be large
 Use Tiling + Overviews + Compression on granules
 Use ImagePyramid when:
 Tremendously large dataset
 Too many files / too large files
 Need to serve at all scales
 Especially low resolution
 For single granules (< 2Gb) GeoTiff is generally a
good fit
Proper mosaic preparation
FOSS4G 2015, Seoul
14th-19th September 2015
 Optimize files as if you were serving them individually
 Keep a balance between number and dimensions of
granules
 If memory is scarce:
 USE_JAI_IMAGREAD to true
 USE_MULTITHREADING to false*
 Otherwise
 USE_JAI_IMAGREAD to false
 ALLOW_MULTITHREADING
to true (Load data from
different granules in parallel)
Multidimensional mosaics
FOSS4G 2015, Seoul
14th-19th September 2015
 Use Cases:
 MetOc data (support for time, elevation)
 Data with additional indipendent dimensions
 Suggestions
 Use ImageMosaic
 Use a DBMS for indexing granules (not shapefile)
 Add indexes on the dimension columns
 Use File Name based property collectors to turn properties
into DB rows attributes
 Filter by time, elevation and other attributes via OGC and
CQL filters
 Check detailed deck for details!
Multidimensional mosaics
FOSS4G 2015, Seoul
14th-19th September 2015
Proper pyramid preparation
FOSS4G 2015, Seoul
14th-19th September 2015
 If needed, use gdalbuildvrt to create a
virtual single source for gdal_retile
 Use gdal_retile for creating the pyramid
 Prepare the list of tiles to be retiled
 Create the pyramid with GDAL retile (grab a coffee!)
 Chunks should not be too small (here 2048x2048), if you go larger,
use also inner tiling
 If the input dataset is huge use the useDirForEachRow option
 Too many files in a dir is bad practice
 Make sure the number of level is consistent with usage
 Too few  bad performance at high scale
Preparing vector inputs
FOSS4G 2015, Seoul
14th-19th September 2015
Vector data checklist
FOSS4G 2015, Seoul
14th-19th September 2015
 What do we want from vector data:
 Binary data
 No complex parsing of data structures
 Fast extraction of a geographic subset
 Fast filtering on the most commonly used
attributes
Choosing a format
FOSS4G 2015, Seoul
14th-19th September 2015
 Slow formats
 WFS
 GML
 DXF
 Good formats, local and
indexable
 Shapefile
 Directory of
shapefiles
 SDE
 Spatial databases:
PostGIS, Oracle
Spatial, DB2, SQL
server, MySQL*
DBMS checklist
FOSS4G 2015, Seoul
14th-19th September 2015
 Choose PostGIS if you can
 Rich support for complex native filters
 Use connection pooling
 Validate connections (with proper pooling)
 Table Clustering
 Spatial Indexing
 Spatial Indexing
 Spatial Indexing
 Alphanumeric Indexing
 Alphanumeric Indexing
 Alphanumeric Indexing
 Did we mention indexes?
Connection pooling tricks
FOSS4G 2015, Seoul
14th-19th September 2015
 Connection pool size should be proportional to the
number of concurrent requests you want to serve (obvious
no?)
 Activate connection validation
 Mind networking tools that might cut connections sitting
idle (yes, your server is not always busy), they might cut
the connection in “bad” ways (10 minutes timeout before
the pool realizes the TCP connection attempt gives up)
 Read more at http://geoserver.geo-
solutions.it/edu/en/adv_gsconfig/db_pooling.html
Shapefile preparation
FOSS4G 2015, Seoul
14th-19th September 2015
 Remove .qix file if present (GeoServer will recreate it,
sometimes better optimized)
 If there are large DBF attributes that are not in use, get
rid of them using ogr2ogr, e.g.:
ogr2ogr -select FULLNAME,MTFCC arealm.shp
tl_2010_08013_arealm.shp
 If on Linux, enable memory mapping, faster, more
scalable (but will kill Windows):
Shapefile filtering
FOSS4G 2015, Seoul
14th-19th September 2015
 Stuck with shapefiles and have scale dependent
rules like the following?
 Show highways first
 Show all streets when zoomed in
 Use ogr2ogr to build two shapefiles, one with just
the highways, one with everything, and build two
layers, e.g.:
ogr2ogr -sql "SELECT * FROM
tl_2010_08013_roads WHERE MTFCC in
('S1100', 'S1200')" primaryRoads.shp
tl_2010_08013_roads.shp
 Or hire us to develop non-spatial indexing for
shapefile!
Optimize styling
FOSS4G 2015, Seoul
14th-19th September 2015
Use scale dependencies
FOSS4G 2015, Seoul
14th-19th September 2015
 Never show too much data
 the map should be readable, not a graphic blob. Rule of
thumb: 1000 features max in the display, have labels show
up when zoomed in
 Show details as you zoom in
 Eagerly add MinScaleDenominator to your SLD rules
 Add more expensive rendering when there are less
features
 Key to get both a good looking and fast map
Labeling
FOSS4G 2015, Seoul
14th-19th September 2015
 Labeling conflict resolution is expensive, limit to the
most inner zooms
 Halo is important for readability, but adds overhead
 Careful with maxDisplacement, makes for various
label location attempts
FeatureTypeStyle
FOSS4G 2015, Seoul
14th-19th September 2015
 GeoServer uses SLD FeatureTypeStyle objects as Z
layers for painting
 Each one allocates its own rendering surface (which
can use a lot of memory), use as few as possible
z-ordering
FOSS4G 2015, Seoul
14th-19th September 2015
 Use DBMS as the data source
 Add indexes on the fields used for z-ordering
 If at all possible, use cross-feature type and cross-layer
z-ordering on small amounts of data (we need to go
back and forth painting it)
Tiling and caching
FOSS4G 2015, Seoul
14th-19th September 2015
Tile caching with GWC
FOSS4G 2015, Seoul
14th-19th September 2015
 Tile oriented maps, fixed zoom levels and fixed grid
 Useful for stable layers, backgrounds
 Protocols: WMTS, TMS, WMS-C, Google Maps/Earth,
VE
 Speedup compared to dynamic WMS: 10 to 100 times,
assuming tiles are already cached (whole layer pre-
seeded)
 Suitable for:
 Mostly static layer
 No/few dynamic parameters (CQL filters, SLD
params, SQL query params, time/elevation,
format options)
Embedded GWC advantage
FOSS4G 2015, Seoul
14th-19th September 2015
 No double encoding when using meta-tiling, faster
seeding
Space considerations
FOSS4G 2015, Seoul
14th-19th September 2015
 Seeding Colorado, assuming 8 cores, one layer, 0.1 sec
756x756 metatile, 15KB for each tile
 Do yours: http://tinyurl.com/3apkpss
 Not enough disk space? Set a disk quota
Zoom
level
Tile count Size (MB)
Time to seed
(hours)
Time to
seed (days)
13 58,377 1 0 0
14 232,870 4 0 0
15 929,475 14 0 0
16 3,713,893 57 1 0
17 14,855,572 227 6 0
18 59,396,070 906 23 1
19 237,584,280 3,625 92 4
20 950,273,037 14,500 367 15
Client side cache
FOSS4G 2015, Seoul
14th-19th September 2015
 Client-side caching of tiles
 Does not work with browsers in private mode
<expireClientsList>
<expirationRule minZoom="0" expiration="7200" />
<expirationRule minZoom="10" expiration="600" />
</expireClientsList>
Choose the right format
FOSS4G 2015, Seoul
14th-19th September 2015
 Use the right formats
 JPEG for background data (e.g. ortos)
 PNG8 + precomputed palette for
background data (e.g. ortos)
 PNG8 full for overlays with transparency
 The format impacts also the disk space
needed! (as well as the generation time)
 Check this blog post
Keep an eye on vector tiles
FOSS4G 2015, Seoul
14th-19th September 2015
 New community module to support vector tiles
 Still new, but:
 PNG encoding is often 50% of the request
time when there is little data in the tile
 Gone with Vector tiles
 Vector tiles are more compact
Resource control
FOSS4G 2015, Seoul
14th-19th September 2015
Resource limits
FOSS4G 2015, Seoul
14th-19th September 2015
 Limit the amount of resources dedicated to an
individual request
 Improve fairness between requests, by preventing
individual requests from hijacking the server and/or
running for a very long time
 EXTREMELY IMPORTANT in production environment
 WHEN TO TWEAK THEM?
 Frequent OOM Errors despite plenty of RAM
 Requests that keep running for a long time (e.g.
CPU usage peaks even if no requests are being
sent)
 DB Connection being killed by the DBMS while in
usage (ok, you might also need to talk to the DBA..)
Resource limits
FOSS4G 2015, Seoul
14th-19th September 2015
WMS
WFS WCS
Control-flow
FOSS4G 2015, Seoul
14th-19th September 2015
 Control how many requests are executed in parallel,
queue others:
 Increase throughput
 Control memory usage
 Enforce fairness
 More info here
Control-flow
FOSS4G 2015, Seoul
14th-19th September 2015
$GEOSERVER_DATA_DIR/controlflow.properties
# don't allow more than 16 GetMap requests in parallel
ows.wms.getmap=16
JVM and deploy configuration
FOSS4G 2015, Seoul
14th-19th September 2015
Premise
FOSS4G 2015, Seoul
14th-19th September 2015
 There is no “GO FAST!” option in the Java
Virtual Machine
 The options discussed here are not going to
help if you did not prepare the data and the
styles
 They are finishing touches that can get
performance up once the major data
bottlenecks have been dealt with
 Check “Running in production” instructions
here
JVM settings
FOSS4G 2015, Seoul
14th-19th September 2015
 --server: enables the server JIT compiler
 --Xms2048m -Xmx2048m: sets the JVM use
two gigabytes of memory
 --XX:+UseParallelOldGC -
XX:+UserParallelGC: enables multi-threaded
garbage collections, useful if you have more
than two cores
 --XX:NewRatio=2: informs the JVM there will
be a high number of short lived objects
 --XX:+AggressiveOpt: enable experimental
optimizations that will be defaults in future
versions of the JVM
Raster subsystem configuration
FOSS4G 2015, Seoul
14th-19th September 2015
 Install the TurboJPEG extension
 Enable JAI Mosaicking native
acceleration
 Give JAI enough memory
 Don’t raise JAI memory
Threshold too high
 Rule of thumb: use 2 X #Core
Tile Threads (check next slide)
 Play with tile Recycling against
your workflows (might help,
might not)
Marlin renderer
FOSS4G 2015, Seoul
14th-19th September 2015
 The OpenJDK Java2D renderer scales up, but it’s not
super-fast when the load is small (1 request at a time)
 The Oracle JDK Java2D renderer is fast for the single
request, but does not scale up
 Marlin-renderer to the rescue:
https://github.com/bourgesl/marlin-renderer
 Being considered
for merging in
OpenJDK (9 or 10)
Upgrade!
FOSS4G 2015, Seoul
14th-19th September 2015
 Performance tends to go up version by version
 Please do use a recent GeoServer version
 FOSS4G 2010 vector benchmark with different
versions of GeoServer
That’s all folks!
Questions?
info@geo-solutions.it
FOSS4G 2015, Seoul
14th-19th September 2015

Contenu connexe

Tendances

[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
BJ Jang
 
오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS
JungHwan Yun
 
Training Series - Build A Routing Web Application With OpenStreetMap, Neo4j, ...
Training Series - Build A Routing Web Application With OpenStreetMap, Neo4j, ...Training Series - Build A Routing Web Application With OpenStreetMap, Neo4j, ...
Training Series - Build A Routing Web Application With OpenStreetMap, Neo4j, ...
Neo4j
 

Tendances (20)

Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...
 
Geoprocessing with Neo4j-Spatial and OSM
Geoprocessing with Neo4j-Spatial and OSMGeoprocessing with Neo4j-Spatial and OSM
Geoprocessing with Neo4j-Spatial and OSM
 
Technical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPASTechnical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPAS
 
Building a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQLBuilding a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQL
 
Introduction to-arc map
Introduction to-arc mapIntroduction to-arc map
Introduction to-arc map
 
Bases de données Spatiales - POSTGIS
Bases de données Spatiales - POSTGISBases de données Spatiales - POSTGIS
Bases de données Spatiales - POSTGIS
 
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
 
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현
GeoTools와 GeoServer를 이용한 KOPSS Open API의 구현
 
오픈소스GIS 개론 과정 - OpenLayers 기초
오픈소스GIS 개론 과정 - OpenLayers 기초오픈소스GIS 개론 과정 - OpenLayers 기초
오픈소스GIS 개론 과정 - OpenLayers 기초
 
오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS
 
Enterprise class deployment for GeoServer and GeoWebcache Optimizing perform...
Enterprise class deployment  for GeoServer and GeoWebcache Optimizing perform...Enterprise class deployment  for GeoServer and GeoWebcache Optimizing perform...
Enterprise class deployment for GeoServer and GeoWebcache Optimizing perform...
 
QGIS for Park GIS (국립공원관리공단의 QGIS 활용사례)
QGIS for Park GIS (국립공원관리공단의 QGIS 활용사례)QGIS for Park GIS (국립공원관리공단의 QGIS 활용사례)
QGIS for Park GIS (국립공원관리공단의 QGIS 활용사례)
 
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data ScienceScaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
 
Snowflake Architecture
Snowflake ArchitectureSnowflake Architecture
Snowflake Architecture
 
Advanced Security With GeoServer
Advanced Security With GeoServerAdvanced Security With GeoServer
Advanced Security With GeoServer
 
Introduction of Open Source GIS
Introduction of Open Source GISIntroduction of Open Source GIS
Introduction of Open Source GIS
 
공간SQL을 이용한 공간자료분석 기초실습
공간SQL을 이용한 공간자료분석 기초실습공간SQL을 이용한 공간자료분석 기초실습
공간SQL을 이용한 공간자료분석 기초실습
 
Convert BIM/ IFC models into graph database (Neo4j) based on IFCWebServer.org
Convert BIM/ IFC models into graph database (Neo4j) based on IFCWebServer.orgConvert BIM/ IFC models into graph database (Neo4j) based on IFCWebServer.org
Convert BIM/ IFC models into graph database (Neo4j) based on IFCWebServer.org
 
Training Series - Build A Routing Web Application With OpenStreetMap, Neo4j, ...
Training Series - Build A Routing Web Application With OpenStreetMap, Neo4j, ...Training Series - Build A Routing Web Application With OpenStreetMap, Neo4j, ...
Training Series - Build A Routing Web Application With OpenStreetMap, Neo4j, ...
 
One GeoNode, many GeoNodes
One GeoNode, many GeoNodesOne GeoNode, many GeoNodes
One GeoNode, many GeoNodes
 

En vedette

Advanced Cartographic Map Rendering in GeoServer
Advanced Cartographic Map Rendering in GeoServerAdvanced Cartographic Map Rendering in GeoServer
Advanced Cartographic Map Rendering in GeoServer
GeoSolutions
 
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
GeoSolutions
 
Creating Stunning Maps in GeoServer: mastering SLD and CSS styles
Creating Stunning Maps in GeoServer: mastering SLD and CSS stylesCreating Stunning Maps in GeoServer: mastering SLD and CSS styles
Creating Stunning Maps in GeoServer: mastering SLD and CSS styles
GeoSolutions
 
MapStore 2, modern mashups with OL3, Leaflet and React
MapStore 2, modern mashups with OL3, Leaflet and ReactMapStore 2, modern mashups with OL3, Leaflet and React
MapStore 2, modern mashups with OL3, Leaflet and React
GeoSolutions
 

En vedette (20)

GeoServer beginners gwf_2015
GeoServer beginners gwf_2015GeoServer beginners gwf_2015
GeoServer beginners gwf_2015
 
Advanced Cartographic Map Rendering in GeoServer
Advanced Cartographic Map Rendering in GeoServerAdvanced Cartographic Map Rendering in GeoServer
Advanced Cartographic Map Rendering in GeoServer
 
Mapping the world beyond web mercator - FOSS4G 2015
Mapping the world beyond web mercator - FOSS4G 2015Mapping the world beyond web mercator - FOSS4G 2015
Mapping the world beyond web mercator - FOSS4G 2015
 
GeoServer an introduction for beginners
GeoServer an introduction for beginnersGeoServer an introduction for beginners
GeoServer an introduction for beginners
 
Tile Caching Options
Tile Caching OptionsTile Caching Options
Tile Caching Options
 
GeoServer, The Open Source Solution for the interoperable management of geo...
GeoServer, The Open Source Solution  for the interoperable management  of geo...GeoServer, The Open Source Solution  for the interoperable management  of geo...
GeoServer, The Open Source Solution for the interoperable management of geo...
 
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
 
GeoServer Feature Frenzy
GeoServer Feature FrenzyGeoServer Feature Frenzy
GeoServer Feature Frenzy
 
SIG Libre 2013 Girona. Cuso Online de SIG y Cooperación
SIG Libre 2013 Girona. Cuso Online de SIG y CooperaciónSIG Libre 2013 Girona. Cuso Online de SIG y Cooperación
SIG Libre 2013 Girona. Cuso Online de SIG y Cooperación
 
GeoServer presentation @ Italian GFOSS day 2008
GeoServer presentation @ Italian GFOSS day 2008GeoServer presentation @ Italian GFOSS day 2008
GeoServer presentation @ Italian GFOSS day 2008
 
Using GeoServer for spatio-temporal data management with examples for MetOc a...
Using GeoServer for spatio-temporal data management with examples for MetOc a...Using GeoServer for spatio-temporal data management with examples for MetOc a...
Using GeoServer for spatio-temporal data management with examples for MetOc a...
 
State of GeoServer - FOSS4G 2016
State of GeoServer - FOSS4G 2016State of GeoServer - FOSS4G 2016
State of GeoServer - FOSS4G 2016
 
pgDay Campinas – 2015
pgDay Campinas – 2015pgDay Campinas – 2015
pgDay Campinas – 2015
 
PGDAY - Palestra PostGIS + PgRouting
PGDAY - Palestra PostGIS + PgRoutingPGDAY - Palestra PostGIS + PgRouting
PGDAY - Palestra PostGIS + PgRouting
 
Geographic Phenomena and their Representations
Geographic Phenomena and their RepresentationsGeographic Phenomena and their Representations
Geographic Phenomena and their Representations
 
Creating Stunning Maps in GeoServer: mastering SLD and CSS styles
Creating Stunning Maps in GeoServer: mastering SLD and CSS stylesCreating Stunning Maps in GeoServer: mastering SLD and CSS styles
Creating Stunning Maps in GeoServer: mastering SLD and CSS styles
 
Spatio-temporal Data Handling With GeoServer for MetOc And Remote Sensing
Spatio-temporal Data Handling With GeoServer for MetOc And Remote SensingSpatio-temporal Data Handling With GeoServer for MetOc And Remote Sensing
Spatio-temporal Data Handling With GeoServer for MetOc And Remote Sensing
 
MapStore 2, modern mashups with OL3, Leaflet and React
MapStore 2, modern mashups with OL3, Leaflet and ReactMapStore 2, modern mashups with OL3, Leaflet and React
MapStore 2, modern mashups with OL3, Leaflet and React
 
WMS Performance Shootout 2010
WMS Performance Shootout 2010WMS Performance Shootout 2010
WMS Performance Shootout 2010
 
How to perform trouble shooting based on counters
How to perform trouble shooting based on countersHow to perform trouble shooting based on counters
How to perform trouble shooting based on counters
 

Similaire à GeoServer on Steroids

Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Safe Software
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
Ari Jolma
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Safe Software
 
Foss4 g 2017-kansai-ryoo-kim
Foss4 g 2017-kansai-ryoo-kimFoss4 g 2017-kansai-ryoo-kim
Foss4 g 2017-kansai-ryoo-kim
OSgeo Japan
 

Similaire à GeoServer on Steroids (20)

GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...
GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...
GeoServer for Spatio-temporal Data Handling With Examples For MetOc And Remot...
 
Cloud Optimized GeotTIFFs: enabling efficient cloud workflows
Cloud Optimized GeotTIFFs: enabling efficient cloud workflows Cloud Optimized GeotTIFFs: enabling efficient cloud workflows
Cloud Optimized GeotTIFFs: enabling efficient cloud workflows
 
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
 
Fossgis 2013 GeoServer Presentation
Fossgis 2013 GeoServer PresentationFossgis 2013 GeoServer Presentation
Fossgis 2013 GeoServer Presentation
 
Powerful geographic web framework GeoDjango
Powerful geographic web framework GeoDjangoPowerful geographic web framework GeoDjango
Powerful geographic web framework GeoDjango
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 
Raster data in GeoServer and GeoTools: Achievements, issues and future develo...
Raster data in GeoServer and GeoTools: Achievements, issues and future develo...Raster data in GeoServer and GeoTools: Achievements, issues and future develo...
Raster data in GeoServer and GeoTools: Achievements, issues and future develo...
 
Neo4j Spatial - Backing a GIS with a true graph database
Neo4j Spatial - Backing a GIS with a true graph databaseNeo4j Spatial - Backing a GIS with a true graph database
Neo4j Spatial - Backing a GIS with a true graph database
 
GPU/SSD Accelerates PostgreSQL - challenge towards query processing throughpu...
GPU/SSD Accelerates PostgreSQL - challenge towards query processing throughpu...GPU/SSD Accelerates PostgreSQL - challenge towards query processing throughpu...
GPU/SSD Accelerates PostgreSQL - challenge towards query processing throughpu...
 
[db tech showcase Tokyo 2018] #dbts2018 #C25 『マルチモデル・データベースへの道: PostgreSQLを最も...
[db tech showcase Tokyo 2018] #dbts2018 #C25 『マルチモデル・データベースへの道: PostgreSQLを最も...[db tech showcase Tokyo 2018] #dbts2018 #C25 『マルチモデル・データベースへの道: PostgreSQLを最も...
[db tech showcase Tokyo 2018] #dbts2018 #C25 『マルチモデル・データベースへの道: PostgreSQLを最も...
 
Using Big Data techniques to query and store OpenStreetMap data. Stephen Knox...
Using Big Data techniques to query and store OpenStreetMap data. Stephen Knox...Using Big Data techniques to query and store OpenStreetMap data. Stephen Knox...
Using Big Data techniques to query and store OpenStreetMap data. Stephen Knox...
 
State of GeoServer
State of GeoServerState of GeoServer
State of GeoServer
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 
GeoKettle: A powerful open source spatial ETL tool
GeoKettle: A powerful open source spatial ETL toolGeoKettle: A powerful open source spatial ETL tool
GeoKettle: A powerful open source spatial ETL tool
 
Introduction to Open Source GIS
Introduction to Open Source GISIntroduction to Open Source GIS
Introduction to Open Source GIS
 
HDF-EOS Data Product Developer's Guide
HDF-EOS Data Product Developer's GuideHDF-EOS Data Product Developer's Guide
HDF-EOS Data Product Developer's Guide
 
Foss4 g 2017-kansai-ryoo-kim
Foss4 g 2017-kansai-ryoo-kimFoss4 g 2017-kansai-ryoo-kim
Foss4 g 2017-kansai-ryoo-kim
 
13 - Panorama Necto 14 building models - visualization & data discovery solu...
13  - Panorama Necto 14 building models - visualization & data discovery solu...13  - Panorama Necto 14 building models - visualization & data discovery solu...
13 - Panorama Necto 14 building models - visualization & data discovery solu...
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
 

Plus de GeoSolutions

GeoSolutions Keynote at WebMGS 2015
GeoSolutions Keynote at WebMGS 2015GeoSolutions Keynote at WebMGS 2015
GeoSolutions Keynote at WebMGS 2015
GeoSolutions
 
GeoNetwork, The Open Source Solution for the interoperable management of ge...
GeoNetwork, The Open Source Solution  for the interoperable management  of ge...GeoNetwork, The Open Source Solution  for the interoperable management  of ge...
GeoNetwork, The Open Source Solution for the interoperable management of ge...
GeoSolutions
 

Plus de GeoSolutions (11)

MapStore 2 - The Story
MapStore 2 - The StoryMapStore 2 - The Story
MapStore 2 - The Story
 
Introduction to GeoNode
Introduction to GeoNodeIntroduction to GeoNode
Introduction to GeoNode
 
Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...
 
GeoServer Feature FRENZY
GeoServer Feature FRENZYGeoServer Feature FRENZY
GeoServer Feature FRENZY
 
State of GeoServer 2.12
State of GeoServer 2.12State of GeoServer 2.12
State of GeoServer 2.12
 
Mastering Security with GeoServer and GeoFence - FOSS4G EU 2017
Mastering Security with GeoServer and GeoFence - FOSS4G EU 2017Mastering Security with GeoServer and GeoFence - FOSS4G EU 2017
Mastering Security with GeoServer and GeoFence - FOSS4G EU 2017
 
GeoSolutions Keynote at WebMGS 2015
GeoSolutions Keynote at WebMGS 2015GeoSolutions Keynote at WebMGS 2015
GeoSolutions Keynote at WebMGS 2015
 
Geosolutions gwf-2015-v01.04
Geosolutions gwf-2015-v01.04Geosolutions gwf-2015-v01.04
Geosolutions gwf-2015-v01.04
 
Geoserver introduction, GeoBusiness 2015
Geoserver introduction, GeoBusiness 2015Geoserver introduction, GeoBusiness 2015
Geoserver introduction, GeoBusiness 2015
 
Introduzione a GeoServer ed ai servizi OGC
Introduzione a GeoServer ed ai servizi OGCIntroduzione a GeoServer ed ai servizi OGC
Introduzione a GeoServer ed ai servizi OGC
 
GeoNetwork, The Open Source Solution for the interoperable management of ge...
GeoNetwork, The Open Source Solution  for the interoperable management  of ge...GeoNetwork, The Open Source Solution  for the interoperable management  of ge...
GeoNetwork, The Open Source Solution for the interoperable management of ge...
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

GeoServer on Steroids

  • 1. GeoServer on steroids All you wanted to know about how to make GeoServer faster but you never asked (or you did and no one answered) Ing. Andrea Aime Ing. Simone Giannecchini GeoSolutions
  • 2. GeoSolutions  Founded in Italy in late 2006  Expertise • Image Processing, GeoSpatial Data Fusion • Java, Java Enterprise, C++, Python • JPEG2000, JPIP, Advanced 2D visualization  Supporting/Developing FOSS4G projects  GeoServer, MapStore  GeoNetwork, GeoNode, Ckan  Clients  Public Agencies  Private Companies  http://www.geo-solutions.it FOSS4G 2015, Seoul 14th-19th September 2015
  • 3. Contents  Preparing raster data  Preparing vector data  Optimizing styling  Output tuning  Tiling and caching  Resource control  Deploy configurations FOSS4G 2015, Seoul 14th-19th September 2015
  • 4. Preparing raster inputs FOSS4G 2015, Seoul 14th-19th September 2015
  • 5. Raster data checklist FOSS4G 2015, Seoul 14th-19th September 2015  Objectives  Fast extraction of a subset of the data  Fast extraction of the desired resolution  Check-list  Avoid having to open a large number of files per request  Avoid parsing of complex structures and slow compressions  Get to know your bottlenecks  CPU vs Disk Access Time vs Memory  Experiment with  Format, compression, different color models, tile size, overviews, GeoServer configuration
  • 6. Problematic input formats FOSS4G 2015, Seoul 14th-19th September 2015  PNG/JPEG direct serving  Bad formats (especially in Java)  No tiling (or rarely supported)  Chew a lot of memory and CPU for decompression  Mitigate with external overviews  Any input ASCII format (GML grid, ASCII grid)  JPEG2000  Extensible and rich, not (always) fast, can be difficult to tune for performance (might require specific encoding options)  MrSID (can work, needs tuning)  ECW (licensing issues)
  • 7. GeoTIFF for the win FOSS4G 2015, Seoul 14th-19th September 2015  To remember: GeoTiff is a swiss knife  But you don’t want to cut a tree with it!  Tremendously flexible, good for for most (not all) use cases  BigTiff pushes the GeoTiff limits farther  Use GeoTiff when  Overviews and Tiling stay within 4GB  No additional dimensions  Consider BigTiff for very large file (> 4 GB)  Support for tiling  Support for Overviews  Can be inefficient with very large files + small tiling
  • 8. GeoTIFF preparation FOSS4G 2015, Seoul 14th-19th September 2015  (Optional) Use gdal_warp to transform the data in the most used output reference system (mind, any reprojection ruins the data a bit)  Use gdal_translate to add inner tiling and fix eventual issues with coordinate reference system  Add compression options if you disks are small/slow/not local (consider JPEG compression with YCBCR color interpretation for photos, LZW/Deflate for scientific data)  Use gdaladdo to add internal overviews (remember to replicate compression here)
  • 9. Possible structures FOSS4G 2015, Seoul 14th-19th September 2015 Single GeoTiff with internal tiling and overviews (GeoTiff < 2GB, BigTiff < 20-50GB) Mosaic of GeoTiff, each one with internal tiling and overviews (< 500GB, not too many files) Pyramid 1 2 3
  • 10. Choosing formats and layouts FOSS4G 2015, Seoul 14th-19th September 2015  Use ImageMosaic when:  A single file gets too big (inefficient seeks, too much metadata to read, etc..)  Multiple Dimensions (time, elevation, others..)  Avoid mosaics made of many very small files  Single granules can be large  Use Tiling + Overviews + Compression on granules  Use ImagePyramid when:  Tremendously large dataset  Too many files / too large files  Need to serve at all scales  Especially low resolution  For single granules (< 2Gb) GeoTiff is generally a good fit
  • 11. Proper mosaic preparation FOSS4G 2015, Seoul 14th-19th September 2015  Optimize files as if you were serving them individually  Keep a balance between number and dimensions of granules  If memory is scarce:  USE_JAI_IMAGREAD to true  USE_MULTITHREADING to false*  Otherwise  USE_JAI_IMAGREAD to false  ALLOW_MULTITHREADING to true (Load data from different granules in parallel)
  • 12. Multidimensional mosaics FOSS4G 2015, Seoul 14th-19th September 2015  Use Cases:  MetOc data (support for time, elevation)  Data with additional indipendent dimensions  Suggestions  Use ImageMosaic  Use a DBMS for indexing granules (not shapefile)  Add indexes on the dimension columns  Use File Name based property collectors to turn properties into DB rows attributes  Filter by time, elevation and other attributes via OGC and CQL filters  Check detailed deck for details!
  • 13. Multidimensional mosaics FOSS4G 2015, Seoul 14th-19th September 2015
  • 14. Proper pyramid preparation FOSS4G 2015, Seoul 14th-19th September 2015  If needed, use gdalbuildvrt to create a virtual single source for gdal_retile  Use gdal_retile for creating the pyramid  Prepare the list of tiles to be retiled  Create the pyramid with GDAL retile (grab a coffee!)  Chunks should not be too small (here 2048x2048), if you go larger, use also inner tiling  If the input dataset is huge use the useDirForEachRow option  Too many files in a dir is bad practice  Make sure the number of level is consistent with usage  Too few  bad performance at high scale
  • 15. Preparing vector inputs FOSS4G 2015, Seoul 14th-19th September 2015
  • 16. Vector data checklist FOSS4G 2015, Seoul 14th-19th September 2015  What do we want from vector data:  Binary data  No complex parsing of data structures  Fast extraction of a geographic subset  Fast filtering on the most commonly used attributes
  • 17. Choosing a format FOSS4G 2015, Seoul 14th-19th September 2015  Slow formats  WFS  GML  DXF  Good formats, local and indexable  Shapefile  Directory of shapefiles  SDE  Spatial databases: PostGIS, Oracle Spatial, DB2, SQL server, MySQL*
  • 18. DBMS checklist FOSS4G 2015, Seoul 14th-19th September 2015  Choose PostGIS if you can  Rich support for complex native filters  Use connection pooling  Validate connections (with proper pooling)  Table Clustering  Spatial Indexing  Spatial Indexing  Spatial Indexing  Alphanumeric Indexing  Alphanumeric Indexing  Alphanumeric Indexing  Did we mention indexes?
  • 19. Connection pooling tricks FOSS4G 2015, Seoul 14th-19th September 2015  Connection pool size should be proportional to the number of concurrent requests you want to serve (obvious no?)  Activate connection validation  Mind networking tools that might cut connections sitting idle (yes, your server is not always busy), they might cut the connection in “bad” ways (10 minutes timeout before the pool realizes the TCP connection attempt gives up)  Read more at http://geoserver.geo- solutions.it/edu/en/adv_gsconfig/db_pooling.html
  • 20. Shapefile preparation FOSS4G 2015, Seoul 14th-19th September 2015  Remove .qix file if present (GeoServer will recreate it, sometimes better optimized)  If there are large DBF attributes that are not in use, get rid of them using ogr2ogr, e.g.: ogr2ogr -select FULLNAME,MTFCC arealm.shp tl_2010_08013_arealm.shp  If on Linux, enable memory mapping, faster, more scalable (but will kill Windows):
  • 21. Shapefile filtering FOSS4G 2015, Seoul 14th-19th September 2015  Stuck with shapefiles and have scale dependent rules like the following?  Show highways first  Show all streets when zoomed in  Use ogr2ogr to build two shapefiles, one with just the highways, one with everything, and build two layers, e.g.: ogr2ogr -sql "SELECT * FROM tl_2010_08013_roads WHERE MTFCC in ('S1100', 'S1200')" primaryRoads.shp tl_2010_08013_roads.shp  Or hire us to develop non-spatial indexing for shapefile!
  • 22. Optimize styling FOSS4G 2015, Seoul 14th-19th September 2015
  • 23. Use scale dependencies FOSS4G 2015, Seoul 14th-19th September 2015  Never show too much data  the map should be readable, not a graphic blob. Rule of thumb: 1000 features max in the display, have labels show up when zoomed in  Show details as you zoom in  Eagerly add MinScaleDenominator to your SLD rules  Add more expensive rendering when there are less features  Key to get both a good looking and fast map
  • 24. Labeling FOSS4G 2015, Seoul 14th-19th September 2015  Labeling conflict resolution is expensive, limit to the most inner zooms  Halo is important for readability, but adds overhead  Careful with maxDisplacement, makes for various label location attempts
  • 25. FeatureTypeStyle FOSS4G 2015, Seoul 14th-19th September 2015  GeoServer uses SLD FeatureTypeStyle objects as Z layers for painting  Each one allocates its own rendering surface (which can use a lot of memory), use as few as possible
  • 26. z-ordering FOSS4G 2015, Seoul 14th-19th September 2015  Use DBMS as the data source  Add indexes on the fields used for z-ordering  If at all possible, use cross-feature type and cross-layer z-ordering on small amounts of data (we need to go back and forth painting it)
  • 27. Tiling and caching FOSS4G 2015, Seoul 14th-19th September 2015
  • 28. Tile caching with GWC FOSS4G 2015, Seoul 14th-19th September 2015  Tile oriented maps, fixed zoom levels and fixed grid  Useful for stable layers, backgrounds  Protocols: WMTS, TMS, WMS-C, Google Maps/Earth, VE  Speedup compared to dynamic WMS: 10 to 100 times, assuming tiles are already cached (whole layer pre- seeded)  Suitable for:  Mostly static layer  No/few dynamic parameters (CQL filters, SLD params, SQL query params, time/elevation, format options)
  • 29. Embedded GWC advantage FOSS4G 2015, Seoul 14th-19th September 2015  No double encoding when using meta-tiling, faster seeding
  • 30. Space considerations FOSS4G 2015, Seoul 14th-19th September 2015  Seeding Colorado, assuming 8 cores, one layer, 0.1 sec 756x756 metatile, 15KB for each tile  Do yours: http://tinyurl.com/3apkpss  Not enough disk space? Set a disk quota Zoom level Tile count Size (MB) Time to seed (hours) Time to seed (days) 13 58,377 1 0 0 14 232,870 4 0 0 15 929,475 14 0 0 16 3,713,893 57 1 0 17 14,855,572 227 6 0 18 59,396,070 906 23 1 19 237,584,280 3,625 92 4 20 950,273,037 14,500 367 15
  • 31. Client side cache FOSS4G 2015, Seoul 14th-19th September 2015  Client-side caching of tiles  Does not work with browsers in private mode <expireClientsList> <expirationRule minZoom="0" expiration="7200" /> <expirationRule minZoom="10" expiration="600" /> </expireClientsList>
  • 32. Choose the right format FOSS4G 2015, Seoul 14th-19th September 2015  Use the right formats  JPEG for background data (e.g. ortos)  PNG8 + precomputed palette for background data (e.g. ortos)  PNG8 full for overlays with transparency  The format impacts also the disk space needed! (as well as the generation time)  Check this blog post
  • 33. Keep an eye on vector tiles FOSS4G 2015, Seoul 14th-19th September 2015  New community module to support vector tiles  Still new, but:  PNG encoding is often 50% of the request time when there is little data in the tile  Gone with Vector tiles  Vector tiles are more compact
  • 34. Resource control FOSS4G 2015, Seoul 14th-19th September 2015
  • 35. Resource limits FOSS4G 2015, Seoul 14th-19th September 2015  Limit the amount of resources dedicated to an individual request  Improve fairness between requests, by preventing individual requests from hijacking the server and/or running for a very long time  EXTREMELY IMPORTANT in production environment  WHEN TO TWEAK THEM?  Frequent OOM Errors despite plenty of RAM  Requests that keep running for a long time (e.g. CPU usage peaks even if no requests are being sent)  DB Connection being killed by the DBMS while in usage (ok, you might also need to talk to the DBA..)
  • 36. Resource limits FOSS4G 2015, Seoul 14th-19th September 2015 WMS WFS WCS
  • 37. Control-flow FOSS4G 2015, Seoul 14th-19th September 2015  Control how many requests are executed in parallel, queue others:  Increase throughput  Control memory usage  Enforce fairness  More info here
  • 38. Control-flow FOSS4G 2015, Seoul 14th-19th September 2015 $GEOSERVER_DATA_DIR/controlflow.properties # don't allow more than 16 GetMap requests in parallel ows.wms.getmap=16
  • 39. JVM and deploy configuration FOSS4G 2015, Seoul 14th-19th September 2015
  • 40. Premise FOSS4G 2015, Seoul 14th-19th September 2015  There is no “GO FAST!” option in the Java Virtual Machine  The options discussed here are not going to help if you did not prepare the data and the styles  They are finishing touches that can get performance up once the major data bottlenecks have been dealt with  Check “Running in production” instructions here
  • 41. JVM settings FOSS4G 2015, Seoul 14th-19th September 2015  --server: enables the server JIT compiler  --Xms2048m -Xmx2048m: sets the JVM use two gigabytes of memory  --XX:+UseParallelOldGC - XX:+UserParallelGC: enables multi-threaded garbage collections, useful if you have more than two cores  --XX:NewRatio=2: informs the JVM there will be a high number of short lived objects  --XX:+AggressiveOpt: enable experimental optimizations that will be defaults in future versions of the JVM
  • 42. Raster subsystem configuration FOSS4G 2015, Seoul 14th-19th September 2015  Install the TurboJPEG extension  Enable JAI Mosaicking native acceleration  Give JAI enough memory  Don’t raise JAI memory Threshold too high  Rule of thumb: use 2 X #Core Tile Threads (check next slide)  Play with tile Recycling against your workflows (might help, might not)
  • 43. Marlin renderer FOSS4G 2015, Seoul 14th-19th September 2015  The OpenJDK Java2D renderer scales up, but it’s not super-fast when the load is small (1 request at a time)  The Oracle JDK Java2D renderer is fast for the single request, but does not scale up  Marlin-renderer to the rescue: https://github.com/bourgesl/marlin-renderer  Being considered for merging in OpenJDK (9 or 10)
  • 44. Upgrade! FOSS4G 2015, Seoul 14th-19th September 2015  Performance tends to go up version by version  Please do use a recent GeoServer version  FOSS4G 2010 vector benchmark with different versions of GeoServer
  • 45. That’s all folks! Questions? info@geo-solutions.it FOSS4G 2015, Seoul 14th-19th September 2015