MapServer Performance Tips

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Aug 7 14:08:06 EDT 2007


Gregor Mosheh wrote:
>> I'm not sure if having those as shapefiles is best and what else I
>> should do to improve those
> 
> Shapefile is a pretty fast format. Hard to beat.
> 
> 
>> about 75+ shapefiles that I've brought together as one layer using a tile
>> index. Also, I'm needing to break up the combined layer into 5 layers 
>> using
>> expressions. The size of each shapefile is between a few MB and up around
>> 100MB.
> 
> Doesn't sound like a major problem. We deal with stuff on that order all 
> the time and get good performance. Of course, 8 CPUs and a boatload of 
> RAM help.
> 
> Did you shptree all of the shapefiles, including the tileindex? That can 
> help a lot. There's also "sortshp" which physically sorts the file so 
> that seeks aren't as random. (I should add that to the page.)
> 
> Beyond that, it's hard to give any specific advice without any specific 
> details. Are you experiencing a problem with speed, or just looking to 
> make fast even faster? Is a specific layer being problematic? Could you 
> perhaps make the expressions more efficient, maybe merge some layers 
> together using expressions? (you had said that you broke it into layers 
> by expression, thought I'd ask)
> 
If the data is really in 5 separate layers, splitting the data into 
those 5 layers would greatly help. You can also FILTER the data for the 
LAYER which will help some but not as much as splitting the data.

You can load and dump the shapefiles into postGIS or Oracle and filter 
the data when you dump it to be only that what you need for the specific 
layers. Its a little work up front byt will help with performance. Or 
you can write a mapscript routine to read, filter and write new shape 
files for the layers you need.

-Steve W



More information about the mapserver-users mailing list