mod-geocache / mapcache - A fast tiling solution for the apache web server

T
MapServer MapCache
                                          (f.k.a mod-geocache)
                                  A Fast Tile-Caching Solution for the
                                          Apache HTTP Server




14 / 09 / 2011     Thomas Bonfort (Terriscope)
                 Stephen Woodbridge (iMaptools)
What’s a tile cache?
                            Source
    Services

                  Tileset


                  Grids
  requests

                            Cache
Yet Another Tile Cache ?
•  Mature / feature-full solutions already out
•  High performance needed
•  Started out as a small project, to validate the
   concept
•  Integrated into the MapServer stack for next
   release
Apache module
•  Module = code run by the apache processes
   that treat requests
•  Native code
•  No overhead (e.g. CGI, FastCGI)
•  Does not require spawning an interpreter per
   concurrent request
•  Caveats:
    –  Thread/process synchronization
    –  Memory management
    –  Security
Features
•  Metatiling
    –  Cross process/thread locking ensures you
       can enable metatiling on an unseeded
       tileset
•  Image recompression / optimization
    –  JPEG quality
    –  PNG compression level
    –  PNG quantization
    –  “Mixed” format: PNG+JPEG
Features (cont)
•  Expiration handling
    –  HTTP cache controlling headers
    –  Last-Modified, If-Modified-Since
    –  Automatically regenerate stale tiles
•  Custom error reporting
    –  Message
    –  Empty image
    –  Status code (+optional HTTP header)
•  Watermarking
Features (cont)
•  Dimensions
    –  Single values
    –  Intervals
    –  Regular Expressions
•  FeatureInfo forwarding
•  FastCGI / CGI option for use outside of apache
Services
•    TMS
•    WMTS
•    WMS / WMS-C
•    Google Maps XYZ
•    VirtualEarth Quadkeys
•    KML SuperOverlays
“Demo” Interface
•    Lists all active services
•    Easy way to check configured caches
•    Simple OpenLayers slippy-map
•    Cut-and-paste definitions for Layers
•    http://localhost:8081/mapcache/demo
Grids
•    Extent
•    Projection
•    Resolution per level
•    Tile size

•  Comes preconfigured with popular grids
•  Supports grid aliases
•  For limited areas, use grid subsets, not your
   own grid!
Data Sources
•  Extensible, anything able to provide an image
   for given:
    –  Width, Height
    –  Extent
    –  SRS
    –  Optionally dimension
•  WMS is the only implemented source
    –  Custom query parameters
    –  Custom headers
Caches
•  Extensible mechanism, backend must provide
   api to get/set a tile for a given grid, x, y, z
   (+dimension)
•  Higher level locking mechanism allows on-
   demand cache generation
•  Backends provide different performance /
   manageability tradeoffs
•  Currently implemented: filesystem, sqlite,
   memcached
Disk based caches
•  Tilecache hierarchy:
   –  /tmp/osm/g/17/000/027/304/000/081/334.png
•  Custom hierarchy:
   –  /tmp/{tileset}/{grid}/{x}-{y}-{z}.{ext}


•  Support for symlinking blank tiles
•  Watch out for filesystem limitations !
   –  Max files per directory
   –  Max number of inodes
   –  Blocksize
Sqlite caches
•  Store tile data as blobs in sqlite db
•  Slower than disk caches, but prevents
   filesytem headaches
•  Flexible storage options:
  –  Provided custom schema
  –  MBTiles schema
  –  Custom schema, provide your own queries:
     •  select tile_data from tiles where tile_column=:x and
        tile_row=:y and zoom_level=:z");
     •  insert or replace into
        tiles(tile_column,tile_row,zoom_level,tile_data) values
        (:x,:y,:z,:data)"
Vertical Assembling
  Save bandwidth, request a single tiled layer !




&LAYERS=OSM&…    &LAYERS=NEXRAD&…   &LAYERS=OSM,NEXRAD&…
Horizontal Assembling
Support non-tiled clients
Tile Assembling
•  CPU bound operation: image format (PNG/
   JPEG) encoding and decoding
•  CPU acceleration (MMX,SSE,…) of pixel
   manipulation operations (scaling, blending)
•  Configurable resampling
•  No reprojection support
•  Missing spec for TMS and WMTS support
Proxying support
•  Transparently add tiling / fast WMS support to
   existing services
•  Intercepts GetTile / GetMap requests
•  Configurable forwarding to other services
   based on request parameters
Seeder
•  Use multiple threads to load the source WMS
•  Reseed tiles older than a specified date
•  Seed only tiles inside given geometry
    –  OGR for data access: filter based on SQL
       queries, e.g. FIPS_A1=’USA’ ,
       pop_density>1000
    –  GEOS Prepared Geometries for fast
       intersection calculation
•  Delete mode
•  Specify dimension values
Benchmarks
•    Server: 4-core, 8GB ram, SSD storage
•    ab tool used over Gigabit Ethernet
•    “warm” filesystem
•    All requests on exact same image data
TMS requests / sec
Throughput very dependent on image size

     Concurrent                 MapProxy
                  Geowebcache              MapCache
      requests                    wsgi

         1           1 280        800       1 780

        10          17 000       9 000      30 000
        20          18 000       8 000      40 000

        100         17 000       7 100      40 000

        250         16 500       6 800      40 000
SQLite backend, TMS
•  MBTiles backend
•  10 threads:
    –  TileStream: 900
    –  MapCache: 8300
Horizontal assembling
•  Workload: ~20 png decompressions + 1 jpg
   compression
•  10 threads
•  With bilinear resampling
  –  MapProxy: 29
  –  MapCache: 43
•  With nearest neighbor resampling
  –  Geowebcache: 35
  –  MapProxy: 40
  –  MapCache: 48
Vertical assembling
•  Workload: 2 png decompressions, 1 jpeg
   compression
•  10 threads:
    –  Geowebcache: unsupported
    –  MapProxy: 435
    –  MapCache: 640
What’s next?
•  MapServer Stack integration
   –  Docs
   –  Code sharing (image I/O, build tools)
•  Ideas:
   –  Source assembling at the tileset level
   –  OGC ServiceExceptions
   –  HTTP options:
       •  HTTPS
       •  Authentication
       •  POST
Want More?
•  Soon up to date project page:
  http://www.mapserver.org/trunk/mapcache/index.html
•  Soon defunct project page:
  http://code.google.com/p/mod-geocache/
•  Get the code:
    –  Mapserver trunk svn
    –  Mapserver 6.2
•  Contribute !
•  Twitter: @tbonfort
1 of 26

Recommended

Wms Performance Tests Map Server Vs Geo Server by
Wms Performance Tests Map Server Vs Geo ServerWms Performance Tests Map Server Vs Geo Server
Wms Performance Tests Map Server Vs Geo ServerDonnyV
12.4K views26 slides
Performance of Microservice frameworks on different JVMs by
Performance of Microservice frameworks on different JVMsPerformance of Microservice frameworks on different JVMs
Performance of Microservice frameworks on different JVMsMaarten Smeets
3.9K views43 slides
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc... by
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...Databricks
855 views75 slides
Trend Micro Big Data Platform and Apache Bigtop by
Trend Micro Big Data Platform and Apache BigtopTrend Micro Big Data Platform and Apache Bigtop
Trend Micro Big Data Platform and Apache BigtopEvans Ye
8.8K views77 slides
Intro to CloudStack API by
Intro to CloudStack APIIntro to CloudStack API
Intro to CloudStack APISebastien Goasguen
13.5K views19 slides
Webinar: 99 Ways to Enrich Streaming Data with Apache Flink - Konstantin Knauf by
Webinar: 99 Ways to Enrich Streaming Data with Apache Flink - Konstantin KnaufWebinar: 99 Ways to Enrich Streaming Data with Apache Flink - Konstantin Knauf
Webinar: 99 Ways to Enrich Streaming Data with Apache Flink - Konstantin KnaufVerverica
2.2K views37 slides

More Related Content

What's hot

Citrix TechEdge 2014 - Advanced Tools and Techniques for Troubleshooting NetS... by
Citrix TechEdge 2014 - Advanced Tools and Techniques for Troubleshooting NetS...Citrix TechEdge 2014 - Advanced Tools and Techniques for Troubleshooting NetS...
Citrix TechEdge 2014 - Advanced Tools and Techniques for Troubleshooting NetS...David McGeough
8.1K views48 slides
Openstack 101 by
Openstack 101Openstack 101
Openstack 101Kamesh Pemmaraju
17.1K views55 slides
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins by
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsMonitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsDatabricks
691 views28 slides
Cloud foundry: The Platform for Forging Cloud Native Applications by
Cloud foundry: The Platform for Forging Cloud Native ApplicationsCloud foundry: The Platform for Forging Cloud Native Applications
Cloud foundry: The Platform for Forging Cloud Native ApplicationsChip Childers
7.2K views53 slides
How To Monetise & Bill CloudStack - A Practical Open Approach by
How To Monetise & Bill CloudStack - A Practical Open ApproachHow To Monetise & Bill CloudStack - A Practical Open Approach
How To Monetise & Bill CloudStack - A Practical Open ApproachShapeBlue
829 views16 slides
Introduction of Java GC Tuning and Java Java Mission Control by
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlLeon Chen
20.5K views93 slides

What's hot(20)

Citrix TechEdge 2014 - Advanced Tools and Techniques for Troubleshooting NetS... by David McGeough
Citrix TechEdge 2014 - Advanced Tools and Techniques for Troubleshooting NetS...Citrix TechEdge 2014 - Advanced Tools and Techniques for Troubleshooting NetS...
Citrix TechEdge 2014 - Advanced Tools and Techniques for Troubleshooting NetS...
David McGeough8.1K views
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins by Databricks
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsMonitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Databricks691 views
Cloud foundry: The Platform for Forging Cloud Native Applications by Chip Childers
Cloud foundry: The Platform for Forging Cloud Native ApplicationsCloud foundry: The Platform for Forging Cloud Native Applications
Cloud foundry: The Platform for Forging Cloud Native Applications
Chip Childers7.2K views
How To Monetise & Bill CloudStack - A Practical Open Approach by ShapeBlue
How To Monetise & Bill CloudStack - A Practical Open ApproachHow To Monetise & Bill CloudStack - A Practical Open Approach
How To Monetise & Bill CloudStack - A Practical Open Approach
ShapeBlue829 views
Introduction of Java GC Tuning and Java Java Mission Control by Leon Chen
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
Leon Chen20.5K views
Cisco Application Centric Infrastructure by islam Salah
Cisco Application Centric InfrastructureCisco Application Centric Infrastructure
Cisco Application Centric Infrastructure
islam Salah2.2K views
Apache Flink internals by Kostas Tzoumas
Apache Flink internalsApache Flink internals
Apache Flink internals
Kostas Tzoumas12.4K views
[Defcon] Hardware backdooring is practical by Moabi.com
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
Moabi.com130.2K views
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022 by StreamNative
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
Beam + Pulsar: Powerful Stream Processing at Scale - Pulsar Summit SF 2022
StreamNative82 views
SD-WAN Orchestration by Ericsson
SD-WAN OrchestrationSD-WAN Orchestration
SD-WAN Orchestration
Ericsson3.7K views
PromQL Deep Dive - The Prometheus Query Language by Weaveworks
PromQL Deep Dive - The Prometheus Query Language PromQL Deep Dive - The Prometheus Query Language
PromQL Deep Dive - The Prometheus Query Language
Weaveworks27.6K views
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi... by StreamNative
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
StreamNative318 views
Hoodie - DataEngConf 2017 by Vinoth Chandar
Hoodie - DataEngConf 2017Hoodie - DataEngConf 2017
Hoodie - DataEngConf 2017
Vinoth Chandar1.2K views
Enabling Search in your Cassandra Application with DataStax Enterprise by DataStax Academy
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
DataStax Academy2.5K views
Extending Apache Ranger Authorization Beyond Hadoop: Review of Apache Ranger ... by DataWorks Summit
Extending Apache Ranger Authorization Beyond Hadoop: Review of Apache Ranger ...Extending Apache Ranger Authorization Beyond Hadoop: Review of Apache Ranger ...
Extending Apache Ranger Authorization Beyond Hadoop: Review of Apache Ranger ...
DataWorks Summit1.4K views
Monitoring Kubernetes with Prometheus by Grafana Labs
Monitoring Kubernetes with PrometheusMonitoring Kubernetes with Prometheus
Monitoring Kubernetes with Prometheus
Grafana Labs648 views
Securing Kafka by confluent
Securing Kafka Securing Kafka
Securing Kafka
confluent14.6K views

Viewers also liked

FieldtripGB - data capture simplified by
FieldtripGB - data capture simplifiedFieldtripGB - data capture simplified
FieldtripGB - data capture simplifiedAddy Pope
3.1K views17 slides
WMS Performance Shootout 2009 by
WMS Performance Shootout 2009WMS Performance Shootout 2009
WMS Performance Shootout 2009Jeff McKenna
7.8K views48 slides
Mapserver vs. geoserver by
Mapserver vs. geoserverMapserver vs. geoserver
Mapserver vs. geoserver鸣 饶
25.4K views26 slides
Digimap Data and a Non-traditionalist Perspective - Shelley Mosco by
Digimap Data and a Non-traditionalist Perspective - Shelley MoscoDigimap Data and a Non-traditionalist Perspective - Shelley Mosco
Digimap Data and a Non-traditionalist Perspective - Shelley MoscoEDINA, University of Edinburgh
1.3K views25 slides
WMS Performance Shootout 2010 by
WMS Performance Shootout 2010WMS Performance Shootout 2010
WMS Performance Shootout 2010Jeff McKenna
14.3K views77 slides
Maps and Apps by
Maps and AppsMaps and Apps
Maps and AppsAddy Pope
1.3K views42 slides

Viewers also liked(10)

FieldtripGB - data capture simplified by Addy Pope
FieldtripGB - data capture simplifiedFieldtripGB - data capture simplified
FieldtripGB - data capture simplified
Addy Pope3.1K views
WMS Performance Shootout 2009 by Jeff McKenna
WMS Performance Shootout 2009WMS Performance Shootout 2009
WMS Performance Shootout 2009
Jeff McKenna7.8K views
Mapserver vs. geoserver by 鸣 饶
Mapserver vs. geoserverMapserver vs. geoserver
Mapserver vs. geoserver
鸣 饶25.4K views
WMS Performance Shootout 2010 by Jeff McKenna
WMS Performance Shootout 2010WMS Performance Shootout 2010
WMS Performance Shootout 2010
Jeff McKenna14.3K views
Maps and Apps by Addy Pope
Maps and AppsMaps and Apps
Maps and Apps
Addy Pope1.3K views
MapServer #ProTips 2015 by Jeff McKenna
MapServer #ProTips 2015MapServer #ProTips 2015
MapServer #ProTips 2015
Jeff McKenna1.2K views
WMS Performance Shootout 2011 by Jeff McKenna
WMS Performance Shootout 2011WMS Performance Shootout 2011
WMS Performance Shootout 2011
Jeff McKenna5.6K views
Is An Agile Standard Possible For Java? by Simon Ritter
Is An Agile Standard Possible For Java?Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?
Simon Ritter3.2K views
55 New Features in JDK 9 by Simon Ritter
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
Simon Ritter26.7K views

Similar to mod-geocache / mapcache - A fast tiling solution for the apache web server

Kinetic basho public by
Kinetic basho publicKinetic basho public
Kinetic basho publicAnton Gerasimov
1.4K views33 slides
Tile Caching Options by
Tile Caching OptionsTile Caching Options
Tile Caching OptionsWisconsin Land Information Association
6.3K views20 slides
In memory grids IMDG by
In memory grids IMDGIn memory grids IMDG
In memory grids IMDGPrateek Jain
2.1K views18 slides
Advanced Map Caching Topics by
Advanced Map Caching TopicsAdvanced Map Caching Topics
Advanced Map Caching TopicsEsri
2.8K views48 slides
Bryan Thompson, Chief Scientist and Founder, SYSTAP, LLC at MLconf ATL by
Bryan Thompson, Chief Scientist and Founder, SYSTAP, LLC at MLconf ATLBryan Thompson, Chief Scientist and Founder, SYSTAP, LLC at MLconf ATL
Bryan Thompson, Chief Scientist and Founder, SYSTAP, LLC at MLconf ATLMLconf
3.6K views30 slides
On-boarding with JanusGraph Performance by
On-boarding with JanusGraph PerformanceOn-boarding with JanusGraph Performance
On-boarding with JanusGraph PerformanceChin Huang
7.7K views22 slides

Similar to mod-geocache / mapcache - A fast tiling solution for the apache web server(20)

In memory grids IMDG by Prateek Jain
In memory grids IMDGIn memory grids IMDG
In memory grids IMDG
Prateek Jain2.1K views
Advanced Map Caching Topics by Esri
Advanced Map Caching TopicsAdvanced Map Caching Topics
Advanced Map Caching Topics
Esri2.8K views
Bryan Thompson, Chief Scientist and Founder, SYSTAP, LLC at MLconf ATL by MLconf
Bryan Thompson, Chief Scientist and Founder, SYSTAP, LLC at MLconf ATLBryan Thompson, Chief Scientist and Founder, SYSTAP, LLC at MLconf ATL
Bryan Thompson, Chief Scientist and Founder, SYSTAP, LLC at MLconf ATL
MLconf3.6K views
On-boarding with JanusGraph Performance by Chin Huang
On-boarding with JanusGraph PerformanceOn-boarding with JanusGraph Performance
On-boarding with JanusGraph Performance
Chin Huang7.7K views
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ... by Chester Chen
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
Chester Chen3.5K views
Apache Spark AI Use Case in Telco: Network Quality Analysis and Prediction wi... by Databricks
Apache Spark AI Use Case in Telco: Network Quality Analysis and Prediction wi...Apache Spark AI Use Case in Telco: Network Quality Analysis and Prediction wi...
Apache Spark AI Use Case in Telco: Network Quality Analysis and Prediction wi...
Databricks1.9K views
High performace network of Cloud Native Taiwan User Group by HungWei Chiu
High performace network of Cloud Native Taiwan User GroupHigh performace network of Cloud Native Taiwan User Group
High performace network of Cloud Native Taiwan User Group
HungWei Chiu1.8K views
Java one2015 - Work With Hundreds of Hot Terabytes in JVMs by Speedment, Inc.
Java one2015 - Work With Hundreds of Hot Terabytes in JVMsJava one2015 - Work With Hundreds of Hot Terabytes in JVMs
Java one2015 - Work With Hundreds of Hot Terabytes in JVMs
Speedment, Inc.1.6K views
Building maps for apps in the cloud - a Softlayer Use Case by Timan Rebel
Building maps for  apps in the cloud - a Softlayer Use CaseBuilding maps for  apps in the cloud - a Softlayer Use Case
Building maps for apps in the cloud - a Softlayer Use Case
Timan Rebel1.3K views
High-Performance Storage Services with HailDB and Java by sunnygleason
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
sunnygleason1.4K views
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516] by Malin Weiss
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
Malin Weiss103 views
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516] by Speedment, Inc.
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
Speedment, Inc.206 views
Distributed caching-computing v3.8 by Rahul Gupta
Distributed caching-computing v3.8Distributed caching-computing v3.8
Distributed caching-computing v3.8
Rahul Gupta778 views
In-memory Data Management Trends & Techniques by Hazelcast
In-memory Data Management Trends & TechniquesIn-memory Data Management Trends & Techniques
In-memory Data Management Trends & Techniques
Hazelcast1K views
Webinar - DreamObjects/Ceph Case Study by Ceph Community
Webinar - DreamObjects/Ceph Case StudyWebinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case Study
Ceph Community 1.7K views

Recently uploaded

Mobile Core Solutions & Successful Cases.pdf by
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdfIPLOOK Networks
14 views7 slides
"Package management in monorepos", Zoltan Kochan by
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan KochanFwdays
34 views18 slides
The Role of Patterns in the Era of Large Language Models by
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language ModelsYunyao Li
91 views65 slides
Generative AI: Shifting the AI Landscape by
Generative AI: Shifting the AI LandscapeGenerative AI: Shifting the AI Landscape
Generative AI: Shifting the AI LandscapeDeakin University
67 views55 slides
Measurecamp Brussels - Synthetic data.pdf by
Measurecamp Brussels - Synthetic data.pdfMeasurecamp Brussels - Synthetic data.pdf
Measurecamp Brussels - Synthetic data.pdfHuman37
26 views14 slides
Measuring User on the web with the core web vitals - by @theafolayan.pptx by
Measuring User on the web with the core web vitals - by @theafolayan.pptxMeasuring User on the web with the core web vitals - by @theafolayan.pptx
Measuring User on the web with the core web vitals - by @theafolayan.pptxOluwaseun Raphael Afolayan
14 views13 slides

Recently uploaded(20)

Mobile Core Solutions & Successful Cases.pdf by IPLOOK Networks
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdf
IPLOOK Networks14 views
"Package management in monorepos", Zoltan Kochan by Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays34 views
The Role of Patterns in the Era of Large Language Models by Yunyao Li
The Role of Patterns in the Era of Large Language ModelsThe Role of Patterns in the Era of Large Language Models
The Role of Patterns in the Era of Large Language Models
Yunyao Li91 views
Measurecamp Brussels - Synthetic data.pdf by Human37
Measurecamp Brussels - Synthetic data.pdfMeasurecamp Brussels - Synthetic data.pdf
Measurecamp Brussels - Synthetic data.pdf
Human37 26 views
"Node.js Development in 2024: trends and tools", Nikita Galkin by Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays33 views
Cocktail of Environments. How to Mix Test and Development Environments and St... by Aleksandr Tarasov
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...
What is Authentication Active Directory_.pptx by HeenaMehta35
What is Authentication Active Directory_.pptxWhat is Authentication Active Directory_.pptx
What is Authentication Active Directory_.pptx
HeenaMehta3515 views
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf by MichaelOLeary82
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfAdopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
MichaelOLeary8213 views
The Coming AI Tsunami.pptx by johnhandby
The Coming AI Tsunami.pptxThe Coming AI Tsunami.pptx
The Coming AI Tsunami.pptx
johnhandby13 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10145 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu437 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty65 views
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」 by PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」

mod-geocache / mapcache - A fast tiling solution for the apache web server

  • 1. MapServer MapCache (f.k.a mod-geocache) A Fast Tile-Caching Solution for the Apache HTTP Server 14 / 09 / 2011 Thomas Bonfort (Terriscope) Stephen Woodbridge (iMaptools)
  • 2. What’s a tile cache? Source Services Tileset Grids requests Cache
  • 3. Yet Another Tile Cache ? •  Mature / feature-full solutions already out •  High performance needed •  Started out as a small project, to validate the concept •  Integrated into the MapServer stack for next release
  • 4. Apache module •  Module = code run by the apache processes that treat requests •  Native code •  No overhead (e.g. CGI, FastCGI) •  Does not require spawning an interpreter per concurrent request •  Caveats: –  Thread/process synchronization –  Memory management –  Security
  • 5. Features •  Metatiling –  Cross process/thread locking ensures you can enable metatiling on an unseeded tileset •  Image recompression / optimization –  JPEG quality –  PNG compression level –  PNG quantization –  “Mixed” format: PNG+JPEG
  • 6. Features (cont) •  Expiration handling –  HTTP cache controlling headers –  Last-Modified, If-Modified-Since –  Automatically regenerate stale tiles •  Custom error reporting –  Message –  Empty image –  Status code (+optional HTTP header) •  Watermarking
  • 7. Features (cont) •  Dimensions –  Single values –  Intervals –  Regular Expressions •  FeatureInfo forwarding •  FastCGI / CGI option for use outside of apache
  • 8. Services •  TMS •  WMTS •  WMS / WMS-C •  Google Maps XYZ •  VirtualEarth Quadkeys •  KML SuperOverlays
  • 9. “Demo” Interface •  Lists all active services •  Easy way to check configured caches •  Simple OpenLayers slippy-map •  Cut-and-paste definitions for Layers •  http://localhost:8081/mapcache/demo
  • 10. Grids •  Extent •  Projection •  Resolution per level •  Tile size •  Comes preconfigured with popular grids •  Supports grid aliases •  For limited areas, use grid subsets, not your own grid!
  • 11. Data Sources •  Extensible, anything able to provide an image for given: –  Width, Height –  Extent –  SRS –  Optionally dimension •  WMS is the only implemented source –  Custom query parameters –  Custom headers
  • 12. Caches •  Extensible mechanism, backend must provide api to get/set a tile for a given grid, x, y, z (+dimension) •  Higher level locking mechanism allows on- demand cache generation •  Backends provide different performance / manageability tradeoffs •  Currently implemented: filesystem, sqlite, memcached
  • 13. Disk based caches •  Tilecache hierarchy: –  /tmp/osm/g/17/000/027/304/000/081/334.png •  Custom hierarchy: –  /tmp/{tileset}/{grid}/{x}-{y}-{z}.{ext} •  Support for symlinking blank tiles •  Watch out for filesystem limitations ! –  Max files per directory –  Max number of inodes –  Blocksize
  • 14. Sqlite caches •  Store tile data as blobs in sqlite db •  Slower than disk caches, but prevents filesytem headaches •  Flexible storage options: –  Provided custom schema –  MBTiles schema –  Custom schema, provide your own queries: •  select tile_data from tiles where tile_column=:x and tile_row=:y and zoom_level=:z"); •  insert or replace into tiles(tile_column,tile_row,zoom_level,tile_data) values (:x,:y,:z,:data)"
  • 15. Vertical Assembling Save bandwidth, request a single tiled layer ! &LAYERS=OSM&… &LAYERS=NEXRAD&… &LAYERS=OSM,NEXRAD&…
  • 17. Tile Assembling •  CPU bound operation: image format (PNG/ JPEG) encoding and decoding •  CPU acceleration (MMX,SSE,…) of pixel manipulation operations (scaling, blending) •  Configurable resampling •  No reprojection support •  Missing spec for TMS and WMTS support
  • 18. Proxying support •  Transparently add tiling / fast WMS support to existing services •  Intercepts GetTile / GetMap requests •  Configurable forwarding to other services based on request parameters
  • 19. Seeder •  Use multiple threads to load the source WMS •  Reseed tiles older than a specified date •  Seed only tiles inside given geometry –  OGR for data access: filter based on SQL queries, e.g. FIPS_A1=’USA’ , pop_density>1000 –  GEOS Prepared Geometries for fast intersection calculation •  Delete mode •  Specify dimension values
  • 20. Benchmarks •  Server: 4-core, 8GB ram, SSD storage •  ab tool used over Gigabit Ethernet •  “warm” filesystem •  All requests on exact same image data
  • 21. TMS requests / sec Throughput very dependent on image size Concurrent MapProxy Geowebcache MapCache requests wsgi 1 1 280 800 1 780 10 17 000 9 000 30 000 20 18 000 8 000 40 000 100 17 000 7 100 40 000 250 16 500 6 800 40 000
  • 22. SQLite backend, TMS •  MBTiles backend •  10 threads: –  TileStream: 900 –  MapCache: 8300
  • 23. Horizontal assembling •  Workload: ~20 png decompressions + 1 jpg compression •  10 threads •  With bilinear resampling –  MapProxy: 29 –  MapCache: 43 •  With nearest neighbor resampling –  Geowebcache: 35 –  MapProxy: 40 –  MapCache: 48
  • 24. Vertical assembling •  Workload: 2 png decompressions, 1 jpeg compression •  10 threads: –  Geowebcache: unsupported –  MapProxy: 435 –  MapCache: 640
  • 25. What’s next? •  MapServer Stack integration –  Docs –  Code sharing (image I/O, build tools) •  Ideas: –  Source assembling at the tileset level –  OGC ServiceExceptions –  HTTP options: •  HTTPS •  Authentication •  POST
  • 26. Want More? •  Soon up to date project page: http://www.mapserver.org/trunk/mapcache/index.html •  Soon defunct project page: http://code.google.com/p/mod-geocache/ •  Get the code: –  Mapserver trunk svn –  Mapserver 6.2 •  Contribute ! •  Twitter: @tbonfort