MapServer Performance Tips

Mike Saunt mikesaunt at GMAIL.COM
Tue Aug 7 17:01:51 EDT 2007


Hi Tim

Not sure if this will help but when we implement from other sources (ArcSDE,
Oracle etc) we setup scripts to process the data using ogr2ogr and then
apply shptree etc.  We've found that using org2ogr is really powerful as you
can create new layers based on SQL / Where statements and this could help
with the classifications of the data.

HTH
Mike

On 07/08/07, Gregor Mosheh <gregor at hostgis.com> wrote:
>
> >>  I'm not really sure that I want to move
> >> these separate layers into one with just class definitions because the
> >> legend does display the class definitions only layers
>
> That's not right; it should show them for every class that has a NAME
> element.
>
> Looking at your code sample, I'd have to agree that there are probably
> circumstances where 5 layers using FILTER may be faster than 1 layer
> using 5 classes, and vice versa.
>
> If your data were in PostGIS and the filtering were happening by the
> same column in each case, and that column were indexed and also
> clustered, that'd probably show some excellent performance using the
> filter (keep the filtering in the DB instead of taking it to Mapserver).
>
> If your data is in shapefiles, though, the indexing by criteria isn't
> happening and Mapserver has to do a sequential scan and class-matching
> for every record in the spatial region represented. For each layer. Five
> times. Ouch.
>
> So yeah, if you're sticking with shapefiles I'd agree with the others
> that 1 layer with 5 classes would probably be the best bet. If you're
> willing to put in the work to put it into PostGIS, you could probably
> have 5 layers work very nicely.
>
>
> >> I'm really wondering if this is a hardware issue. The box is
> >> a Sun server with 4 x 400MHz processors and 4GB ram. That might not be
> a
> >> powerful enough machine to do what I'm trying to do.
>
> Should be fine; that's plenty of hardware.
>
>
> > You might want to try shp2img on your mapfile as you edit it, to help
> > make sure your benchmark conditions are consistent between runs.
> > http://mapserver.gis.umn.edu/docs/reference/utilityreference/shp2img
>
> Good move, Hal. I'll take a note of this and add it to the performance
> docs we've been working on.
>
> --
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070807/4f1fe690/attachment.html


More information about the mapserver-users mailing list