XX: SoftRefLRUPolicyMSPerMB=3600

obtainablerabbiΔιαχείριση Δεδομένων

31 Ιαν 2013 (πριν από 4 χρόνια και 8 μήνες)

250 εμφανίσεις

In Production

Juan Marin

Agenda


Introduction


Reliability


Availability


Performance


Data optimizations


Runtime optimizations


Measuring your environment


Monitoring your environment


Example

Introduction


No recipes, just guidelines


Security


Criteria for the quality of a production deployment:


Reliability


Availability


Performance



Change default admin user!!!


Block geoserver/web, access only internally


Use roles


New security subsystem coming in 2.2


Don’t forget about security

Reliability


Disable unused services


Control server resources


Set WMS rendering memory allocation and processing
time limits


Set WFS response size limits


Optimize WFS response types


Limit concurrent requests


Limit available server threads to reduce concurrency


Implement control flow to queue requests and avoid
server overload

Change default logging

Avoid system overload


Use
control flow
plugin


Limits # of concurrent requests by:


Service type (i.e. WMS, WFS, global)


User (cookie based, browsers)


IP address (any client)


Control Flow

Control Flow

Availability


Use mechanism to detect server unresponsiveness
and restart if necessary (i.e. watchdog)


Use load balancing across a pool of servers


Provide high availability by using redundant
hardware and software components throughout
the system

Data Optimizations


Sometimes the most important thing to do!!


Prepare your maps


Symbology that makes sense


Scale dependency


Store vector and raster data in the most frequently
requested coordinate system



High Availability Configurations

Load Balancer (i.e. HAProxy)

Performance


Optimize data and map configuration


Optimize raster and vector data storage


Don’t show too much data at once (~1000 features per
map request)


Use most recent version of Oracle JVM


Run in server mode


Configure options for maximum performance


Install native code extensions for JAI and Image I/O


Cluster your deployment


Better performance under load




Data optimizations


Raster optimizations


Use correct format (GeoTiff, BigTiff, etc.)


Use ImageMosaic


Use ImagePyramid


Vector optimizations


Make sure proper Spatial Index is being used


Use a spatial database


Validate connections


Use connection pooling


Generalize features for higher zoom levels


Avoid shapefile when filtering on attributes

GeoWebCache


Cache tiles for fast map rendering


Performance is sometimes orders of magnitude
faster than regular WMS


GeoWebCache is extremely fast, with some unique
features


Integrated with GeoServer or standalone with any WMS


Can expire tiles by reading a GeoRSS feed


Seed tile cache down to a certain zoom level, dynamically
cache below that



Runtime optimizations


JVM settings for production (example)


-
server
: run in server mode


-
Xms2048m
-
Xmx2048m
: maximum heap size, allocates it
all at startup



-
XX:PermSize=128m

-
XX:MaxPermSize=256m
: sets size and
maximum size of permanent collection memory. Very
important since GeoServer uses a lot of classes


-
XX: SoftRefLRUPolicyMSPerMB=3600
: Increases the
effectiveness of datastore cache references by increasing
the lifetime of “soft references”


-
XX:+UserParalleGC
: enables multi
-
threaded garbage
collection. Use with multicore systems only


-
XX:+AggressiveOpt
: enables experimental optimizations
that will be defaults in future versions of the JVM

Container tuning: Optimize
Tomcat


Limit number of concurrent threads in
Tomcat
(<CATALINA_DIR>/conf/server.xml)


<Server port=”8005” shutdown=”SHUTDOWN”> ... <Connector
port=”8080” protocol=”HTTP/1.1” ConnectionTimeout=”20000”
redirectPort=”8443”
maxThreads
=”20” minSpareThreads=”20” /> ...
</Server>


Install Apache Portable Runtime (APR)


more info here
http://tomcat.apache.org/tomcat
-
7.0
-
doc/apr.html



Measuring your environment

JMeter

VisualVM

Monitoring your environment

Example


Data


Washington DC OSM


Software


Ubuntu 11.10


PostgreSQL 9.1.2 + Postgis 2.0


Tomcat 7.0.26


GeoServer 2.1.3


JVM: OpenJDK6, Oracle JDK6 and Oracle JDK7


Hardware


4 cores


8GB RAM


Example data

Results

0
5
10
15
20
25
1
2
4
8
16
32
OpenJDK6
JDK6
JDK7
JDK7 + JAI
2 x JDK7 + JAI
References


GeoServer in Production White Paper


http://opengeo.org/publications/geoserver
-
production/register/?target=/publications/geoserver
-
production/


GeoServer on steroids


http://www.slideshare.net/geosolutions/geoserver
-
on
-
steroids

Questions?

Thank You