[MS4W-Users] Parallelism in KaMap - an Apache and Php/Mapscript configuration question

Daniel Morissette dmorissette at mapgears.com
Tue Nov 9 16:11:52 EST 2010


Jeff Dege wrote:
> 
> Actually, even using KaMap, the tile generation is too slow, so to get
> acceptable performance we need to precache the tiles.  We have a program
> that generates a series of “wget http://..../tile.php?...” calls, each
> of which hits the php app on the Apache webserver, asking for a
> particular tile.  Php checks its disk cache, and if the tile exists, it
> returns it.  If not, it makes a call to mapscript to generate the image,
> saves it in its disk cache, and returns the generated image.
> 
[...]
> 
> Running the six batch files simultaneously took 37 hours to complete. 
> Running just one of them took a bit over seven hours.  That’s way too
> close to 1/6^th of the time for me to not think that we’ve got a
> bottleneck, somewhere, and there’s no parallelism happening.
> 

Does your list of tile URLs contain only one tile URL per metatile or
does it contain a list of possible tiles in a given area, resulting in
multiple hits on the same metatile?

What may be happening is that if you send 6 requests in parallel that
all fall on the same metatile and that this metatile is not in cache
yet, then the first hit sets a lock on that metatile and draws it,
splits the tiles and writes them to disk... then it releases the lock
and returns the requested tile. During that time, the other 5 requests
are sitting idle, waiting for the lock to be released.

Makes sense? The solution is to make sure you make only one call per
metatile.


>  
> 
> So, my question, in an MS4W installation of Apache, Php, and
> MapServer/MapScript, is there some configuration setting I can change to
> allow for the parallelism I’d expect to happen?  Is it Apache that’s
> blocking simultaneous access? Php?  Or MapScript?  Is there anything I
> can do to get simultaneous calls to tile.php to process in parallel?
> 
>  
> 
> Thanks.
> 
>  
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> MS4W-Users mailing list
> MS4W-Users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ms4w-users


-- 
Daniel Morissette
http://www.mapgears.com/


More information about the MS4W-Users mailing list