[mapserver-users] Using Fast CGI with MapServer toalleviatepoorperformance [SOLVED]

John Westwood John.Westwood at port.ac.uk
Sat Sep 20 09:06:36 EDT 2008


Hi Everybody,

Thanks to all your suggestions, I have solved the performance problem. It was a combination of two things: rendering in 24bit and MapServer reprojecting on the fly when I didn't want it to.

I modified my OUTPUTFORMAT block to be: 

OUTPUTFORMAT
   NAME "png"
   DRIVER AGG/PNG
   IMAGEMODE RGB
   MIMETYPE "image/png"
   EXTENSION "png"
   FORMATOPTION "QUANTIZE_FORCE=ON"
   FORMATOPTION "QUANTIZE_DITHER=OFF"
   FORMATOPTION "QUANTIZE_COLORS=256"
END

I tested the time taken for the Quantize method for WMS and MapServer layers at a specific test location:

                         QUANTIZE      NO QUANTIZE    GD/PNG PC256
WMS                   17.44s              28.93s                 17.10s
MapServer         10.55s              26.41s                   8.91s


GD/PNG PC256 is the fastest, but this gives incorrect colours.

Next, i changed the projection string to the epsg code (as suggested by Guillaume):

PROJECTION
   "init=epsg:3034"
END

                         QUANTIZE, with epsg code
WMS                           ~10.5s
MapServer                 ~10.5s


The ironic thing is that I used the projection string instead of the epsg code so I could avoid the lookup so it would be faster! I do not understand why MapServer does an unnecessary reprojection with OpenLayers.WMS and the projection string; shouldn't it be able to determine that the projection string is the same as the epsg number? I guess, that would probably involve a lookup, thus rendering the use of the projection string in place of the epsg code ineffectual.

Thanks again for all the help, it would have taken me much longer to solve the problem on my own!

Regards

John Westwood

Great Britain Historical GIS Project


More information about the mapserver-users mailing list