[ka-Map-users] Precaching, metatiling, and mapserver

Paul Spencer pspencer at dmsolutions.ca
Wed May 17 19:27:25 EDT 2006

Justin, comments inline ... my overall response is that if you are  
pregenerating then it is worth making the metatile size as large as  
you can, certainly in the 2000x2000 pixel range and probably higher  
if you can recompile mapserver ...

On 17-May-06, at 7:15 PM, Justin George wrote:

> I've been delving into precacheing more deeply here lately, and I have
> a couple questions that should be fairly simple if people are doing
> the same thing I am (precaching the entire extents of the map data to
> be rendered)
> A) Which is faster, large metatiles or small metatiles?
> Right now I've increased the size, which seems to give faster
> generation. Using 800x800 tiles at 4x4 per metatile looks to be giving
> me about 30% speed increase.

in general, the larger the meta tile, the slower rendering an  
individual metatile will be but the less of them for total processing  
time.  I'd recommend (if you are precaching) jacking up the metatile  
size as large as possible.  At some point, it may become slower for  
mapserver to render the metatile than to process several metatiles,  
but the advantage is that larger metatiles mean less labelling  
problems and probably nicer looking maps.

I typically use about 1200x1200 meta tiles.  By default, mapserver  
allows up to 2000x2000 pixels (or something like that).  If you want  
to have larger meta tiles, you probably have to rebuild mapserver  
with the limit changed (not sure how to do that).

> B) Is there a good reason to delete the metatiles besides the space  
> requirement?
> I'm currently not running anywhere near my space limits (3gb of a
> 120gb array) so I'm curious whether unlinking the metatiles helps
> anything, or whether I can turn it off to not have to regenerate them
> later.

nope.  Although if you need to regenerate the tiles, its likely that  
having the metatile around isn't going to be that useful :)

> C) What seems to be the slowest part of precaching?
> To me it's looking like the initial generation, but I'm curious
> whether cutting the tiles up takes a substantial amount of time, as
> well. If they don't, then (barring some inherent limit) it seems that
> I should ramp the metaWidth and metaHeight up even further, while
> keeping the tile sizes themselves small for faster downloading.

The larger the metatile, the longer it is going to take mapserver to  
render it and I doubt that tiling takes much time at all.  There may  
be a practical limit of what GD can handle for image sizes though.

> Also, I should specify I'm running this on a linux-based box, with
> most of the data coming from tileindexed shapefiles, but some still
> being pulled from postgres with PostGIS on it (trying to transition
> away from that, as it appears to be slower)



> Thanks for the help, folks!
> J
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

|Paul Spencer                           pspencer at dmsolutions.ca   |
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|

More information about the ka-Map-users mailing list