World Wide Webber


My Books
REST in Practice: Hypermedia and Systems Architecture
Amazon:
US, UK
Developing Enterprise Web Services by Sandeep Chatterjee and Jim Webber
Amazon:
US, UK,
Also available: Korean Edition

My Bookshelf
RESTful Web Services Cookbook by Subbu Allamaraju
Programming Clojure by Stuart Halloway
RESTful Web Services by Leonard Richardson and Sam Ruby
Even if you think you can beat Waldo, you can't beat Einstein
Posted: 07 July 2005 @ 14:04 UT from Xiamen, China

In the latest issue of the ZeroC newsletter Marc Laukien picks up the baton for binary protocol performance over XML/SOAP in an article rhetorically called "Why Smart People Defend Bad Standards." The article follows up on my posting on the excellent work being done at CSIRO and Macquarie University on evaluating performance (among other aspects) of enterprise middleware, for where there were subsequent follow-ups from Michi Henning (also of ZeroC) rebutting those figures, Mark Little pointing out that you pick the right tool for the right job, and Savaspointing out that in distributed computing Waldo is king.

There are a couple of inaccuracies in the newsletter which I should point out before going any further, not Marc's fault thought since he wasn't to know that:

  1. I'm a bad person cheering for a smart Internetworking standard; and
  2. I recently saw a presentation on the latest results from the SOAP performance at a workshop at Sydney University, presented by Paul Greenfield of CSIRO and hadn't merely read Alex's PowerPoints. I spent a great deal of time talking to Paul during that workshop about precisely this issue and getting my head round his initially counter-intuitive results.

One important point to remember when considering the claims made by the CSIRO/Macquarie University researchers is that they have no commercial axe to grind and in no way stand to make any gains from publishing the facts about system performance save enhancing their academic reputations. Conversely commercial organisations have much to gain by having performant products and therefore will always strive to unequivocally demonstrate their product's performance. You should also keep in mind that I suck at maths in any calculations that follow.

To kick things off, Marc puts forward figures for SOAP and binary protocol middleware where he states:

"Alex [Ng, of Macquarie] quotes 7ms for a simple SOAP message"

and

"Ice and other binary-protocol middleware, such as CORBA ORBs, are tens or hundreds of times faster, with latency figures in the range of 0.03ms to 0.3ms."

Quite so, I think those figures are very plausible especially for system like ICE which the clever folks at ZeroC have no doubt optimised very well. However, as I made clear in my original posting, over large distances even the speed of light becomes an important limiting factor in performance. So let's cast our comparison within the same framework that recent CSIRO/Macquarie University work used - Internet scale integration.

A Simple Experiment

The CSIRO/Macquarie work used a fast private network between Sydney and Canberra. The distance between these two cities is approximately 300km. Short by Australian standards but I suspect a fairly average end-to-end distance in much of the rest of the world. Now, the speed of light is approximately 300,000km/sec which means that information can travel from Sydney to Canberra in around 1ms, assuming the intervening network equipment causes no latencies (which is slightly inaccurate, but will suffice for this experiment). For roundtrip which enables true RPC this doubles to around 2ms (ok- this isn't the canonical case for Web Services, but just roll with it for now).

So before we even start we have a 2ms latency to contend with. Thank you very much Einstein.

Things are looking up in the binary protocol experiment since the additional latency is a meagre 0.03ms per node in the best case and a still, well, meagre 0.3ms per node in the worst case. This brings the total latency to somewhere between 2.06ms and 2.6ms (roundtrip plus latency at each end). Pretty respectable I think.

In the SOAP case, as one might expect things are not quite as optimal such is the penalty for using a general-purpose Internetworking protocol. We can assume that at best SOAP processing will incur an additional 7ms latency at each end of the link bringing the SOAP total to 16ms - around 14ms slower than the binary version.

So in a realistic Internet situation which both SOAP and (say) ICE are designed for the difference is about 14ms. That is, a good binary protocol implementation is about 8x faster than the .Net 1.1 SOAP stack which was the basis for the CSIRO/Macquarie work. Now 8x faster is an impressive figure and in some cases will be well worth sacrificing some degree of interoperability for. However 8x falls a little short  of the "tens or hundreds of times faster" that the latest ICE newsletter claims.

Now think for a minute that 300km is not actually that far. Darwin and Adelaide (both of which I am assured have Internet connectivity) are just over 3000km apart -  a factor of 10 times larger than the Sydney to Canberra distance. Again we'll assume that the network gods are benevolent up to the point of general relativity which means that we have a latency of around 10ms one-way and so 20ms for a roundtrip. For the optimised binary case this means a total latency of somewhere between 20.06ms and 20.6ms. Still pretty respectable. For the SOAP case we have a total roundtrip time of 20ms plus the SOAP processing latency of two lots of 7ms which gives a total of 34ms. In this case the optimised binary version beats the SOAP version by 14ms again.

"Can you see what it is yet?"

Eventually the limiting factor for integration of distant systems is the speed of light and not the latency of processing individual messages. The latency difference between the two approaches will always be approximately 14ms but as network latency gets larger (over distance) the cost of processing the message payload for either binary or SOAP has significantly less impact on overall latency.

Rockin' in the Real World

But as all network gamers know real networks don't approach the speed of light - not even over short distances - and lag is just as much your mortal enemy as frag. For example to ping a peer on my local wireless network the best latency (as measured by running batch of pings) is around 2ms but my average latency is 100ms over a negligible distance compared to the speed of light. In the average case on this network the binary protocol is a mere 14% faster than SOAP - certainly not tens of times faster.

Of course everyone knows that wireless sucks for latency and real gamers play on real gamerboy LANs. I'm working in China at the moment and the Chinese love on-line gaming almost as much as they love smoking and gambling (lots) so of course the client on this engagement has a blisteringly quick Gigabit network for *ahem* work. Well at least during office hours it's for work - usually. The ping on this network is on average below 1ms which means that once again binary trumps SOAP by a long margin :  approximately 1ms versus approximately 15ms - SOAP is 15 times slower on this network - the first measurement that got into the hitherto mythical "tens of times" faster. One and a half tens faster anyway.

However transfer protocols like SOAP and middleware like ICE are designed for Internet scale integration (though with ICE's latency there is no reason to not use it in a LAN if you don't have interoperability to worry about). Let's see how SOAP and binary stack up with a real, but fast, Internet connection. Since I'm in China I don't have access to any fast Internet connections so thanks to Savas for pinging a few places on my behalf.

Savas is currently (but not for much longer) based at the School of Computing at the University of Newcastle upon Tyne in the UK. Newcastle University is the central hub for the NorMAN network and is North Eastern England's route onto JANET, the super quick UK academic network, via a 2.5 Gbit/s link. From NorMAN Savas enjoys a 1GBit connection into his office which I miss and am supremely jealous of. While this is hardly a typical home broadband package it's a good starting point for seeing how the latent the Internet can be, while factoring out concerns such as poor domestic ISPs.

In three separate and broadly representative pings, we observe the following latencies:

RouteBest Ping Latency
Newcastle University to Imperial College London10ms
Newcastle University to ForthNet.gr in Greece70ms
Newcastle University to Columbia University78ms

In terms of end-to-end latency for a roundtrip (assuming symmetry on the network) we get:

RouteAverage Case Binary LatencySOAP LatencySOAP Penalty
Newcastle University to Imperial College London20.66ms34ms64.57%
Newcastle University to ForthNet.gr in Greece140.66ms154ms9.48%
Newcastle University to Columbia University156.66ms170ms7.85%

So when you are one hop away from an expensive national backbone network and a couple of hops (via that network) away from another well connected endpoint, SOAP is a little over one and one-half times slower than binary (tens? hundreds? Not really). Of course not many of us are afforded such luxuries and so our traffic has to traverse a few hops over better or worse networks. For example the over the path to ForthNet in Greece, the penalty is a little under 10% greater latency for SOAP. Over the geographically longer but somewhat faster transatlantic links to the USA the SOAP penalty is 8.5% versus binary.

Of course the typically larger messages which SOAP (even with MTOM) implies means that SOAP messages are more susceptible to packet loss, retransmission, and therefore larger latencies than binary. And this will tend to degrade SOAP performance over distance too by some factor depending on the reliability of the underlying network. Nonetheless I stand by my original posting that while SOAP is slower than a good binary protocol it's not by much. And it's getting faster.

Comments:
#
Since this text field here throws all formatting away, I posted my comment here: http://www.zeroc.com/misc/speed-of-light-fallacy.html
#
Marc, Hardware is cheap and good SOA is easily capable of absorbing as many cheap boxes as you can throw at it. In fact I would argue that I can scale a (stateless, idempotent) service-oriented system trivially. I can overlap message processing with SOAP as easily or more easily than you can with objects. The limiting factor in this argument (assuming you can process 14 billion object invocations per microsecond or whatever) is state. So even if you think you can beat Waldo and that Einstein is irrelevant, you can't beat the angular momentum of disks. How much more fundamental do we need to get? Jim
#
Marc - one more thing - we don't actually know that a single SOAP server which is capable of processing a single message in 7ms is necessarily using all of that server's resources. What if it could simultaneously process 1000 SOAP messages in 7ms? Why is multithreading the exclusive domain of ICE? Jim
#
Jim, this discussion is really becoming irrational now. Hardware is cheap? Tell this to the service provider, who has to invest so much more in hardware if they were to use SOAP--in case of the front-end systems in my example, about 100 times as much! Multithreading? What does this have to do with the whole discussion, and who claims that this is the sole domain of Ice? The fastest way to process requests on a single CPU is still sequential processing. Multithreading only simplifies your programming model, but doesn't magically give you better performance on CPU-bound tasks such as parsing XML.
#
A few more comments from me on things that Jim's argument conveniently ignores: http://www.zeroc.com/misc/speed-of-light-fallacy2.html Michi.
#
Michi: I resent your term "conveniently ignored." Read the posting you will see that I investigated LAN scenarios (the bit about "gamerboys")and found that the grain size for binary was far superior to SOAP (presenting both sides of the argument is known as "good science", presenting one side is known as "marketing"). I susbstantiated my arguments with figures but now you've adopted the approach of the ever-shrinking ethernet cable and fatuous arguments of scalability (which are moot - I can scale, you can scale, you say cost, I say commodity and round we go). So we're going to just have to disagree because there's nothing more we can wring out of this argument. Jim
#
Although the discussion has stopped, I just wanted to add my 2 cents. By adding security (SSL or WS-Security+SecureConversation) with some 1024 bit (or even 2048 bit!) RSA decryption happening in the handshake, server performance goes out the window anyway. This is definitely important for many services that work over the Internet, but because of insider threats, it may even have to be used on private networks in some cases. I realize I may just have stuck my hand inside the proverbial hornets' nest... Halvard
#
Very interesting discussion. However, I think ultimately it depends on the nature of the distributed application whether the SOAP/XML overhead is relevant or not. If your app is doing little more than moving data back and forth, then obviously any ineffeiciencies in the network has great impact. But, if you app has do significant processing per network interaction (e.g. save to DB, heavy compute logic, etc) before excuting a response network interaction, it could very well be that network overhead of SOAP quickly becomes insignificant and the benefits of ease of implementation/maintenance outweights the inefficiencies. This applies to both the responsiveness of the app and the scalability of servers argument. For mostly CPU bound apps, ICE is not going to help you scale much better and SOAP won't slow you down much.
#
It is great to see SOAP/WS/XML/HTTP performance discussed! I would add that we can confirm some of those numbers in our tests [1] and in particular impact of SSL/TLS and how it is different game when message level security is used [2] and what can be done about it [3]. I also agree that one of the most attractive aspects of WS is ability to use HTTP infrastructure to do load balancing in particular when one-way async messaging is used [4] and that can be also leveraged to distribute computationally intensive message level security processing and guard against DoS [5]. However I wonder where this assumption you make comes from "We can assume that at best SOAP processing will incur an additional 7ms latency"? Is 7 like a *magic* number (off the ceiling?) or something based on existing tests? In our experience I would assume that SOAP processing takes 1ms as that is what I see for small messages (so they fit in one TCP packet) and that is certainly what ICE numbers are for i.e. small ping messages right? thanks, alek [1] Aleksander Slominski, Madhusudhan Govindaraju, Michael R. Head, Kenneth Chiu, Michael J. Lewis, Robert van Engelen, Pu Liu, and Nayef Abu-Ghazaleh. A Benchmark Suite for SOAP-based Communication in Grid Web Services. In Proceedings of SC|05 (Supercomputing): International Conference for High Performance Computing, Networking, and Storage, Seattle WA, November, 2005. To Appear. http://www.extreme.indiana.edu/labpubs.html#aslom:soapbench2:sc2005 [2] Satoshi Shirasuna, Aleksander Slominski, Liang Fang, and Dennis Gannon. Performance Comparison of Security Mechanisms for Grid Services. In 5th IEEE/ACM International Workshop on Grid Computing, November 2004. http://www.extreme.indiana.edu/labpubs.html#sshirasu:sec-perf-full http://www.extreme.indiana.edu/labpubs.html#sshirasu:sec-perf:grid2004 [3] Wei Lu, Kenneth Chiu, Aleksander Slominski, and Dennis Gannon. A streaming validation model for soap digital signature. In The 14th IEEE International Symposium on High Performance Distributed Computing (HPDC-14), 2005. Accepted. http://www.extreme.indiana.edu/labpubs.html#welu:streaming:2005 [4] Aleksander Slominski, Alexandre di Costanzo, Dennis Gannon, and Denis Caromel. Asynchronous Peer-to-PeerWeb Services and Firewalls. In 7th International Workshop on Java for Parallel and Distributed Programming (IPDPS 2005), April 2005. Accepted. http://www.extreme.indiana.edu/labpubs.html#aslom:wsDispatcher:ipdps2005 [5] Liang Fang, Aleksander Slominski, and Dennis Gannon. Web Services Security and Load Balancing in Grid Environment. In 6th IEEE/ACM International Workshop on Grid Computing, 2005. Submitted. http://www.extreme.indiana.edu/labpubs.html#lifang:den:gw2005
#
P.S. I hate how formatting of my comment was mangled to make it all into one big blob - what happened ot paragraph breaks ...
#
I missed it readong first time but it seems that 7ms is based on Michi's assertions[1] that SOAP processing takes 7ms (or 3.5ms on server side) - where did this number comes from? I have little or no faith in results and claims on websites that can not be reproduced through independent testing [2]. Where is easy to use test harness? What SOAP tookits was tested? I could nto find that piece of informations anywhere ... best, alek [1] http://www.zeroc.com/misc/speed-of-light-fallacy.html [2] http://www.zeroc.com/iceVsSoap.html
#
Hey Alek, My blog engine doesn't support paragraphs (yet). The number "7" comes from the CSIRO papers where they noted that 7ms is about the quickest they could get a message through their stack. If you have evidence this can be reduced to 1ms, then of course it improves the story for SOAP even in relatively local-area networks. Jim
#

From experience in designing networked games, I'd say that you would be out of your mind if you wanted to use SOAP over any binary middleware. 

I'd say the huge no-no would be the bandwidth requirements. You were mentionning "frags" early on, probably referring to fast paced games. These games require very close differential state sends, with minimal latency. Lossless compression is completely out of question as they are usually small data packets that ought to be flushed out as fast as possible (in order to maintain the system integrity).  

Aside from that, bandwidth is not cheap for game developers (maybe for the others, but not for us) and we have to keep it down to a minimum, especially when we have to host servers. 

Hardware is not cheap either, although it is less of a concern than bandwidth when hosting. On the client side, we have limited amounts of CPU on PCs and game consoles and don't want to spend resources on procedures we could easily avoid for no added developement cost. 

7ms is half of an usual game state iteration and even though network latency adds more to it, it will never hurt to cut down latency by that amount. It is obvious to note as well that, the more data you sent at once, the more latency it adds to be recieved. 

So, SOAP for cards, chess or checkers games, maybe, but certainly not for anything more network intensive.

#

Hey Oliver, 

That's a fascinating insight into online gaming, and what you say makes sense to me at an intuitive level. 

The work I was doing in China is commercial in confidence. While I was working at a game company, but I have to say that I wasn't working on using SOAP for real-time communication, I'm sorry if I gave that impression. I used the (ridiculously quick) LAN there just as an example of a good high speed interconnect, and by implication to show how good ICE performance would be compared to SOAP in that enviromment. It really was just context before I moved into the wider argument about Internet-scale integration where wire-latency starts to become really important. 

I'm definitely not suggesting that SOAP is suitable for real time applications today. I know it will be faster in future, but whether it will ever be sufficiently inexpensive and rapid to process is totally speculative. 

Jim

#

Hi Jim, 

Even though latency is not a worry in loosely coupled distributed systems, wouldn't CPU and bandwitdh still be a major issue in real life applications?  

Assuming you're talking about IP, the more hops you do to get to another point, the less control you've got over the bandwidth available on the route. The smaller it is, the better it goes through, admittedly.  

I understand the benefit of easy interconnection to XML producing systems but it comes at a price one has to consider while designing one's application. Surely SOAP has some tricks down its sleeves to reduce the overhead differences over binary, but even with state of the art compression systems and a perfectly optimised code, it cannot theorically match a binary equivalent, just as a tradeoff from its readability and interconnection capability.

#

Hey Oliver, 

I'm not so worried about CPU cycles because in a good service-oriented system it's easy to add commodity processing power and scale out (this is harder with stateful systems like D-O). 

Now bandwidth is an issue. As Michi points out when you're paying per bit then SOAP (even with MTOM) will undoubtedly cost you more than a sensible proprietary protocol. 

To paraphrase: If all I have is a hammer, then I am only going to look for is nails to bash in :-) 

Jim

Trackbacks:
-
<p> That's the title of <a href="http://jim.webber.name/2005/07/07/bbcca26a-b2d9-473e-86ff-956a44e3b25c.aspx"> a wonderful article</a> by Jim Webber, that looks at performance over long haul networks. he also points to two presentations on SOAP performanc
Author Name:
Email:
Author URL:
Comment:
Antispam:
Please type the following string (note that if the strings don't match, your comment will be lost... sorry!): 'BOIFU'.
 
Recent entries

Recent comments

Feeds:
RSS 2.0 Atom