comparing the performance of open source web map...

27
Comparing the Performance of Open Source Web Map Servers Andrea Aime - OpenGeo Justin Deoliveira - OpenGeo

Upload: nguyenmien

Post on 25-Sep-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

Comparing the Performance of Open Source Web Map ServersAndrea Aime - OpenGeoJustin Deoliveira - OpenGeo

Page 2: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

• Test enviroment and setup• WMS tests

– vector data (plain and thematic maps)– raster data

• Tile cache tests• WFS tests

Outline

Page 3: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

Test objectives• Find out the best performing configurations

(setup matters!) and making sure the servers are doing the same job

• Assess performance levels on various common tasks not tested at the FOSS4G 2007 performance comparison:– thematic maps– raster data– tile caching– WFS

• Provide feedback to the respective developer and user communities

Page 4: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

Test enviroment

Test client

JMeter2.3.2

Test server

Apache 2MapServer 5.2

TileCache

Java 6 / Tomcat 6GeoServer 1.7GeoWebCache

PostGIS

Shapefile

GeoTiff

MrSID

Dual core 2.1Ghz, 3GB RAM, Ubuntu 8.10

100Mbit network

Page 5: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

Test methodology• Scale up: 1, 10, 20, 40 client threads• Tests are repeated multiple times (cold testing

does not make sense with Java servers, JIT needs time)

• Make sure the network is not playing the bottleneck (100MBit being a bottleneck? yeah! The theoretical max speed is “only” 12.5MByte/s you know?)

• Compare result quality, not just times – this actually uncovered bugs/potential for

improvement in both servers

Page 6: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

Setting up MapServer 5.2• Rebuild from sources:

– to enable fastcgi*– to get MrSID support in GDAL and use the same

GDAL version as GeoServer (GDAL 1.4.2)• Move used EPSG codes at the top of the Proj /

usr/share/proj/epsg file (this is crucial to get best performance)

• Use server based fastcgi, 20 mapserver processes always ready to serve requests, each one holding a single database connection (dynamic fastcgi did not work)

*: very important to get good performance against PostGIS, a 3x speedup factor was measured

Page 7: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

Setting up GeoServer 1.7• Install Sun Java 6, JAI, JAI Image I/O, and

ImageIO-Ext native extensions• Install latest Tomcat release• Disable gzip compression filters (useful on a real

internet connection, but not in a local network case)

• Make sure exactly 20 threads answers requests, and that exactly 20 dbms connections are used, to match MapServer setup

• No Java VM tweaking needed, the machine is recognized as server class, the VM self tunes in this case (Linux is marked as a server OS, dual core, has more than 2GB RAM)

Page 8: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

Test #1: PostgGIS vs Shapefiles• 3 million roads in Texas• Each test paints 1000 roads using a small bbox

(512x512 tiles), minimal styling, no antialiasing

data preview

Page 9: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

1 10 20 400

100

200

300

400

500

600

700

800

900

1000

48

146

371

820

2859

178

465

MapServer Pg GeoServer Pg

1 10 20 400

100

200

300

400

500

600

700

800

900

1000

27 51

150

383

25

103

268

568

MapServer Shp GeoServer Shp

#1: Performance results• Response time

vs concurrent requests growing from 1 to 40

• A similar test was run one year go, compared to it:– MapServer

improved shapefile a lot

– GeoServer improved both

ShapefileShapefile

PostGISPostGIS

Page 10: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#1: Test output samples

GeoServer (7.8 KB) MapServer (9 KB)

• No significant differences in output quality

Page 11: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#2: Thematic map• A USA thematic map, classified by population,

with labels• 8 256x256 tiles, mimickying OpenLayers

requests

Page 12: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

1 10 20 400

50

100

150

200

250

300

350

400

450

500

22

66

168

380

22

85

185

438

MapServer GeoServer

Number concurrent requests

Res

pons

e tim

e in

milli

seco

nds

1 10 20 400

50

100

150

200

250

300

350

400

450

15 1446

165

10 11

48

144

MapServer GeoServer

Number concurrent requests

Res

pons

e tim

e in

ms

#2: Performance results

Non antialiasedNon antialiased

AntialiasedAntialiased

• Antialiasing comes with a high cost, both CPU and size wise (see next slides)

• Might be a good idea to turn it off in resource constrained environments (network/cpu)

Page 13: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#2: Test outputs (non aa)

• Linework and filling area basically identical

• MapServer could use some more attention labelling (being worked on, the fix will be released in MapServer 5.4)

• Both images are very small, MapServer shows better compression rate

GeoServer (3.3 KB)

MapServer (2 KB)

Page 14: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#2: Test output (antialiased)

• GeoServer lines too thin for 1 pixel width (being worked on, fix will be released in version 1.7.1)

• GeoServer shows better compression ratio on antialiased data

• No matter what server is being considered, the output size is 4-6 times larger than non antialiased caseMapServer (13 KB)

GeoServer (9.6 KB)

Page 15: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#3: Single GeoTIFF• A single GeoTIFF file, 6800x6000:

– Tiled, embedded overviews• Extracting 256x256 tiles, using 1300+ different

bboxes to make sure there is no caching

Page 16: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#3: performance results

1 10 20 400

200

400

600

800

1000

1200

1400

1600

1800

116

470

961

1718

35

216

449

768

MapServer GeoServer

Number concurrent requests

Res

pons

e tim

e in

ms

1 10 20 400

200

400

600

800

1000

1200

1400

1600

1800

32156

339

659

19114

258

486

MapServer GeoServer

Number concurrent requests

Res

pons

e tim

e in

ms

Non compressedNon compressed(164MB)(164MB)

JPEG compressedJPEG compressed(52MB)(52MB)

• JPEG compressing tiles reduces space consumption by 3 times

• But, it slows down decoding visibly (much more so for MapServer)

Page 17: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#4: MrSID data• Landsat, 47637x39167, 206MB, covering the

southern part of South Africa• https://zulu.ssc.nasa.gov/mrsid/ • Both servers using MrSID SDK 3.3 and GDAL • Extracting 256x256 tiles, jpeg compressed,

using 1300+ different bboxes to make sure there is no caching

Page 18: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#4: a look at the data

Page 19: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#4: performance results

1 10 20 400

500

1000

1500

2000

2500

3000

3500

4000

4500

206

1075

2134

4193

111

591

1202

2464

MapServer GeoServer

Number concurrent requests

Res

pons

e tim

e in

ms

• HP: MapServer is opening the MrSID file for each request, GeoServer is keeping it open (opening and reading MrSID metadata is expensive)

Page 20: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#5: Tile caches• Testing

– TileCache 2.04 + mod_python– GeoWebCache 1.0-beta0

• Same backend, GeoServer 1.7.0, WMS requests

• Dataset: the MrSid file of the previous test• Tiles reprojected to WGS84 (jpeg encoding)• Tile caches are pre-seeded

TileCache

GeoWebCacheGeoServerJMeter

Page 21: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#5: a look at the data

Page 22: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#5: performance results

1 10 20 400

5

10

15

20

25

30

35

40

4 5 6

37

5 5 6

37

TileCache GeoWebCache

Number of requests per second

Res

pons

e tim

e in

ms

• Virtually identical results, 450+ tiles per second

• The 100MBit connection is saturated, running the test direclty on the server delivers a throughput of over 17MB/s

1 10 20 400

2000

4000

6000

8000

10000

12000

4,550 4,574

8,716

10,629

4,0254,640

8,558

10,605

TileCache GeoWebCache

Number of concurrent requests

KB

/s

Page 23: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#5: quantifying the tile caching gain

• Made the same requests against MapServer and GeoServer un-cached

• In this case, the benefit is around 100 times• The gain won't be as much if you consider

simple vector rendering

1 10 20 400

1000

2000

3000

4000

5000

6000

4 5 6 375 5 6 37344

1178

2394

4982

133

669

1409

2844

TileCache GeoWebCache MapServer GeoServer

Number of concurrent requests

Ave

rage

resp

onse

tim

e

Page 24: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

#6: WFS requests• WFS requests with BBOX filtering• Using the same tiles and data as the

thematic map benchmark• Shapefile and PostGIS backends• WFS 1.0 and WFS 1.1 GetFeature

Page 25: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

1 10 20 40-100

100

300

500

700

900

1100

47

220

478

1020

49

207

504

1055

19 52131

311

29115

257

592

MapServer GML2 MapServer GML3 GeoServer GML2 GeoServer GML3

Number of concurrent requests

Res

pons

e tim

e in

ms

1 10 20 40-100

100

300

500

700

900

1100

16 3183

201

11 2985

204

20 51140

289

27105

236

588

MapServer GML2 MapServer GML3 GeoServer GML2 GeoServer GML3

Number of concurrent requests

Res

pons

e tim

e in

ms

#6: performance resultsShapefileShapefile

PostGISPostGIS

• MapServer is very fast with shapefiles, not as much with PostGIS

• GeoServer GML3 output could use some work

Page 26: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

Summary• Both servers are very fast (most of the test

deliver more than 50 responses per second... on a notebook!)

• But proper configuration is crucial to get good results

• As we have seen, both server can still work to get better, as the relative differences in results do show

Page 27: Comparing the Performance of Open Source Web Map …presentations.opengeo.org/2008_FOSS4G/WebMapServerPerformance … · Comparing the Performance of Open Source Web Map Servers Andrea

QUESTIONS?