Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Scalable OSGeo Stacks 
From Tutorials to Production 
David Zwarg 
dzwarg@courbanize.com
Tutorials 
• A good place to start! 
• A bad place to end!
Production Environments 
• Your production environment is a beautiful snowflake. 
! 
• Mileage may vary
Definition of Terms 
• “Production” 
• A data-driven, dynamic, scalable, web application 
• “Tutorial” 
• Anything else
“data-driven” 
Anything that can be 
changed in the 
application is changed in 
a database. 
photo by Daniel Mitchell (fli...
“dynamic” 
Each visitor may have a 
personalized “view” of 
any URL. 
photo by Jessa Dow-Anderson (flickr)
“scalable” 
The application may be 
run on 1 server or 100 
servers. 
photo by Tiny Delights (flickr)
“web 
application” 
An application that 
provides rich interactivity 
in a user’s web browser.
Good Tutorials Warn You 
• Bad tutorials don’t
Tutorial #1: django 
• https://docs.djangoproject.com/en/1.7/intro/tutorial01/ 
• Do not ignore these helpful notes:
Tutorial #2: geodjango 
• “Use the source” 
• Source installs can be just as dependable as package 
management solutions
Side Note: Source Install 
• Ensure that all script installations are scriptable 
• Script & version package management in...
Tutorial #3: celery 
• More helpful log messages: 
“UserWarning: Using settings.DEBUG 
leads to a memory leak, never use t...
Side Note: Workers 
• Long-running processes should be performed “out of 
band” 
• Use separate processes to do big tasks
Visitor Traffic 
What your users feel 
photo by Björn (flickr)
Visitor Traffic 
What it really looks like 
photo by joiseyshowaa (flickr)
Backend 
Scaling 
Tips for Servers 
photo by Henrik Bennetsen (flickr)
Scaling GEOS & GDAL 
• Single-threaded designs 
• Apache: use the preform multiprocessing module 
(mpm_prefork) 
• gunicor...
Scaling Tiles 
• Geoserver includes Geowebcache 
• Cache WMS image tiles 
• Automatic cache seeding 
• Scriptable via REST
Scaling Tiles (cont.) 
• Tilestache 
• Plugs into Mapnik 
• Use with MBTiles, Amazon S3, Memcache, etc
Scaling PostGIS 
• Heroku provides the option of HA failover and PostGIS. 
• Or, roll your own snowflake (WAL, Slony, Buca...
Frontend 
Scaling 
Tips for Web 
Applications
OpenLayers 
• Loading Strategies 
• BBOX 
• Vector “Resolution” 
• Don’t drown in data
Use a CDN 
• “Content Delivery Network” 
• https://cdnjs.com 
• https://ajax.googleapis.com 
• http://cloudflare.net 
• mo...
General Tips 
• Scale servers on demand 
• Don’t overwhelm clients 
• Focus on long-running processes & slow requests 
• U...
Scalable OSGeo Stacks 
From Tutorials to Production 
David Zwarg 
dzwarg@courbanize.com
Upcoming SlideShare
Loading in …5
×

OSGeo in Production

688 views

Published on

Some tips and tricks about deploying software in the FOSS4G ecosystem. Backend and frontend scaling solutions are offered, and tips for a scalable solution are offered.

Published in: Software
  • Be the first to comment

  • Be the first to like this

OSGeo in Production

  1. 1. Scalable OSGeo Stacks From Tutorials to Production David Zwarg dzwarg@courbanize.com
  2. 2. Tutorials • A good place to start! • A bad place to end!
  3. 3. Production Environments • Your production environment is a beautiful snowflake. ! • Mileage may vary
  4. 4. Definition of Terms • “Production” • A data-driven, dynamic, scalable, web application • “Tutorial” • Anything else
  5. 5. “data-driven” Anything that can be changed in the application is changed in a database. photo by Daniel Mitchell (flickr)
  6. 6. “dynamic” Each visitor may have a personalized “view” of any URL. photo by Jessa Dow-Anderson (flickr)
  7. 7. “scalable” The application may be run on 1 server or 100 servers. photo by Tiny Delights (flickr)
  8. 8. “web application” An application that provides rich interactivity in a user’s web browser.
  9. 9. Good Tutorials Warn You • Bad tutorials don’t
  10. 10. Tutorial #1: django • https://docs.djangoproject.com/en/1.7/intro/tutorial01/ • Do not ignore these helpful notes:
  11. 11. Tutorial #2: geodjango • “Use the source” • Source installs can be just as dependable as package management solutions
  12. 12. Side Note: Source Install • Ensure that all script installations are scriptable • Script & version package management installations • Aim for a repeatable installation
  13. 13. Tutorial #3: celery • More helpful log messages: “UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!”
  14. 14. Side Note: Workers • Long-running processes should be performed “out of band” • Use separate processes to do big tasks
  15. 15. Visitor Traffic What your users feel photo by Björn (flickr)
  16. 16. Visitor Traffic What it really looks like photo by joiseyshowaa (flickr)
  17. 17. Backend Scaling Tips for Servers photo by Henrik Bennetsen (flickr)
  18. 18. Scaling GEOS & GDAL • Single-threaded designs • Apache: use the preform multiprocessing module (mpm_prefork) • gunicorn: use synchronous workers with many worker_processes
  19. 19. Scaling Tiles • Geoserver includes Geowebcache • Cache WMS image tiles • Automatic cache seeding • Scriptable via REST
  20. 20. Scaling Tiles (cont.) • Tilestache • Plugs into Mapnik • Use with MBTiles, Amazon S3, Memcache, etc
  21. 21. Scaling PostGIS • Heroku provides the option of HA failover and PostGIS. • Or, roll your own snowflake (WAL, Slony, Bucardo)
  22. 22. Frontend Scaling Tips for Web Applications
  23. 23. OpenLayers • Loading Strategies • BBOX • Vector “Resolution” • Don’t drown in data
  24. 24. Use a CDN • “Content Delivery Network” • https://cdnjs.com • https://ajax.googleapis.com • http://cloudflare.net • more!
  25. 25. General Tips • Scale servers on demand • Don’t overwhelm clients • Focus on long-running processes & slow requests • Use a cache
  26. 26. Scalable OSGeo Stacks From Tutorials to Production David Zwarg dzwarg@courbanize.com

×