Building an Elastic Parallel Ogc Web Processing Service on a Cloud-based Cluster: a Case Study of Remote Sensing Data Processing Service

Since the Open Geospatial Consortium (OGC) proposed the geospatial Web Processing Service (WPS), standard OGC Web Service (OWS)-based geospatial processing has become the major type of distributed geospatial application. However, improving the performance and sustainability of the distributed geospatial applications has become the dominant challenge for OWSs. This paper presents the construction of an elastic parallel OGC WPS service on a cloud-based cluster and the designs of a high-performance, cloud-based WPS service architecture, the scalability scheme of the cloud, and the algorithm of the elastic parallel geoprocessing. Experiments of the remote sensing data processing service demonstrate that our proposed method can provide a higher-performance WPS service 14246 that uses less computing resources. Our proposed method can also help institutions reduce hardware costs, raise the rate of hardware usage, and conserve energy, which is important in building green and sustainable geospatial services or applications.


Introduction
The implementation of the OGC Web Services (OWS) has promoted the sharing and interoperability of geospatial data.Many applications have been built based on the OWS.The geospatial Web processing service (WPS) is used to implement web-based geoprocessing.However, in practical applications, the WPS defines an interface, which facilitates the publishing and discovery of geospatial processes.Numerous geospatial Web services are built on OWS, such as the Web services available on GeoBrain [1].WPS services have also been used in the geospatial service chain or aggregation, which can chain the existing distributed OWS services into a composite service or workflow to complete a complex geospatial task [2][3][4][5].The majority of research on OWS-based distributed geospatial processing has focused on seamless data sharing, interoperability, and service chaining.With the increasing use of geospatial applications and the expanding volume of geospatial data, performance issues of the OWS service have attracted considerable attention in recent studies [6,7].However, constructing a high-performance WPS on a physical cluster via parallel computing technology means that the WPS will occupy the entire cluster.To fulfill the WPS request, resources are required for the peak workload, but the resources are idle at non-peak times.More pronounced variations result in more waste [8].For a provider of geospatial services, purchasing a computer cluster for a single purpose and wasting considerable energy during the non-peak period is a significant burden.This paper proposes a cloud-based elastic WPS service that can provide a high-performance geospatial WPS on a cloud and also helps to reduce hardware costs and energy usage.

Geospatial Processing Service
Geospatial processing on local machines has played a significant role in traditional GIS applications before 2000 [9][10][11].With the development and wide application of Internet technology, Internet GIS and Web GIS have become the main forms of GIS applications in the early years of the 21st century [12][13][14].Since it is easy to use and can be widely accessed over the Internet, Internet GIS, and Web GIS offered a useful distributed work environment that is easy for the public to access.Since OGC released the Web Processing Service 1.0 (WPS 1.0) in 2007, OWS has been used widely in SOA-based geospatial applications.Many studies based on the OGC WPS have been conducted [15,16].NASA, USGS, and the USDA have built a series of SOA-based applications for EOS data sharing and remote sensing analysis [17,18].For the outstanding characters of the Web service, SOA-based distributed geospatial processing has become a major method of distributed geospatial processing [19,20].WPS has also been explored to construct the geospatial service chain (or service aggregation) [3][4][5], which aggregates the atomic service into a composite service to solve more complex issues.The geospatial workflow is executed sequentially via OGC OWS and includes a geospatial WPS service [21].

Parallel Computing
Parallel computing has had a significant impact on many areas, such as physics [22], biology [23], meteorology, and global climate studies [7,24].Parallel computing divides a task into multiple sub-tasks that can be executed within a number of processes upon several processors [25]; in this manner, large problems can be solved efficiently by using massively parallel processor (MPP) systems [26].Parallel computing technologies have been recommended in the geosciences.Various techniques for the high-performance parallel processing and analysis of remote sensing data and geospatial datasets based on clusters have been proposed [27][28][29].Geospatial applications based on parallel computing have also been designed and implemented [25,30].Parallel algorithms based on GPUs have also received considerable attention as GPUs are more efficient than CPUs [31].GPU-based parallel computing techniques have been widely applied in the geosciences to improve the performance of spatial data processing and can obtain much better efficiency than CPU-based methods because of the massively parallel programmable units at their cores [32][33][34].Parallel computing techniques have been predicted to become the dominant geocomputation techniques in the near future [35].

Cloud Computing
Cloud computing has had a significant impact on computer science and other domains.Cloud computing stems from grid computing, distributed computing, and hardware visualization technology.In cloud, the infrastructure can act as a service (Iaas) [36,37], the platform can act as a service (PAAS) [38], and the software can act as service (SAAS) [39,40].For the scalability and pay-as-you-go model of cloud computing, countries and many companies have decided to transfer the traditional system onto clouds, such as AWS, Google Cloud, and Microsoft Azure.The new features of cloud computing allow governments and commercial groups to reduce the amount of hardware invested and save energy.Cloud computing can reduce company investments at the start of a business and can also reduce wasted CPU time when the number of concurrent requests is dynamically changed [8].Cloud computing has been utilized to optimize the performance, reliability, and usability of computing tasks [41,42] and to solve the existing geoscience challenges.Yang [43] reported the utilization of cloud computing to support the intensities of geospatial sciences.Research projects and applications have also demonstrated that cloud-based geospatial applications and services can obtain high performance and better intelligence by utilizing the scalability and virtualization capacity of clouds [7,40,44].Currently, research on geospatial-oriented cloud computing is a topic of considerable interest, and cloud computing is expected to play a greater role in the geoscience field.

Logical Architecture
To achieve a better performance in elastic computing, infrastructure is designed to have five tiers, as shown in Figure 1.The base tier is the hardware and network, which includes clusters, storage, and network equipment.They all support elastic utilization under the control of the cloud service tier.
The second tier is the cloud service.It is the management infrastructure of the environment.The cloud will dynamically manage these resources by the IaaS service.This tier is fundamental to elastic geoprocessing and can offer the needed virtual machines (VM), storage, load balance, and elastic control service to support the geoprocessing.
The geoprocessing tier aims at parallel geoprocessing task execution.This tier offers various cloud services, including task schedules, spatial data management, and parallel geoprocessing.By using the cloud services offered by the cloud services tier, this tier can complete the task with high efficiency and excellent elastic performance.
The geospatial service tier is the container of the published OGC geospatial services.It includes the spatial data services, such as WFS, WCS, WMS, and WMTS, as well as WPS.This tier can offer basic services for the application tier.
The top tier is the application tier.All of the geospatial applications will be built in this tier by using or aggregating the geospatial services.It is the interactive interface between the user and the spatial information services.

Scalability Scheme for Parallel Geoprocessing
The purpose of scalability research is to maximize the performance and reduce the costs.With this scheme, one can automatically extend or shrink the cloud scale by increasing or decreasing the number of the specific VMs during the execution of the WPS service.As shown in Figure 2, there are three types of VMs: the OGC services interface VMs, geoprocessing VMs, and spatial data VMs.Each VM works for a specific purpose: the OGC services interface VMs accept the WPS service request, the geoprocessing VMs conduct the elastic parallel geoprocessing, and the spatial data VMs manage the spatial data.If the geoprocessing tasks are beyond the capacity of the cluster, the new VMs will be launched, but if the resources needed by the tasks are less than the capacity, the VMs will be terminated to shrink the cluster scale.Specifically, the geoprocessing VMs and spatial data VMs follow the following rules: (1) Cluster extension condition: There are jobs that are delayed to execute for more than 3 min.(2) Cluster shrinkage condition: No Jobs are delayed to execute for less than 2 min.(3) Cluster stable condition: The jobs must be delayed to execute for more than 2 min and less than 3 min.
The geoprocessing service vendor can change the conditions of the rules according to how rapidly the vendor wants to offer a service.For example, the vendor may set the cluster extension condition to "no jobs are delayed to execute" to offer the users high-performance services.
For the timing policy and charging rules of the cloud platform (e.g., EC2), a running VM with a duration of less than one hour will be charged for one hour; thus, it is recommended to stop the VMs that are close to passing a whole hour in duration.
The jobs are submitted to the cluster via the Portable Batch System (PBS).The sub-tasks of the jobs will be scheduled to the VMs that have resources for the computation.During the processing of the remote sensing data, the task will decompose to some sub-tasks with the same area.The sub-tasks will be executed in the separated threads, and the result will be collected through MPI messages.
The VMs in the cloud cluster environment, such as EC2, Eucalyptus, and Openstack, are created from the prepared images.VMs will be created by a command when a larger capacity is required.An excessive number of VMs will have a high cost according to the charging rules of the cloud computing service vendor.Accordingly, some VMs will need to be stopped according to the rule stated above if the overhead of the cloud cluster declines below a pre-determined value.When new VMs are created, the sub-tasks will be assigned to the original VMs and the newly created VMs.When the cluster is going to shrink, the new geoprocessing tasks will not be assigned to the VMs that have the fewest tasks, and the VM will stop when no more tasks exist.The other VMs will be stopped in this manner until the cluster fulfills the stable condition.

Algorithm of the Elastic Parallel WPS Service
This study proposes and designs the Elastic parallel WPS service algorithm, as shown in Figure 3.The algorithm contains nine steps.
Step 1: The cloud and OGC WPS environment is initiated; Step 2: OGC WPS receives a request from a client; Step 3: OGC WPS acquires the parameters from the request and validates them.If problems with the parameters exist, the WPS will return an error message; Step 4: Based on the parameters that are received, the master will determine the extent of the task and then execute the task decomposition; Step 5: The job will be submitted to the cloud-based cluster via the PBS; Step 6: Each worker receives the sub-tasks, retrieves the raster data in its extents from the data tier VMs, and calculates the tiles within its extents.In this step, the data will be transferred to the workers concurrently by the multi-thread method.Except for the first round, waiting for the required data is unnecessary; Step 7: The master gathers all the result data from all the workers and places the data into a queue.
The master then writes the result data values into the raster file.For better performance, the non-blocking communication method is used such that workers can continuously perform computations; Step 8: If all rounds are completed, the algorithm will go to step 9; otherwise, the algorithm returns to step 5; Step 9: After all the rounds are completed, all the VMs de-allocate the used memory.
From Steps 5 to 8, the iteration will not break until all the rounds are completed.The cloud-rescaling iteration, provided below, is also followed: Step a: The cloud-watching node collects the status information of the submitted jobs via PBS commands; Step b: The status data are evaluated.If the status reaches the threshold, the algorithm goes to step c; otherwise, it returns to step a; Step c: The cloud-watching node will launch new VMs or terminate existing VMs according to the scalability scheme rules in Section 3.2; then, the algorithm returns to step a.
Step 2: OGC WPS Requested Step 3: Acquire the relevant parameters, validate their correctness.
Step 4: According to the parameters, Masters figure out the extent of the task, and execute the task decomposition.
Step 5: Submit the job to cluster via PBS Step b: Evaluate the status of the cloud Step 1: Environment Initialiation Step a: Collect status information of the jobs Step c: Launch new Clusters or terminate existed Clusters Touch the Threshold?Y N Step 6: Each worker receives the subtasks and retrieves the raster data in its extent from the data tier instances ,and calculates the tiles of its extent Step 9: Deallocate memory in each worker

Cloud rescaling Iteration
Step 8: Have All Rounds done?
Step 7: Master gathers all result values of a round from all the workers and push into a queue, the master writes this result tile values into the raster file concurrently

Prototype Implementation and Analysis of the Results
To illustrate the feasibility and advantages of the proposed elastic parallel WPS service, we build a prototype system that offers an elastic parallel remote sensing data-processing WPS service.The prototype system is built on a private Openstack cloud platform.Up to 60 VMs can be launched dynamically.Each VM has two 2.0 GHz virtual CPUs (vCPU), 4 GB of RAM and a 1 TB disk.WPS services are deployed on the cloud image, which can create VMs via Openstack commands.The WPS service calculates the Vegetation Condition Index (VCI) result data by using the Terra satellite's NDVI 10-day synthetic product with 1 km resolution in China from 2001 to 2010.Openlayer is used to display the VCI analysis result data and original NDVI data, as shown in Figure 4. To demonstrate that the proposed method can greatly improve the performance and feasibility of the cloud-based parallel WPS service, comparisons were conducted between four different WPS services: (1) Approach 1: traditional serial WPS on a single physical machine, which has a 2.0 GHz CPU, 64 GB of RAM, and a 10-TB Raid0 disk array; (2) Approach 2: load-balanced serial WPS on physical machines, where each machine is the same as that in Approach 1; (3) Approach 3: parallel WPS service on a physical cluster, which consists of the 4 machines from Approaches 1 and 2 and is connected to a 1000 Mbps network; and (4) Approach 4: cloud-based elastic parallel WPS, where an Openstack cloud is built upon the machines from Approaches 2 and 3 and each VM has 2 2.0 GHz vCPUs, 4 GB of RAM and a 1 TB disk.
Figure 5 shows the test results and execution time for the four approaches when there are different numbers of requests.The results indicate that the proposed method (i.e., Approach 4) outperforms Approach 1.The execution time for Approach 1 increases dramatically with the number of concurrent requests, whereas the performance of the proposed method remains fairly stable.For example, the execution time for Approach 1 increases from several seconds to 3000 s when the number of requests increases from one to 80.In contrast, the execution time for our proposed method only increases from several seconds to approximately 300 s.Furthermore, although there are an increasing number of concurrent requests, the elastic parallel WPS can maintain a stable performance, which benefits from the scalability property of the cloud.The proposed method is also better than the load-balanced serial WPS service (i.e., Approach 2) with the same hardware configurations because of the superiority of the parallel computing, which indicates that the cloud-based elastic parallel WPS is a superior method when facing a large number of concurrent requests.The proposed method and the parallel method on the physical machine (i.e., Approach 3) display similar performances, but the performance of Approach 3 is slightly better than with the proposed method because Approach 3 runs directly on the physical machines, whereas our proposed method runs on VMs of the cloud.Figure 6 shows the resources that are occupied by the four methods.If Approach 1 only runs on a single server, it has a poor performance.If more than 20 concurrent requests are made, the requests must be processed sequentially; otherwise, the system would crash.With Approach 1, the system takes more than 3000 s to finish all the processing tasks when 80 concurrent requests are made; thus, the load-balanced method (i.e., Approach 2) has been widely used in real applications.Approach 2 can schedule the concurrent requests to multiple servers to keep the load balanced and obtain better performance compared to Approach 1.However, with Approach 2, the service vendor must purchase a sufficient number of machines in advance to fulfill the resource requirement for the maximum amount of requests.For example, in this test, we assume that there is a maximum of 80 concurrent requests to give the users an acceptable experience (e.g., no more than 10 min); we must provide four servers with 24 cores, and the servers must configure the same system and software environment.Thus, the servers are occupied by the application exclusively.When adopting Approach 3, we can speed up the execution time to half that of Approach 2 by making use of the capacity of parallel computing, but because Approach 2 requires all the physical nodes in the cluster to be configured with same software, it still occupies the resources exclusively.With Approach 4, the cloud platform can launch new VMs dynamically according to the number of concurrent requests; thus, when there are only a few concurrent requests (e.g., less than 20 or 40), the idle resources can be used by other applications by launching new VMs with the required system and software environment.As a result, Approach 4 can obtain similar performance to Approach 3 by occupying less computing resources.Moreover, if public cloud services are used, the WPS service vendor can purchase the cloud resources in a "pay-as-you-go" model and hence reduce the investment in computing resources [43].In conclusion, the cloud-based elastic parallel WPS service can not only improve the performance but also share the computing resources with other applications and reduce the hardware investment, which is a key factor for many research institutions and researchers.Furthermore, the physical machines of the idle cloud computing resources can be powered off to save energy; hence, our proposed method can provide more sustainable and green WPS services and geospatial applications by exploring the capability of cloud computing.

Conclusions
We proposed a cloud-based elastic parallel computing method to obtain high-performance WPS services while using fewer computing resources.Experiments on a remote sensing data processing prototype system demonstrated the feasibility and efficiency of the proposed method.Given the scalability capacities of cloud computing, this method can provide a more efficient WPS service.Scalability is also beneficial for research institutions, particularly small research organizations and individual researchers, because it helps reduce hardware costs, which is often a burden for research activities.Furthermore, this method can also provide a WPS service with excellent performance by utilizing the virtualization and elasticity capacity of the IaaS service of cloud computing, even for a large number of concurrent requests.The WPS does not occupy all the computing resources, and when the number of concurrent requests is less than the maximum number, the idle resources can be shared by other applications or shut down automatically to save energy; thus, our approach is more sustainable than other approaches.
In the future, efforts will be made to build WPS services for Big Data analysis and applications on the cloud.The high-performance WPS can be utilized to improve the performance of geospatial service chains and the efficiency of geospatial-based events, particularly emergency and disaster response decision-making and activities.

NYFigure 3 .
Figure 3. Algorithm of the elastic parallel WPS service.

Figure 4 .
Figure 4. Prototype of the elastic parallel remote sensing data processing WPS service.

Figure 5 .
Figure 5. Execution times of the four approaches.

Figure 6 .
Figure 6.Computing resource requirements of the approaches.