I am trying to understand how tile server handle requests.

I red about Mapnik which "creates" the map using OSM,

Does "creates" means that every request is rendered and returned? If yes what is the performance hit (global map)?

Or it means that Mapnik Creates all tiles needed on initialization and then serves the right one upon request? if yes what is the total storage needed for all tiles(for global map)?

I am trying to find a way to build my own tile server (global map) while rendering it only once.

1 Answer 1


Mapnik itself is basically just a rendering engine. As I understand, it can be used to render anything from tiles, to 8.5"x11", and even plotter-sized PDFs. To describe it very simply, Mapnik takes your data inputs, a spatial boundary, and a set of symbology styles (either hard-coded or an XML source), then it renders the map (potentially just a simple tile) relative to your inputs.

In other words, Mapnik isn't a server. However, your service layer--web methods or scripts in the context of your server's web scope--can certainly make calls against Mapnik to render tiles one-by-one. There's a whole program called mod_tile for doing that on the fly.

But as for every request--be aware of caching. If you want to defeat caching, you can typically send a time stamp uint as a url variable so that each request is considered unique by your web server.

My immediate advice is just install Mapnik on your development system (if Windows) and check out the demo (demos/rundemo.py also, generate_tiles.py). Boston GIS has some decent tutorials. Hack these a little bit and you'll learn a lot about how Mapnik consumes style definitions and renders something---be it a tile or otherwise.

  • Can you tell the performance hit for each rendered request? May 10, 2013 at 0:56
  • @YoniHassin unfortunately measuring per-tile rendering performance is non-trivial as it's influenced by several factors, like complexity of your map (do you have one or several map layers?), obviously system hardware, but perhaps not obviously, system tuning. It seems the greatest tuning gains are realized by scrutinizing your RDBMS instance (most often PostGRESql, but maybe Oracle, SQLite, MySQL, etc.) for any configuration tweaks that help retrieval performance. You may want to investigate precaching tables in memory, but if you want to prerender your tiles, this may not be a big issue.
    – elrobis
    May 12, 2013 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.