MapServer Performance Tips

Fawcett, David David.Fawcett at STATE.MN.US
Tue Aug 7 11:08:00 PDT 2007


Minimizing processing at runtime can only help.  

If you have the disk space and your data is static, you could pre-create
different layers based on your expression criteria, so that your data
doesn't have to be evaluated in five different layers.  

I don't know if it is still true, but regular expressions used to be
faster than logical expressions, so you could add another column,
pre-classify your data and store a class value in that column, something
like a single-digit integer from 1-5.  That might evaluate faster than a
complex logical expression.

David.

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Gregor Mosheh
Sent: Tuesday, August 07, 2007 12:33 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] MapServer Performance Tips


> 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)

-- 
Gregor Mosheh / Greg Allensworth
System Administrator, HostGIS cartographic development & hosting
services http://www.HostGIS.com/

"Remember that no one cares if you can back up,
  only if you can restore." - AMANDA



More information about the MapServer-users mailing list