wiki:PerformanceTesting

Results

Description Parallel Requests Number of request done in 20 seconds
CGI request on state_shp layer with square extents and square maps * 1 297 to 305
WMS request on state_shp layer with square extents and square maps * 1 270 to 280
CGI request on state_shp layer with square extents and square maps with 100 layer in mapfile 1 275 to 280
CGI request on state_shp layer with square extents and square maps with EPSG code in map object * 1 295 to 297
Note that the state_shp layer is a big shapefile (>3,000,000 line features) and is drawn with a 1 pixel black line.

* Used the mapfile below out of the box with the extents below to draw a 500x500 square map with a square extent. I've only tested with one parallel request since I only have one CPU.

** Copied the 3 layers in the mapfile multiple times to get a total of 100 layers. The copied layers were not called like the 3 original ones.

*** Only changed the MAP projection block to be "init=epsg:4326" instead of the projection string.

Plan of Action

  • For the EPSG code performance problem, FrankW is planning to implement some caching directly in PROJ.4. More details to come, but on the PROJ.4 side, not a lot directly in MapServer.
  • With really large shapefiles, some profiling revealed that a lot of time is passed in msGetBit called by either msShapeFileLayerNextShape and msFilterTreeSearch. We acknowledge that the bit mask is not the optimal solution for very large shapefile (>3M features). the only thing we plan to do right now is to pass from a 8bit mask to a 32 bit mask.

Results

CGI request on state_shp EPSG code in map object and with PROJ.4 fix to cache EPSG file 1 297 to 305
CGI request on state_shp with the bitmask fix ticket 2930 1 372 to 378
  • It seems that the PROJ.4 fix removed most of the overhead of using epsg projection definition.
  • ticket 2930 help a lot when reading big shapefiles. In our case, drawing small part of more than 3M features, we got around 20% more speed.

Test machine

Dell Inspiron 6000 laptop

RAM 2GB
CPU Intel Pentium M 1.73Ghz

Tools

MapServer 2008/03/07 trunk version
http_load for load creation
gprof 2.18.93.20081009
GeoServer? performance test data and mapfile (see below for the mapfile)

Width 500x500 Extent:

-97.0+32.65+-96.95+32.7
-97.1+32.5+-97+32.6
-97.06+32.5+-96.96+32.6
-97.07+32.5+-96.97+32.6
-97.09+32.5+-96.99+32.6
-97.1+32.6+-97+32.7
-97.07+32.6+-96.97+32.7
-97.075+32.5+-96.975+32.6
-97.079+32.5+-96.979+32.6
-97.09+32.5+-96.99+32.6
-97.04+32.5+-96.94+32.6
-97.06+32.5+-96.96+32.6
-97.06+32.53+-96.96+32.63
-97.06+32.56+-96.96+32.66
-97.05+32.56+-96.95+32.66
-97.05+32.58+-96.95+32.68
-97.04+32.58+-96.94+32.68
-97.03+32.587+-96.93+32.687
-97.035+32.54+-96.935+32.64
-97.03+32.54+-96.93+32.64
-97.03+32.55+-96.93+32.65
-97.02+32.545+-96.92+32.645
-97.02+32.554+-96.92+32.654
-97.088+32.5+-96.988+32.6
-97.085+32.5+-96.985+32.6
-97.08+32.5+-96.98+32.6
-97.08+32.55+-96.98+32.65
-97.06+32.55+-96.96+32.65
-97.06+32.54+-96.96+32.64
-97.03+32.59+-96.93+32.69

bench.map Mapfile

# Map server benchmark map file
MAP
  IMAGETYPE      PNG
  EXTENT         -180 -90 180 90
  SIZE           400 300
  SHAPEPATH      "./data"
  IMAGECOLOR     255 255 255
  FONTSET        "./fonts/fonts.list"
  
  #PROJECTION
  #  "init=epsg:4326"
      #"proj=longlat"
      #"ellps=WGS84"
      #"datum=WGS84"
  #END
  
  # WMS and WFS metadata
  WEB
    METADATA
      "wms_title"           "WMS Demo Server"
      "wms_onlineresource"  "http://192.168.1.100/~pramsey/cgi-bin/mapserv.fcgi?map=/Users/pramsey/Code/topp-benchmarks/bench.map&"
      "wms_srs"             "EPSG:4326 EPSG:32632"
      "wfs_title"           "WFS Demo Server"
      "wfs_onlineresource"  "http://192.168.1.100/~pramsey/cgi-bin/mapserv.fcgi?map=/Users/pramsey/Code/topp-benchmarks/bench.map&"
      "wfs_srs"             "EPSG:4326"
    END
  END

  # STATE_POLYGONS
  LAYER
    NAME        states
    METADATA
      "wms_title"    "Distribution of population in USA, polygons"
      "wfs_title"    "USA population"
      "gml_featureid" "ID"
      "gml_include_items" "all"
    END
    DATA        states
    TYPE        POLYGON
    LABELITEM   "STATE_ABBR"
    DUMP        TRUE
	
	  # Projection
    #PROJECTION
    #  "proj=longlat"
    #  "ellps=WGS84"
    #  "datum=WGS84"
    #END
    
    CLASS
      NAME 'less than 2M'
      EXPRESSION ([PERSONS] < 2000000)
      STYLE
        COLOR     77 255 77
        OUTLINECOLOR   0 0 0
      END
      
      LABEL
        COLOR 0 0 0
        ANTIALIAS FALSE
        TYPE TRUETYPE
        FONT "TimesNewRoman"
        SIZE 11
        POSITION CC
        PARTIALS FALSE
      END
    END
    
    CLASS
      NAME 'between 2M and 4M'
      EXPRESSION (2000000 <= [PERSONS] AND [PERSONS] < 4000000 )
      STYLE
        COLOR     255 77 77
        OUTLINECOLOR   0 0 0
      END
      
      LABEL
        COLOR 0 0 0
        ANTIALIAS FALSE
        TYPE TRUETYPE
        FONT "TimesNewRoman"
        SIZE 11
        POSITION CC
        PARTIALS FALSE
      END
    END

    CLASS
      NAME 'more than 4M'
      EXPRESSION ([PERSONS] >= 4000000 )
      STYLE
        COLOR     77 77 255
        OUTLINECOLOR   0 0 0
      END
      
      LABEL
        COLOR 0 0 0
        ANTIALIAS FALSE
        TYPE TRUETYPE
        FONT "TimesNewRoman"
        SIZE 11
        POSITION CC
        PARTIALS FALSE
      END
    END
  END
  
  # Tiger texas, postgis, full roads (1M lines)
  LAYER
    NAME        tiger_shp
    METADATA
      "wms_title"    "Tiger lines, Texas, Shapefile"
      "wfs_title"    "Tiger lines, Texas, Shapefile"
      "gml_featureid" "ID"
      "gml_include_items" "all"
      "wms_extent" "-106.64395234549875 25.841083405399676 -93.51951316494875 36.50068992305937"
    END
    DATA tiger_shp
    STATUS      ON
    TYPE        LINE
    #DUMP        TRUE

    # Projection (shared by all layers)
    #PROJECTION
    #"init=epsg:4326"
    #  #"proj=longlat"
    #  #"ellps=WGS84"
    #  #"datum=WGS84"
    #END
    
    CLASS
      STYLE
        COLOR     0 0 0
      END
    END
  END
 
  # Merano TIFF layer (single file, tiled, overviews)
  LAYER 
    NAME         merano2
    DATA         "merano.tiff"
    TYPE         RASTER
    #PROCESSING   "RESAMPLE=AVERAGE"
    #PROCESSING   "RESAMPLE=BILINEAR"
    
    METADATA
      "wms_title"    "Merano TIFF imagery"
      "wms_extent" "663686.6867493344 5171720.999428161 664366.6867493344 5172320.999428161"
    END

    # Projection
    #PROJECTION
    #  "proj=utm"
    #  "zone=32"
    #  "ellps=WGS84"
    #  "datum=WGS84"
    #  "units=m"
    #END
  END

# End of map file
END 

Last modified 13 years ago Last modified on Mar 10, 2009, 8:24:53 AM