• No results found

A Study on Web Services Performance Optimization

N/A
N/A
Protected

Academic year: 2021

Share "A Study on Web Services Performance Optimization"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

A Study on Web Services Performance

Optimization

Hou Zhai-wei 1, ZHAI Hai-xia 1, and Gao Guo-hong 2 1

College of Computer Science and Technology, Henan Polytechnic University, Jiaozuo, China Email: zhwhou@126.com

2

Henan Institute of Science and Technology School of Information Engineer, Xinxiang, China Email: zhaihxjz@126.com, gaoguohong@hist.edu.cn

Abstract—Web Services Architecture provides better interoperability and flexibility, the performance is a key research point of the Web Services application.The authors firstly analyze the performance of SOAP processing on Java platform,then,summarize the main factors affecting performance,lastly,the authors introduce the application of the Compression technology and Caching in the performance optimization of Web Services solution.

Index Terms —Web Services,Performance,Template Cache

I. INTRODUCTION

With the development of Internet, distributed systems,high-performance,high reliability, high sensitivity, scalability, and system transparency make the application of distributed systems much wider, in recent years, these applications include e-business applications, collaborative deal of work, etc.With rapid development of Web Services in recent years,people are more and more familiar to the Web Services.the world’s top companies, such as Microsoft,IBM and SUN, have launched supports for technologies related to Web Services. Based on research analysis,the authors think Web Services can not form a concrete or mature market in the next two years or so, besides, the performance of Web Services has been the hot research point in this field.

II. ABRIEF INTRODUCTION TO WEB SERVICES

A. Web Services Implementation Model

Web Services mainly include three interactive roles: service provider, service requestor and service registry. The concrete interactive operations include publishing ,finding and binding. The roles and operations mentioned above are based on two components of Web services, i.e. services and service descriptions. Figure 1 below shows these operations, the components of these operations and the interactions between them.

• Service provider :It refers to the owner of services from the perspective of business, but it is a platform that provides access to services from the perspective of architecture.

• Service requester:It refers to the business that needs specific functions from the perspective of business, while it refers to the service client applications which include finding and calling services from the perspective of architecture. The role of Service requestor can realized by people through using the browser, or realized by an application program automatically.

• Service registry:It is a service description information repository (Repository).Service providers publish their services here, service requestors find services, get binding information here.

B. Web Services Operation

Web Services applications must be accompanied by three actions[6],that is, release service description, service description, and the binding or call service based on services description. These operations can occur one time or repeated more than one time. These actual operations are as follows:

• Publish:Only services that can be found and used by users can really play its role, so service providers must describe and publish services to the registered server firstly. In the publish operation, service providers need to register the server authentication, only in this way, can users publish and modify service descriptions.

• Find:The question is how to make services found by users after service publishing, service requestors can obtain relevant information needed by bind service through sending a query specification interfaces based on the registered server.

• Bind:Finally, the question is how to achieve the service call. In the binding operation, the service requester obtained the service binding information from the registration server based on the analysis, from which they know the detailed requirements for the service, such as, service access path, the service call parameters, return results, transport protocols, safety

Figure 1. Web Services architecture

Service registry Service provider Service requester find publish bind service description ISBN 978-952-5726-11-4 Proceedings of the Third International Symposium on Electronic Commerce and Security Workshops(ISECS ’10) Guangzhou, P. R. China, 29-31,July 2010, pp. 184-188

(2)

requirements, etc. Then, the service requester can achieve the service of remote calls by means of deploying their corresponding configuration based on these information systems.

III. FACTORS AFFECTING PERFORMANCE OF WEB

SERVICES

There are three factors affecting the Web Services of the time response: (1) network transmission time, that is, the request from the clients to the server and the response from the server to reach client used of time; (2) information processing time, that is, the XML parsing, service call and the final response to the message encoding time; (3) service execution time, the time needed to implement the service itself, does not include specific code to dynamically call processing time. A. Network Transmission Factors

The widely used Internet protocols are HTTP, SMTP, and FTP in the transport layer of Web Services architecture in the past, but the HTTP protocol binding is used much more nowadays. HTTP is a TCP protocol at the top of the application layer protocol, which defines a simple request response interaction mechanism. In the process of requesting response, the factors that HTTP protocol affect performance of Web services include free sessions and two forced delay.

HTTP is considered as stateless protocol because it does not contain the concept of conversation and interaction. Web site may receive millions of users’ requests because the server does not need to track each user’s request and keep record of their requests in the past, such non-state agreement can improve the efficiency of the system, at the same time, it also cause heavy performance consumption. For example, to establish a connection for each request, even if most objects are small, but open and close connection to TCP control packets must be sent. Another major factor affecting the performance of the HTTP protocol is Mandatory delay. After the service call is completed, the client must wait for the server to issue a request to disconnect connection, which can cause some connection delays and query delays.

B. XML Processing Factors

Web service call is a process that the service provider deploy Web services in the service environment based on the Web service client calls, and its call flow process is shown in Figure 2. In the beginning of this process, Web service client sends a request to construct and give SOAP message; upon receiving request message, web service will build and send the response SOAP packet to clients after the Service Runtime Environment analysis, validation message and call the Web service’s specific implementation; after web service client receives response message, the same requirements are needed, such as, analysis, verification packet in order to supply further process for the program.

There are five stages in the process of a request - response Web services[2] (as showed in Figure 2). ① XML parsing stage, SOAP engine parsing XML, SOAP messages, commonly used analytical methods are DOM and SAX. ② de-serialization phase, the resolved XML data will be Counter-serialized into Java objects. ③ service invocation phase, web service call the proper service according to user’s requests. ④ serialization of stages, the Web server serialized the returned Java Data Objects into XML data. ⑤ output stream stage, the cache of XML data objects will be written into the output data stream in this stage.

In order to analyze the specific time of each phase of occupancy, we tested the SOAP message processing time consumed by each stage by making experiments in the environments as shown in Table 1, WS Test 1.0 provides echoVoid, echoStruct, echoList, etc. for SOAP engine performance test.

TABLE I. EXPERIMENTAL ENVIRONMENT

Hardware P4 2.0G 512M

Software

Operating system Windows XP Professional SP2 SOAP Engine Axis2.0

JVM JDK1.4.2 Web Container Tomcat 5.5

XML parser StAX Services Test Software WS Test 1.0 Network 100M LAN 0 5 10 15 echoVoid echoList output stream serialization services call de-serialization XML parsing Initialization T h e av er ag e tim e ( Millis ec on d )

Figure 2. Process of SOAP Message

Internet Web Services Client SOAP/XML XML parsing deserialization Web Services Return Request Web Services Server

① ② ③ ④ Output stream ⑤ serialization SOAP/XML

(3)

SOAP engines sends 10,000 requests for each Web service client, and then averaged, the average time for each stage in the 3 types of WS tests of the SOAP message processing when the XML load is 8KB are shown in Figure3.

From the above results, we can see that XML parsing, de-serialization and serialization are the three most time-consuming stages in the process of handling SOAP messages, they also determine the Web Services performance to a large degree, especially when effective load is increasing. Optimizing XML parsing, serialization and de-serialization are three key factors for improving the performance of Web Services.

IV. METHODS FOR WEB SERVICES PERFORMANCE

OPTIMIZATION

A. SOAP Compression

When the content is text, its size can be reduced by 80% through compression. This means that the bandwidth between the client and the server can reduce a similar percentage. In order to compress and de-compress, server and client CPU is taking up additional resources. But the upgrade CPU server generally cheaper than increasing the bandwidth, so compression is the most effective method to improve the transmission efficiency.

Different compression algorithms have different compression ratio and compression time for the same XML-based SOAP messages, we take the assessment formula (1) as reference, that is, network speed is N bytes / sec [3], the computing speed of computing devices is C computing units / second, compression algorithms require Z computing unit, compression algorithm can compress the SOAP message out E bytes, the transmission time of Web Service can be reduced is T by using the compression algorithm, so the formula is as below:

(

) (

)

T

=

E

÷

N

Z

÷

C

second) (1) If T is negative, it is proved that using the compression algorithm does not improve the transmission performance of Web Services, but lower it; on the other hand, if T is positive, it indicates the use of compression algorithms improve the transmission performance of Web Services. The larger T is, the more the transmission performance of Web Services is improved by the compression algorithm.

After transferring all the flow objects to binary through BinaryFommatter sequence, Web Services Server will byte[] encoded as BASE64 according to the byte[] parameter parsing mode, then de-serialize them after another reception. The additional benefits of this is that we can pass some of the objects that Web Services Server does not allow originally, for example, DataTable.

To send after transferring the serialization of the binary stream into real-time with the GZIP compression algorithm(at the other end, de-serialization must occur after the corresponding decompression), general data compressed will become less than one-tenth of the original, After these two steps, the rate is increased to 7-8 times of the original, according to my measurement, the 2M of ADSL need 3 seconds to pass 1000 line

passing Dataset by means of the original method, but improved version only need 0.5 seconds. The efficiency may be improved much more if the connection speeds are at lower network environment.

B. The Use of Cache

Cache is between service providers and service users, it can benefit multiple service providers and service users, and improve the Web Services framework system performance much more; generally speaking, The application of cache includes client-side caching, server-side caching and multi-level cache.

1) Client Cache

Client cache is similar to fat client technology, it can effectively improve the corresponding rate of the services, besides, it can maintain the consistence between data and server-side data cache by using asynchronous communication and multi-threading technology when the client mode is idle, it can effectively reduce the remote interaction with services side. For example, in book ordering system, when customers order is submitted, Web services should first check whether the local prices of goods is same as that of the service side, and if prices are different, customers should be prompted to update the latest price, and then make judgment before ordering behavior. Client-side cache pattern apply to situations that the client requests a longer period of data changes, such as, airline tickets inquiries, weather forecast, etc.. The performance of services is improved by more than 800% by using client-side caching [4].

2) Server Cache

In the Web Services architecture, The parsing and call of SOAP messages take up a lot of time in XML message processing consumption; it requires a lot of the same type of information in the service call process, so the server will send the same information repeatedly, for example, stock system, in order to improve the speed of processing SOAP messages, we have to apply caching technology to the service-side selectively so that the performance of the server can effectively improved. Cache include two methods, that is, the message body cache and the template cache.

a) the Message Body Cache

The cache has stored all SOAP message body calls, and the cache identifies each message body with the unique ID and TTL (Time To Live) according to the client’s service request, if the requested XML messages exist in the cache and the TTL is still valid, we do not need to re-SOAP message, but call from the cache and returned to the client directly.

b) the Template Cache

In the process of a service, clients usually only request the same elements, but only with different real-time values. For example, for the real-real-time data monitoring system deployed in the industrial field, clients only request a specific sets of data testing points, only with the current real-time values. In this circumstance, we only need to reassemble the latest value of the corresponding testing point of the field. By using the template cache technique, the response time can be significantly improved since the technique can avoid duplicating construction/destruction of the same

(4)

message. The structure is shown in Figure 4, and the specific implementation is as follows.

• The MD5 algorithm produces message ID for each service SOAP request.

• firstly, parse the SOAP message data elements, if the ID does not exist in corresponding template of the cache, the new cache will be made, and generate the corresponding template according to its ID number, and set TTL for this template cache.

• If there is the corresponding ID number of the template, then, the template will generate the return SOAP message directly.

• To maintain the cache template by means of the template management module.

The actual optimized conditions of the service performance after using the message body template and the template cache are shown in Table 1 which shows the laboratory conditions of the authors’ experiments. The authors apply Jakarta-Jmeter-2.2 to the test client software by setting different type of parameters, the results obtained are shown in Figure 5, from which we can see the performance of SOAP message body caching and template cache can be further enhanced.

0 1000 2000 3000 4000 5000 6000

getArrayObject getArray getRandomArray

no using cache

The Message Body Cache The Template Cache

c) Multi-level Cache

In the framework of most web services, different structural cache models may be used to improve the overall system performance. One of such models is 2LCA: two-level caching architecture, which is most

common model and has been used by most of current internet framework. One other kind is called 3LCA, three-level caching architecture, which is able to solve the cache issues in heterogeneous networks by using some intermediate proxy nodes. This kind of mode can be further divided into three-level homogeneous structure and that of three-level heterogeneous cache architecture.

Multi-level cache model [8] shown in Figure 6. Based on the priority level and content of incoming messages, responsive messages can be generated from client, intermediate nodes cache or server cache.

ACKNOWLEDGMENT

The authors wish to thank the support of the Provincial Key Laboratory of Computer Information Processing Technology of Suzhou University(ZK208002),the NSF of Science and Technology bureau of Henan province(092102210365, 102102210032), Youth Foundation of Henan Polytechnic University of China(Q2010-12a),"Eleventh Five-Year Plan" project of Guangxi Social Science(08FTQ001) and 2010 key project of Ministry of Education(210128).

REFERENCES

[1] Anbazhagan Mani, Arun Nagarajan. Understanding Quality of Service for Web Services[Z] .IBM Software Labs, Inda, DeveloperWorks,2002.

[2] HUA Lei,WEI Jun,NIU Chun-Lei,ZHENG Hao-Ran.High Performance SOAP Processing Based on Dynamic Template-Driven Mechanism [J]. Chinese Journal of Computers.2006,29(7): 1145~1156.

[3] Guo Heqing,Liu Zhengxi.Improve the transmission performance of web service with compression technology[J]. computer applications and software.2006,23(6):102~104.

[4] K. Devaram and D. Andresen.SOAP optimization via parameterized client-side caching. In Proceedings of the IASTED International Conference on Parallel and Distributed Computing and Systems (PDCS 2003), pages 785~790, Marina Del Rey, CA, Nov. 2003.

[5] D. Andresen, K. Devaram, and V. P. Ranganath. LYE: a high-performance caching SOAP implementation. In Proceedings of the 2004 International Conference on Parallel Processing (ICPP-2004), Montreal, Canada, Aug. 2004.

[6] Tang , Runhua Jiang , Dao Yao , Guoxiang. Application Research on the Web Services—Based

Figure 6. Multi-level Cache

Server Cache Web Service Proxy cache Client Cache Client Request Response Web Services Provider Internet SOAP MD5 ID1 ID2 ID3 … … XML Template Template cache Parsing Template cache Finding

Figure 4. Structure of Template Cache

Figure 5. Test Reslult

T h e av er ag e tim e ( Millis ec on d )

(5)

Integration in the Web Information [J]. CONTROL & AUTOMATION. 2006,22(3-3 ):173~175.

[7] Feng,Xiwei Jia,Chuanying Jin,Kun. Design and Implementation of Service Integration Based on Web Services [J]. CONTROL & AUTOMATION。2006,22

(1-3 ):258~260.

[8] Venkatesh Prasad Ranganath, David M. Sexton, Daniel A. Andresen. High-performance soap with multi-level caching .Parallel and Distributed Computing and Systems.2004.

Figure

Figure 1.   W eb Services architecture Service registry Service providerService requesterfindpublish bind  service description  ISBN 978-952-5726-11-4Proceedings of the Third International Symposium on Electronic Commerce and Security Workshops(ISECS ’10)
Figure 2.   Process of SOAP Message
Figure 5.   Test Reslult

References

Related documents

The use of sodium polyacrylate in concrete as a super absorbent polymer has promising potential to increase numerous concrete properties, including concrete

The paper assessed the challenges facing the successful operations of Public Procurement Act 2007 and the result showed that the size and complexity of public procurement,

This study aims to test whether the liquidity proxied by Current Ratio (CR) has an effect on the dividend policy of manufacturing sector of consumer goods sector

The ethno botanical efficacy of various parts like leaf, fruit, stem, flower and root of ethanol and ethyl acetate extracts against various clinically

Experiments were designed with different ecological conditions like prey density, volume of water, container shape, presence of vegetation, predator density and time of

effort to develop few novel hybridized derivatives of murrayanine (an active carbazole derivative) by reacting with various small ligands like urea, chloroacetyl chloride,

Due to the continued interest and debate in this area, we conducted a scoping systematic literature review and meta-analysis of all observational studies

Phosphorylated CheY (CheY-P) binds to the motor switch to induce tumbling of the cells. CheR and CheB confer adaptation to persisting stimuli by adding and removing methyl groups