3

I seeded a layer group (of data imported from OpenStreetMaps via osm2pgsql) from levels 0 to 15 (PNG; EPSG:900913), it completed successfully, and now I am seeding again only for levels 16 and 17. I would like to figure out how much disk space is being taken by each zoom level.

All I can see now is the total for the entire layer group -- 46 GB as I write this. Is there a relatively simple way to obtain the usage broken down by zoom level?

3 Answers 3

3

One very crude way would be to find the size of one of you tiles from one of the zoom levels you have already cached. For example one of my cached tiles is 18Kb.

If you then go into your geoserver admin panel and click on the your correct gridset you are using (maybe the EPSG:900913 one) you will see a list of zoom levels and the number of tiles.

enter image description here

So if you are doing levels 16 and 17, you could work it out by doing

65,536 x 65,536 x 18Kb = 77309411328kb

Which I think is 73728Gb or 77Tb

Don't forget this is for a global cache so you will need to do the similar routine for your own gridset.

2

If you have access to the file system of your caching server then you could just look at it there. Just navigate to {path}/{to}/Geoserver_Data_Dir/gwc/{layer_name} and you should see a bunch of folders relating to each zoom level and projection e.g. EPSG_900913_18.

You could then just see what the total file size of each folder is. If you wanted to predict how big your next level would be you could dig into one of these folders (each folder has a number of subfolders depending on the region covered) and find a single tile, see what size it is and then use what @tjmgis suggested. Remeber that depending on what format/compression options you are using the tile sizes could be different, for example we use JPEGs for basemaps and aerial photography with compression, this results in some tiles being as small as 2kb (normally just blank ones) and some being up to 60kb. It'll depend entirely on your configuration, but its worth checking before trying any real maths on it, as this might skew it a bit!

0

The OSM Wiki has a page about tile disk usage which contains some nice statistics (from 2012). According to it, the average tile size is only 633 bytes. Additionally, as the zoom level increases, the number of viewed tiles significantly decreases. On average, only 1.79% of the tiles are actually viewed and for the highest zoom level this number falls even down to 0.90%.

As a consequence not only the tile size matters, but also the ratio of actually viewed tiles per zoom level.

Note that the average tile size also depends on the used style sheet and will slowly become larger over time as the amount of contributed data increases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.