140 likes | 229 Views
Faster Web services. A proposal on how web service communication could be made faster. Reasons for Performance Degradations in Web services. Verbose nature of HTTP/SOAP Network / Internet Latency Synchronization Problems Parsing XML strings Other similar bottlenecks. XML.
E N D
Faster Web services A proposal on how web service communication could be made faster
Reasons for Performance Degradations in Web services • Verbose nature of HTTP/SOAP • Network / Internet Latency • Synchronization Problems • Parsing XML strings • Other similar bottlenecks
XML • XML is self describing Advantages • Offers flexibility and readability • Interoperability with other webservice Disadvantages • Inflates the data considerably • XML encoding adds overhead of almost 400% against equivalent Binary encoding formats* * A. Mani and A. Nagarajan. Understanding quality of service for Web services. http://www-106.ibm.com/developerworks/library/ws-quality.html, Jan. 2002.
Some of the reasons for the performance drag in ICIS v5 WS • .NET Library is J-I-T compiled on the first instance • Java classes are J-I-T compiled on the first instance • Large amounts of time spent in parsing the returned XML, payload is too verbose. • .NET Interop, CCW is computationally expensive (bridge)
Possible Solution • Restructure returned XML • Eliminate redundant tags • XMill Compression • Fast Infoset Project Specification • Binary encoding
Restructuring returned XML • Example of XML returned from ICIS 5 JWS <list> <object-array>- <icis.Name> <nid>22446</nid> <gid>663</gid> <ntype>6</ntype> <nstat>1</nstat> <nuid>1</nuid> <nval>AZUCENA</nval> <nlocn>171</nlocn> <ndate>0</ndate> <nref>1</nref> </icis.Name> <icis.Germplasm> ……. </icis.Germplasm> </object-array> …. </list> Redundant end tags adds overhead to the XML
Proposed restructuring <list> <object-array> <icis.Name> 22446 663 6 1 1 AZUCENA 171 0 1 </icis.Name> <icis.Germplasm> …….</icis.Germplasm> </object-array> …. </list> Or still <Name 22446 663 6 1 1 AZUCENA 171 0 1 /> • Advantages • Reduces redundant tags • Achieves reductions by almost 60% • Disadvantages • Receiver has to know the tags represented by the XML
Xmill Compression • Used for XML data archiving and exchange • Uses zlib the library functions of gzip • AT&T Labs Research
Xmill Logic • Separate data from structures • Group data items with related meaning • Apply different compressors to different containers • Compressed .xmi format is not human readable • Use xdemill to decompress xmi files to xml files Disadvantages • Adds to the processing time, especially in the compression phase, and can affect server-side performance.
Example • A Select * on names table returned a XML similar to the XML returned by ICIS v5 WS • Size of returned XML is 337MB • Size of file after applying XMill compression 12.7MB • Percentage compression achieved almost 96%
Fast Infoset Project Specification • Proposes an alternative to the W3C XML syntax • Binary Format for XML Infosets • This representation generally provides smaller encoding sizes and faster processing • To facilitate interoperability, the Fast Infoset specification uses the existing and proven ASN.1 standards • http://java.sun.com/developer/technicalArticles/xml/fastinfoset/
Some features of Fast Infoset • No end-tags. The duplication of characters for end-tags is not required. • Indexing of repeated strings. Indexing reduces the size of the document by replacing a commonly-used string with an integer. Element and attribute names are examples of such repeated strings. • Indexing of qualified names.
Dynamic Compression • Users of webservice have to choose between compressed or simplified XML which reduces latency time but increases processing time and between verbose XML which increases latency time but considerably reduces processing or parsing time taken to persist the XML data to programmatic objects. • Alternative to this approach would be dynamic compression
Dynamic Compression • In this, clients specify, when they request a service, whether they want to receive responses in compressed format from the server. • Server compresses only the request of the clients that required such a service.