Comparison of RMI, Hessian, Burlap, Httpinvoker, WebService

Source: Internet
Author: User

First, the summary
This paper compares the transmission performance of RMI, Hessian, Burlap, Httpinvoker, WebService5 in different data structures and different data volumes.
RMI is the Java language itself provides the remote communication protocol, stable and efficient, is the basis of EJB. However, it can only be used for communication between Java programs.
Hessian and burlap are open-source protocols provided by Caucho, based on HTTP transmission, without opening firewall ports on the service side. The specification of the Protocol is exposed and can be used in any language.
Httpinvoker is a remote communication protocol provided by Springframework and can only be used for communication between Java programs, and the server and client must use Springframework.
Web Service is the preferred protocol for connecting heterogeneous systems or heterogeneous languages, communicates in soap form, can be used in any language, and is well supported by many development tools today.

The test results show that the communication efficiency of several protocols is:
RMI > Httpinvoker >= Hessian >> burlap>> Web Service
RMI is the preferred remote calling protocol for Java, which is highly efficient and stable, especially in the case of large data volumes, with other communication protocols.
Httpinvoker uses the Java serialization technology to transfer objects, which are consistent with RMI in nature. In terms of efficiency, the two are similar, the transmission time of Httpinvoker and RMI is basically flat.
Hessian is faster and more efficient than RMI when transmitting a small number of objects, but it is about 20% slower than RMI to transmit objects with complex data structures or large numbers of data objects.
Burlap is only a fair speed when transmitting 1 of data, typically 3 times times more than RMI.
The inefficiencies of Web service are well known, and on average, Web service traffic is 10 times times more than RMI.

Second, the result analysis
1. Call directly
all of the direct calls are close to 0, which means that the program processing takes almost no time, and the entire time recorded is spent on remote calls.
2. RMI Invocation
as envisaged, RMI is certainly the quickest, and in almost all cases it is the least. Especially in the case of complex data structure and large amount of data, the gap with other protocols is especially obvious.
in order to give full play to RMI performance, we have also done a test class that does not use spring, uses the original RMI form (inheriting the UnicastRemoteObject object) to serve and remotely invoke, and compares the efficiency of the RMI packaged by spring with the Pojo. The results show that the two are basically flat, and spring offers a slightly faster service.
Initially, this is because spring's proxy and caching mechanisms are powerful, saving time for object re-acquisition.
3. Hessian call
Caucho Company's resin server is known as the fastest server, in the Java domain has a certain degree of visibility. Hessian as part of the resin, its design is also very streamlined and efficient, as evidenced by the actual operating conditions. On average, Hessian is about 20% slower than RMI, but this is only possible when the data is particularly large and complex, and the Hessian is no slower than RMI when it comes to medium or small amounts of data.
the benefit of Hessian is that it is streamlined, can be used across languages, and protocol specifications are exposed, and we can develop the implementation of its protocols for any language. There are currently implemented languages: Java, C + +,. NET, Python, Ruby. There is no Delphi implementation.
In addition, Hessian and Web server is very good, with the help of the mature function of Web server, it has great advantage in dealing with a lot of users ' concurrent access, which can be guaranteed by mature Web server in resource allocation, thread queuing, exception handling and so on. RMI itself does not provide multi-threaded servers. Also, RMI needs to open the firewall port, hessian not.
4. Burlap Call
Burlap and Hessian are Caucho's open source products, but Hessian in binary mode, and burlap in XML format.
The test results show that the efficiency of burlap is acceptable when the data structure is not complex and the volume is moderate, but if the data volume is large, the efficiency will drop sharply. On average, the burlap call is 3 times times the RMI.
I think that there are two reasons for its inefficiency, one is that XML data describes too much, the same data structure, its transmission is much larger, on the other hand, it is well known that the parsing of XML is relatively cost-effective, especially for large data volumes.
5. Httpinvoker Call
Httpinvoker is the Java remote invocation method provided by Springframework, which uses the Java serialization mechanism to handle the transfer of objects. From the test results, its efficiency is still possible, and RMI basically flat.
However, it can only be used for communication between the Java languages, and requires both the client and the server to use the spring framework.
In addition, Httpinvoker has not been tested in practice and has not yet found a project to apply the protocol.
6. Web Service invocation
the test uses Apache's axis component as a Web service implementation, and axis is relatively mature in the WebService field.
in order to test only the time of data transmission and encoding, decoding, both the client and the server use caching, and the object simply instantiates once. However, the test results show that the efficiency of webservice is 10 times times slower than other communication protocols.
if you take into account the transport of multiple references to the same object, the Web service lags behind more. Because Rmi,hessian and other protocols can pass a reference, and how many references the Web service has, how many copies of the object entity are copied.
too much redundancy in WEB service transport is one of the reasons for its slowness, monitoring finds that the same access requests, which describe the same data, webservice the amount of data returned by the Hessian protocol by 6.5 times times. In addition, the processing of WEB service is very few, the current XML parser efficiency is generally not high, processing XML <-> beans is very resource. From the test results, the remote call is faster than the local call, but also from the side of the main use to encode and decode the XML file. This is more serious than redundant information, which consumes only the network bandwidth, and the resource consumption of each invocation directly affects the load capacity of the server. (MS engineers have said that using a Web service cannot load more than 100 concurrent users.) )
The testing process also found that the Web service coding is not very convenient, for non-basic types need to register the serialization and deserialization class, it is cumbersome to generate stubs more tired than spring + Rmi/hessian processing so smooth and concise. Also, Web service does not support collection types, only arrays, inconvenient.

Iii. mechanism of Hession

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.