[GIS] How to Optimize Openstreetmap Tile Rendering

amazon ec2openstreetmapoptimizationrendering

I am currently trying to render Water (3,198,333 records) and detailed world borders (processed_p) for the world. I am successful in rendering both layers, but I am not happy with performance.

My current setup is as follows:

  • Amazon EC2 instance (m2.2xlarge)
  • 34.2 GB of memory
  • 13 EC2 Compute Units (4 virtual cores with 3.25 EC2 Compute Units each)
  • 850 GB of instance storage
  • 64-bit platform
  • I/O Performance: High
  • Mapnik, 4 threads
  • Postgresql settings based on these benchmarks
  • GiST index in place for all of my layers

Some of my Ideas to Increase Performance:

  • Simplifying my features
  • Don't render water tiles – when loading with openlayers can set load failure to blue color
  • Split world water features into various sections and explicitly tell mapnik its bounds. For example, if I split water features from North America, when Mapnik is generating tiles for Australia it should not query North America to see if any of its features are in the tiles.
  • My second idea is a bit more crazy. Since Mapnik performs a spatial query for each tile in order to find features to process, I can perform this query beforehand for all of my layers. I would assume that this would save some processing power.

My Question:
What else can I do to optimize tile rendering?

Best Answer

Here are some links: http://www.geofabrik.de/media/2010-07-10-rendering-toolchain-performance.pdf

http://www.geofabrik.de/media/2012-09-08-osm2pgsql-performance.pdf

another point: split data to more tables: the less objects to filter, the faster the rendering

Related Question