[Tilecache] tilecache_clean.py cleaning more than expected?
Christopher Schmidt
crschmidt at metacarta.com
Mon Jun 22 17:35:01 EDT 2009
On Mon, Jun 22, 2009 at 10:03:44PM +0100, Nelson Correia wrote:
> Hi all,
>
> I?m trying to keep my disk usage to about 500MB, but apparently
> tilecache_clean is freeing more space than what I?ve requested:
>
> # du -s -h /data/TILES
> 782M /data/TILES
>
> # python /apps/tilecache2.10/tilecache_clean.py -s 500 /data/TILES
> Cache entries found: 13040
> Removed 12644 files.
>
> # du -s -h /data/TILES
> 73M /data/TILES
>
> Anyone knows why is this happening?
So, currently the size determination is based on st_blocks * st_blksize.
In other words, it attempts to be about how much disk space is actually
used up on disk, rather than how much the total of the tiles is.
My understanding of 'du' is that it counts bytes, not blocks. as a
result, that 73MB you have, with each tile being 600bytes because 90% of
them are empty, acctually takes up a lot more space on disk.
So, this is tilecache_clean trying to be smarter than du, and speak to
actual disk usage.
That's my understanding anyway; iirc, Schuyler kinda hacked that
together, and might have more comments.
If you really care about disk size, you might just consider using the
memcached store: it'll be slightly slower, but it has built in LRU.
Regards,
--
Christopher Schmidt
MetaCarta
More information about the Tilecache
mailing list