Comparing speed of Web Map Service with GeoServer on ESRI Shapefile and PostGIS

There are several options how to configure Web Map Service using several map servers. GeoServer is one of most popular map servers nowadays. GeoServer is able to read data from several sources. Very popular data source is ESRI Shapefile. It is well documented and most of software for geodata processing is able to read and write data in this format. Another very popular data store is PostgreSQL/PostGIS object-relational database. Both data sources has advantages and disadvantages and user of GeoServer has to decide which one to use. The paper describes comparison of performance of GeoServer Web Map Service when reading data from ESRI Shapefile or from PostgreSQL/PostGIS database.


Introduction
Size of the spatial data grows every day and their management is more and more complicated.Geographic information systems has moved from file based systems via database manged data to distributed data management.All three possible ways how to manage spatial data are still available and used.There are advantages and disadvantages in a case of all of them.For example is very easy to copy single file (group of files) to another user in comparison to copy whole database or whole distributed system.Or it is very difficult to store large sized data to single file (for example there are limit about 4GB for ESRI Shapefile format [4]).Or it is very difficult to perform some queries on large data on single computer.For example Kepka and Ježek mentioned another disadvantage of PostGIS: "PostgreSQL with PostGIS plays a role of the flagship of Open Source RDBMS but there is just limited possibility of simple and fast queries visualisation" [5].Several advatanges of PostGIS are mentioned for example by Stěhule [12] GeoServer [1] can produce map outputs according to Web Map Service specification [9].Lot of projects are based on ESRI Shapefile format.Lot of projects are based on PostgreSQL/-PostGIS system.The question on which was research based was: "How fast will be GeoServer when serving maps according to WMS if the source of data is PostgreSQL/PostGIS table or ESRI Shapefile?".According to results of Adam Shreier work [11].I expected that GeoServer will be faster when dealing with ESRI Shapefile than with PostgreSQL/PostGIS table.I have discovered that this is not true and results show that there are other aspects that must be considered.I can conclude that running Web Map Service with GeoServer on ESRI Shapefile or PostgreSQL/PostGIS are comparable.

Methods
The data from COSMC (Czech office for surveying, mapping and cadastre) mentioned by Med and Souček in [8] that represents parcels in the Czech republic were used for this research.The services were tested by Horák, Růžička and Ardielli [3].Number of records was about 15 millions and number of vertices was about 200 milions.The ESRI Shapefile files has about 8 GB together (cca 4 GB for geometry (SHP file) and 4 GB for attributes (DBF)).
The data were stored in ESRI Shapefile and in PostgreSQL/PostGIS table.For the ESRI Shapefile was created quad tree index.Shptree tool [7] with default options was used to build index.For PostgreSQL/PostGIS table were created two tables one without spatial index and one with GIST spatial index [6].

Results
Table 2 shows responses of Web Map Service running on GeoServer with different data sources.
There are minimum, maximum and average response times in seconds.The figure 1 shows minimum response time for each configuration.The figure 2 shows maximum response time for each configuration.The figure 3 shows average response time for each configuration.
Table 3 shows number of responses of Web Map Service running on GeoServer with different data sources.The limits were specified 5 and 10 seconds.The figure 4 shows number of responses over 5 seconds in percents.
The figure 5 shows number of responses over 10 seconds in percents.
The figure 6 shows distribution of response time for each type of connection

Conclusion
I can conclude that running Web Map Service with GeoServer on ESRI Shapefile or Post-greSQL/PostGIS are comparable.There are not significant differences in average time of Geoinformatics FCE CTU 15(1), 2016  I can conclude that tuning PostgreSQL could speed up WMS (compare 2.7 s and 2.4 s for average response time or 10 % and 5 % for number of responses over 5 s).
I did not tested any other type of index than GIST for PostgreSQL/PostGIS.It may be done in future.I did not tested any other type of index than quad tree index on ESRI Shapefile and I did not tested any than default options for building both indexes.

Figure 4 :Figure 5 :
Figure 4: Number of responses higher than 5 s

Table 1 :
PostgreSQL/PostGIS table have been prepared.There were three types of WMS for PostGIS table, one for table without index, one for table with index and one for table with index connected via JNDI technology [10].Following software and hardware configuration were used to perform testing.I have eventually tuned Postgrruzicka2.bbl.eSQL and run test on table with index again.Tuning was as described in Table 1.Tuning parameters

Table 2 :
Responses of Web Map Service

Table 3 :
Number of responses over limit