[OSM-dev] Improvement of tile rendering

Udo Giacomozzi udo.osm at nova-sys.net
Sat Mar 21 01:08:33 GMT 2009


Hello sylvain,

Friday, March 20, 2009, 1:40:39 AM, you wrote:
sl> That's almost what I did in the first place ( in even more hugly !) as I am a
sl> php dev and not a python dev. But just like you figured it out, there are no
sl> php mapnik bindings...

Mapnik seems to be completely focused on Python since I cannot find
any documentation of libmapnik and all examples are written in Python.
Too bad :-(


>> Anyway. This method keeps the server busy with invoking Interpreters
>> and parsing scripts instead of really do something useful

sl> Well, not only and not mainly, (mod_php will stay loaded, and the python
sl> interpreter will be cached to ram )

I was talking about the simple php script that invokes the
set-mapnik-env script which in turn starts the Python interpreter..


sl> The main problem I found was that the xml mapnik style file (~300ko) is
sl> reloaded and parsed at every tile generation. That was roughly 70% of time
sl> spent.

Sounds like there is much potential to speed rendering up.


sl> mod_tile really seams the fastest solution fro high traffic server. But maybe
sl> (I said maybe I didn't tried it, only supposed it from docs) lacking a few
sl> functionnalities or flexibility
sl> ( server side tiles merging, common cached tiles across different mapnik
sl> styles at special zooms, ...) things that you probably don't want to recode
sl> in C while simpler in "high level" language for noobs like me ;-)

Usually using a compiled language (C++) offers better performance
because you can take optimize better using special O/S functionality
(but, of course, this is no guarantee).


One could even think of avoiding Mapnik completely and writing a
custom OSM renderer using AGG (which would also allow fixing the
labeling issues). In fact that would not be too hard to do (once you
understand the strange way how AGG works, drawing strokes and such is
quite simple). AFAIK Mapnik is highly configurable so that you can
style your map the way you like without having to touch the code.
Designing such a configuration would be probably more time consuming
than the rendering itself.

I think that a specialized rendering daemon using AGG (and no Mapnik)
would be able to render 10-30 tiles per second per core (probably
more) on a normal processor.

AGG is extremely fast for being a software renderer and could render
even 100 tiles or more per second, but managing/loading data and
calculating optimal positions for labels would be probably the
bottleneck.


Unfortunately I haven't the time to write this beast myself...


Udo






More information about the dev mailing list