[OpenLayers-Dev] Better caching of tiles when using multiple servers

Paul Spencer pspencer at dmsolutions.ca
Thu Jun 26 10:55:07 EDT 2008


Stephen,

openlayers already does what you are proposing.  I believe the problem  
is that you are probably using metatiles and the same set of tiles  
will be created on every server regardless of which tiles are actually  
getting used.  The same problem exists for tilecache if you use  
metatiles.

A useful enhancement would allow for specifying the metatile size of a  
layer when constructing it and modifying the algorithm that selects a  
URL for a tile to predictively select the same server for all tiles in  
a metatile.  Chris suggested this to me before when I asked about it  
but I haven't had time to do it.

Cheers

Paul

On 26-Jun-08, at 11:37 AM, Stephen Woodbridge wrote:

> Hi all,
>
> I wanted to float an idea that I think might give better tile caching
> results when using multiple tile servers.
>
> An observation. We set up a ka-map style cache that is precached. We
> added 4 servers to the layer definition and it appeared that any given
> tile might get served from any of the servers. IE: there is the
> potential for the tile being cached 4 times, once from each server,
> because the host assignment I think is done on a rotating basis. We
> found the two servers seemed to be subjectively faster (I'm not sure  
> if
> the tester flushed the cache between tests).
>
> Assuming the observations and assumptions are correct, the  
> optimization
> idea would be to do something simple to ensure that a given tile is
> always requested from the same server so once we have it and its  
> cached
> in the browser we never request it from a different server.
>
> One idea for doing this would be to change the rotating host  
> assignment
> to an algorithm like:
>
>   host_index = checksum(url_less_host) % num_hosts;
>
> where checksum() is a simple checksum of the url string.
>
>
> Sorry no patch, and I haven't even read the code that does the current
> assign.
>
> Would this idea be worth pursuing?
>
> -Steve W
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://www.dmsolutions.ca/




More information about the Dev mailing list