Mapserver damn slow

karsten vennemann karsten at TERRAGIS.NET
Sun Jun 17 19:56:11 EDT 2007


> I didn't optimize the postgres db so far.
> Ah, the map looks like this: 
> http://85.199.1.166/tmp/Mozambique118209637430644.png
> Just give me some general ideas what I could optimize further.

Even though this might not do much with such a simple map (few features) but
in general there is one thing that you could do : 
generalize the vector layer (weed out the vertices for the shapefile or
postgis layer) for the districts shown on the map - especially the coast
line is pretty detailed and doesn't need to be at that scale. You could have
two layers (one generalized , one detailed). Using minscale and maxscale for
those layers you can have the general layer drawn in when lokking at the map
as an overview, and the detailed layer turning on when the user zooms in on
the map. That makes also for a better cartographic output at the respective
layer scales.
Here is an example I have in one of the maps for rivers (note that the
layers use the same name but different min/maxscale settings, also the
second layer is a "tiled" shape file that uses an index - which helps the
performance if there is a lot of detail. This however is only important if
there really are a lot of features in a layer, not when using simple layers
like in your map example) 
Karsten

LAYER
	NAME "Rivers and Streams"
	GROUP "Base Layers"
	TYPE LINE
	STATUS DEFAULT
	MAXSCALE 1000000
	MINSCALE 500000
	TOLERANCE 5
	DATA "rivers/rivers_500k"
	CLASSITEM "TYPE"
	CLASS
		NAME "Type 1"
		EXPRESSION "1"
		STYLE
			COLOR 128 170 255
			SYMBOL "point"
			SIZE 1
		END
	END
END

# 50k Tiled Layer
LAYER
	NAME "Rivers and Streams"
	GROUP "Base Layers"
	TYPE LINE

	STATUS DEFAULT
	MAXSCALE 500000
	MINSCALE 350000
	TOLERANCE 5
	TILEINDEX "rivers/wa_rivers_50k/index"
	TILEITEM "PATHNAME"
	CLASSITEM "TYPE"
	CLASS
		NAME "Type 1"
		EXPRESSION "1"
		STYLE
			COLOR 128 170 255
			SYMBOL "point"
			SIZE 1
		END
	END
END



More information about the mapserver-users mailing list