lunes, 16 de diciembre de 2013

Oracle SOA-DIRECT Binding vs. SOAP over HTTP

(Here you have the post in Spanish language)


There are a lot of websites and documentation that they confirm SOA-DIRECT is more efficient than SOAP over HTTP. This issue is not exposed through experimentation, so it generates some questions about how much more efficient is SOA-DIRECT than SOAP over HTTP.

Before begin, it would be good know what's SOA-DIRECT and what's it provides.

According to Oracle documentation, SOA-DIRECT provides native connectivity between Oracle Service Bus and Oracle SOA Suite service components. Oracle SOA Suite provides a "direct binding" framework that lets you expose Oracle SOA Suite service components in a composite application, and the Oracle Service Bus SOA-DIRECT transport interacts with those exposed services through the SOA direct binding framework, letting those service components interact in the service bus layer and leverage the capabilities and features of Oracle Service Bus.

Also, it is noteworthy that SOA-DIRECT supports the following features:
  1. Invocation of any SOA binding component services through Java RMI and optimized RMI transport for invoking SOA services.
  2. WS-Addressing, including optional auto-generation of ReplyTo properties for asynchronous callbacks.
  3. Identity and transaction propagation.
  4. Attachments.
  5. High availability and clustering support.
  6. Failover and load balancing.
  7. Connection and application retries on errors.    
As mentioned in the above first point, SOA-DIRECT supports invocation of any SOA binding component services through Java RMI and optimized RMI transport for invoking SOA services. This is thanks to a proprietary protocol known as T3 which it is Weblogic's implementation of the RMI specification. This protocol is used to transport information between Weblogic servers and other types of Java programs. Weblogic creates a single T3 connection and thus it maximizes efficiency by eliminating multiple protocols used to communicate between networks. The protocol used for the T3 connection also enhances efficiency and minimizes packet sizes, increasing the speed of the delivery method.
A detail to consider about T3 protocol is that by default it is configured to handle messages of size up 10 MB and if server receives messages more size then it can’t handle them, but this is other issue.

Returning to the subject of performance comparative between SOA-DIRECT than SOAP over HTTP, I have implemented two SOA composites to measure the communications time.
The first composite only has a BPEL process with two activities; a receive activity and a reply activity. This composite could be considered as child composite. 

The second composite has two BPEL processes, the first one has ten invokes through SOA-DIRECT to child composite and the other one has ten invokes through SOAP over HTTP to child composite too.

The request message and the response message only have a single String element which it has been initialized with a String with a single character. Thus, the size of message can't be optimized by protocol used and the communication time is the only variable to measure.

After deployed these composite in a Weblogic 11g that it run over a laptop with a Third Generation Intel Core i5 Dual Core 2.5GHz and 12GB DDR3 SDRAM, I have executed a load test for each case of the second composite with a single invoking thread for thirty minutes and the result set shown below:



Time in milliseconds
Min.
Max.
Avg.
SOAP over HTTP
32
581
41,29
SOA-DIRECT
31
543
40,22

If we calculate the speedup between average times, it can be seen that even with the smaller message size, SOA-DIRECT is almost three percent more efficient than SOAP over HTTP:
 


In order to check how communication time improves if SOA-DIRECT is used, I have modified the second composite with two BPEL process to increasing invokes number from ten to a hundred for each case. After that, I rerun the same load test for each case of the second composite with a single invoking thread for thirty minutes and the new result set shown below:
 


Time in milliseconds
Min.
Max.
Avg.
SOAP over HTTP
278
1078
325,62
SOA-DIRECT
259
944
302,43


If we calculate the speedup between new average times, it can be seen that SOA-DIRECT is almost eight percent more efficient than SOAP over HTTP:
 



This shows there is really improved efficiency when using SOA-DIRECT instead of SOAP over HTTP in the case of connectivity between Oracle Service Bus and Oracle SOA Suite service components.

Even though thanks to previous reason would be advisable to use SOA-DIRECT, there is a little detail about load balance to bear in mind before apply SOA-DIRECT instead of SOAP over HTTP:

  • You cannot explicitly load balance T3 connections because this protocol takes care of its own load balancing (stateless stubs will round-robin calls; stateful stubs will be sticky, with appropriate failover). So, if you put a hardware/software load balancer in front of Weblogic cluster it would not help because the initial connection request will go through the load balancer (only as part of connection) and after the initial connection is established, it will stay for the lifetime of the server and it consistently will go route back to the same server directly without going through the load balancer. If the connection fails, the load balancer doesn't attempt to re-establish it. Responsibility for failover and reconnection remains with the T3 protocol itself and this can be a problem. 
So, before you apply SOA-DIRECT as performance improvement, you must know your system architecture and then, you apply it intelligent way if you need it. 
I hope this contribution has been interesting.

Regards.

4 comentarios: