SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS
JungHwan Yun
 
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
BJ Jang
 

La actualidad más candente (20)

오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS오픈소스 GIS 교육 - PostGIS
오픈소스 GIS 교육 - PostGIS
 
GeoServer, an introduction for beginners
GeoServer, an introduction for beginnersGeoServer, an introduction for beginners
GeoServer, an introduction for beginners
 
오픈소스GIS를 활용한 서버기반 공간분석과 시각화
오픈소스GIS를 활용한 서버기반 공간분석과 시각화오픈소스GIS를 활용한 서버기반 공간분석과 시각화
오픈소스GIS를 활용한 서버기반 공간분석과 시각화
 
공간정보거점대학 1.geo server_고급과정
공간정보거점대학 1.geo server_고급과정공간정보거점대학 1.geo server_고급과정
공간정보거점대학 1.geo server_고급과정
 
PostGIS and Spatial SQL
PostGIS and Spatial SQLPostGIS and Spatial SQL
PostGIS and Spatial SQL
 
공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습
 공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습 공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습
공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습
 
mago3D 한국어 소개 자료
mago3D 한국어 소개 자료 mago3D 한국어 소개 자료
mago3D 한국어 소개 자료
 
GeoServer 기초
GeoServer 기초GeoServer 기초
GeoServer 기초
 
오픈소스GIS 개론 과정 - OpenLayers 기초
오픈소스GIS 개론 과정 - OpenLayers 기초오픈소스GIS 개론 과정 - OpenLayers 기초
오픈소스GIS 개론 과정 - OpenLayers 기초
 
공간정보연구원 PostGIS 강의교재
공간정보연구원 PostGIS 강의교재공간정보연구원 PostGIS 강의교재
공간정보연구원 PostGIS 강의교재
 
공간SQL을 이용한 공간자료분석 기초실습
공간SQL을 이용한 공간자료분석 기초실습공간SQL을 이용한 공간자료분석 기초실습
공간SQL을 이용한 공간자료분석 기초실습
 
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
[Foss4 g2013 korea]postgis와 geoserver를 이용한 대용량 공간데이터 기반 일기도 서비스 구축 사례
 
Introduction to Neo4j
Introduction to Neo4jIntroduction to Neo4j
Introduction to Neo4j
 
Vector Tiles with GeoServer and OpenLayers
Vector Tiles with GeoServer and OpenLayersVector Tiles with GeoServer and OpenLayers
Vector Tiles with GeoServer and OpenLayers
 
Dagster @ R&S MNT
Dagster @ R&S MNTDagster @ R&S MNT
Dagster @ R&S MNT
 
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기
 
Advanced Security With GeoServer
Advanced Security With GeoServerAdvanced Security With GeoServer
Advanced Security With GeoServer
 
해양디지털트윈v02.pdf
해양디지털트윈v02.pdf해양디지털트윈v02.pdf
해양디지털트윈v02.pdf
 
Open Source GIS 기초교육 4일차 - GeoServer 기초 2014년 7월판
Open Source GIS 기초교육 4일차 - GeoServer 기초 2014년 7월판Open Source GIS 기초교육 4일차 - GeoServer 기초 2014년 7월판
Open Source GIS 기초교육 4일차 - GeoServer 기초 2014년 7월판
 
MongoDB + GeoServer
MongoDB + GeoServerMongoDB + GeoServer
MongoDB + GeoServer
 

Destacado

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
 

Destacado (20)

GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!
 
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
 
Crunching Data In GeoServer: Mastering Rendering Transformations, WPS Process...
Crunching Data In GeoServer: Mastering Rendering Transformations, WPS Process...Crunching Data In GeoServer: Mastering Rendering Transformations, WPS Process...
Crunching Data In GeoServer: Mastering Rendering Transformations, WPS Process...
 
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
 
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...
 
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
 

Similar a 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
 

Similar a 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
 
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
 
Exploring BigData with Google BigQuery
Exploring BigData with Google BigQueryExploring BigData with Google BigQuery
Exploring BigData with Google BigQuery
 

Más de 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
 
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
 

Más de GeoSolutions (13)

MapStore 2 - The Story
MapStore 2 - The StoryMapStore 2 - The Story
MapStore 2 - The Story
 
One GeoNode, many GeoNodes
One GeoNode, many GeoNodesOne GeoNode, many GeoNodes
One GeoNode, many GeoNodes
 
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
 
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
 
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...
 

Último

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

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