[ka-Map-users] Some thoughts/questions about tile.php

Stephen Woodbridge woodbri at swoodbridge.com
Fri Jul 14 09:36:51 EDT 2006


Daniel Morissette wrote:
> Stephen Woodbridge wrote:
>>
>> It seems like it would be faster to avoid this locking, ie: if the 
>> file exists just serve it. If image creation were written to a tmp 
>> file name and renamed to the actual tile name when the write was done 
>> and the file closed, this would be atomic and should avoid the problem 
>> that the code above is dealing with.
>>
> 
> I like the idea, but what you propose would leave a possibility of 
> multiple hits generating the same metatile in parallel since the 
> metatile folder would not exist until the metatile has been completely 
> created.
> 
> I think what may work would be:
> 
> 10 If the tile exists then serve it
> 20 If the tile doesn't exist then use the current locking mechanism to 
> create the metatile and split in tiles, with the difference that the 
> tiles are created using temp filenames (or in a sub-directory) and moved 
> at the end of the creation process to prevent partial tiles from being 
> served
> 30 GOTO 10

Yes, this is want I meant to say, I just left out the part about 
generating the tiles with the existing locking mechanisms

>>
>> Second issue is that directory structure is pretty flat as Paul has 
>> mentioned in the past. I was thinking that a very trivial change would 
>> be to split the directories tnnnnn-lnnnnnn into tnnnnn/lnnnnnn which 
>> would significantly reduce the number of entries in any given directory.
>>
> 
> I like this idea too.

Thanks, I think this will speed things up slightly and it is really a 
trivial change unless you already have a TB of cached tiles :)

-Steve

> 
> Daniel



More information about the ka-Map-users mailing list