Question about raster performance

Ed McNierney ed at TOPOZONE.COM
Wed Feb 7 12:22:05 EST 2007


Steff -

This is a complex question, but there is a good principle to keep in mind.
In the ideal situation, a user map request to MapServer for a tiled raster
layer will result in exactly one tile being opened, and the entire contents
of that file read without resampling.  The closer you can get to that ideal,
the better your performance will be.

You need to evaluate the other tradeoffs/costs of approaching that ideal.
For example, if you offer six different zoom levels to the user, your
performance will be best if you resample your rasters in advance and produce
overviews exactly at each of those zoom levels.  However, that takes time
and it takes disk space, so you may not want to do that.  Remember that most
overviews are pretty small (a 4x overview is 1/16th the original data size,
a 16x overview is 1/256th the original data size, etc.) so it's really only
the 2x and 4x overviews that take up much space.

It is also advisable to combine small-scale overview tiles into larger
tiles, so the tile size remains relatively constant.  It is very easy to
create a 16x overview that - while it is 1/256th the size of the original -
requires 256 times as many files to be read for each request!  It is slower
to read a lot of tiny tiles than a few larger ones.

Opening a new file from disk is the slowest step in the raster rendering
process.  Anything you can do to minimize the number of files opened for a
request will be helpful.  In general, therefore, you should aim for larger
rather than smaller tile sizes; it is faster to jump from one section of a
large file to another than it is to jump from one file to another file.  But
it is faster still to not jump at all!

     - Ed

-- 
Ed McNierney
President and Chief Mapmaker
Maps a la carte, Inc. / TopoZone.com
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: (978) 251-4242
Fax: (978) 251-1396
ed at topozone.com

> From: Stéphane RIFF <stephane.riff at CERENE.FR>
> Reply-To: Stéphane RIFF <stephane.riff at CERENE.FR>
> Date: Tue, 6 Feb 2007 15:53:00 +0100
> To: <MAPSERVER-USERS at LISTS.UMN.EDU>
> Subject: [UMN_MAPSERVER-USERS] Question about raster performance
> 
> Hello,
> 
> I'd like to know if someone has already test the best tile raster size ?
> Does it affect mapserver performance if the tiles are too small or too big ?
> 
> Thanks
> Steff



More information about the mapserver-users mailing list