SOAP Performance - Really so slow ?

B

Bruce Wood

Mike said:
Could you elaborate a tad? Just what can be done?

Well, for example, the gurus recommend that Web Services be stateless.
That, along with the knowledge that each call carries a lot of overhead
makes us prefer to make one call to search for stock items and return
the whole list to the client, rather than writing a "get first / get
next" style interface. We also offer client programs fewer options as
to how much information is returned for each item, because it's better
to return more info than the client wanted than to have a client
calling over and over again to get progressively more information about
a particular item. "Return the entire result, and return enough or more
than enough information about each item on one call" is the philosophy
we're running with for now.

If we were running a binary interface we might have done it
differently: make more calls to finer-grained routines on the server
side.
Also, I'm not sure how to determine when a WS should be used over some
other techology. If I my business uses a Java server, then just use a Java
technology to pass the data. Is that how you are determining which to use?
What would be some other factors?

I think of it this way: If I have a server running Java, and I'm pretty
sure that all of my clients, now and in the future, will either be Java
clients or browser-based clients (which could be served by a Java-based
Web server), then I would go with RMI, knowing that that would, for all
practical purposes, lock me into Java forever. I would get much better
performance and it would be easier to make the whole thing work. The
price I pay is that if my bosses ever come to me and say that they want
me to write a C# client on a Windows handheld then I'm in a bit of
trouble. (At that point I would either talk them out of it or build Web
Services on top of the Java server framework and use those, but I
wouldn't really be leveraging all of that RMI investment.) Lots of
shops are one-language shops, and in that environment there's really no
reason to incur the performance penalties of Web Services.

If, on the other hand, there is a reasonable likelihood that I'll be
dealing with all sorts of clients, and browser-based won't cut it (so I
would need to deploy client apps on various client platforms), then I'd
seriously consider Web Services because of the interoperability, even
though the performance sucks (comparatively) and in some cases it's not
as solid as some of the binary protocols (depending upon whose app
server you're using).

In our case, it's our server side that's the problem. Our choices there
are extremely limited... basically it's Web Services or nothing for us
on the server side.
 
A

Andrew McDonagh

Bruce said:
Be that as it may, I beg to differ that SOAP / Web Services is one of
those "inept" ways that deserves to die.

Agreed -
In our case, for example, SOAP / Web Services is a godsend. We have a
legacy back-end consisting of millions of lines of code, and no, we're
not about to rewrite the thing in Java or C# just to make purists
happy. Web Services is the first thing we've seen that could open up
our closed mainframe-style architecture and start delivering some
results. Is it inefficient compared to binary protocols? Yup. However,
it's also the only practical way to deal with a heterogeneous
environment.

Binary protocols are efficient and easy to work with until you come up
against a system that has different parts written in different
languages. Then they quickly become a nightmare. For all of its
inefficiencies and problems, SOAP doesn't suffer from that one critical
flaw.

Sure, there may be a "SOAP backlash" coming from twits who use the
technology for absolutely everything, including inter-process
communication. However, the technology does fill a niche (and a huge
niche it is) that RMI, Remoting, etc. have never been able to
adequately address. I think that SOAP / Web Services are here to stay.

Those twits are usually (though not always) the same people who abuse
all distributed messaging technologies by creating tiny methods that
pull or push singular atomic data values between two points. Early
CORBA days were full of people creating Business Object models that had
the objects residing anywhere and then having set/gets & normal methods
on those objects. And they wondered why it did run very quickly?????

Even with SOAP I see people making this fundamental mistake.

Andrew
 
A

Andrew McDonagh

Stefan said:
Hi,

Well, this is an extremely non-real-word :) benchmark, that would work
for cases where the request takes zero time at the server side, which is
not a common case, or is simply caused by a design flaw.

You say that you get 140 SOAP calls / sec = cca 7 ms per call, and 1600
RMI calls = cca 0.6 ms. But should the request take 10 ms to complete at
the server, the difference would be 17 ms vs. 10.6 ms, less than
two-fold. With a 100 ms request, this would be 107 ms compared to 100.6
ms, a difference that's completely negligible compared to the benefits
provided by SOAP.

Just my 2c.

Stefan

:) Nice!
 
R

Roedy Green

Binary protocols are efficient and easy to work with until you come up
against a system that has different parts written in different
languages. Then they quickly become a nightmare. For all of its
inefficiencies and problems, SOAP doesn't suffer from that one critical
flaw.

A soap creator/parser is much more complex that a package to deal with
the wrong endianness of data. Just count lines of code to convert
binary to char to byte to char to binary compared with little endian
to big endian network order.

Soap has an illusion of simplicity because it is easy for humans to
deal with, but it is not humans dealing with it.
 
B

Bruce Wood

Roedy said:
A soap creator/parser is much more complex that a package to deal with
the wrong endianness of data. Just count lines of code to convert
binary to char to byte to char to binary compared with little endian
to big endian network order.

But it's not about just big-endian versus little-endian and low-level
concerns like that.

My point is that tools and frameworks for producing / consuming SOAP /
Web Services on all sorts of platforms and languages are sprouting up
like mushrooms. I don't have to write the bare-bones code that worries
about serialization, transport, and even (latterly) security and
encryption because it's all being done for me by hundreds of vendors.

The beauty of SOAP / WS isn't that it's easy for any particular vendor
to support it on any particular platform. In fact, as you pointed out,
it's not: it's bloody difficult, and getting more difficult by the
month as higher and higher level standards are created.

Instead, the beauty of SOAP / WS is that I as a consumer can buy an
application server that is designed to run services written in Java
from one vendor and a client platform for .NET clients from another
vendor and the two work together. CORBA never managed to get that much
market penetration. So far as I know the field of players trying to do
that sort of thing with RMI or .NET Remoting is thin indeed. If I can
grab products off the shelf and have them interoperate out of the box,
I don't care how much of a pain it was for the vendor to create them.
I'm happy. I'm even happier when vendor #1's client platform turns out
to be crap and I can just dump it and substitute another platform from
a competing vendor and it still works with my server-side Web Services.
I like the security of knowing that my whole system doesn't live or die
based on one vendor's ability to deliver, or even one language's
ability to deliver.

As well, my business partners can choose their own platforms and
languages and call my Web Services without knowing or caring what
language they're written in. Try doing that with .NET Remoting.

There's nothing wrong with RMI / Remoting / CORBA / whatever. They're
great technologies. However, they just don't have the vast market
penetration that Web Services is shaping up to have. As I said, if
interoperability between heterogeneous platforms is high on my list of
requirements, I probably won't be considering Java RMI as my protocol.
If I'm in a closed, all-Java shop, then that changes everything. Use
the right tool for the right job... and there are many jobs for which
SOAP is the right tool.
 
F

frankgerlach

I got 1600 calls/s with RMI or SimpleORB and about 140 calls/s with
SOAP. Application was hello-world with one String as argument.
 
R

Roedy Green

Instead, the beauty of SOAP / WS is that I as a consumer can buy an
application server that is designed to run services written in Java
from one vendor and a client platform for .NET clients from another
vendor and the two work together.
that is also true of CORBA or messages defined by ASN.1.
 
F

frankgerlach

Potentially WRONG: Real-world requests will transfer much more data,
which produces a VERY lengthy SOAP message. SOAP is not just a huge
envelope around efficiently encoded data, but a lengthy envelope that
contains lenghty data structures.
Just look at the encoding of an integer:
<Integer xmlns="urn:vwservices">1</Integer>
That is 40 bytes for a single integer - about a factor of ten (actually
40 if intelligently encoded) worse than CORBA.
This means that multi-object messages are ALSO inefficient, because
each object/value if inefficiently encoded.
 
A

Aquila Deus

Potentially WRONG: Real-world requests will transfer much more data,
which produces a VERY lengthy SOAP message. SOAP is not just a huge
envelope around efficiently encoded data, but a lengthy envelope that
contains lenghty data structures.
Just look at the encoding of an integer:
<Integer xmlns="urn:vwservices">1</Integer>
That is 40 bytes for a single integer - about a factor of ten (actually
40 if intelligently encoded) worse than CORBA.
This means that multi-object messages are ALSO inefficient, because
each object/value if inefficiently encoded.

hmmm couldn't this be easily solved by compression??
 
R

Roedy Green

hmmm couldn't this be easily solved by compression??

Let's say you got 50% compression. You are down to 20 bytes per
integer verses 2. AND you have yet another cpu intensive step at both
ends.
 
A

Aquila Deus

Roedy said:
Let's say you got 50% compression. You are down to 20 bytes per
integer verses 2. AND you have yet another cpu intensive step at both
ends.

I plan to use it with AJAX, so the client-side cpu loading isn't
important, and the compression rate should be much higher than 50%
usually (most data transfered will be xml tags...). Besides, if I dont
use SOAP, what else can I choose?? IIOP over HTTP?
 
D

Dimitri Maziuk

Bruce Wood sez:
....
Instead, the beauty of SOAP / WS is that I as a consumer can buy an
application server that is designed to run services written in Java
from one vendor and a client platform for .NET clients from another
vendor and the two work together.

Uh-huh. The beauty of windows is that a consumer can buy a windows
peecee and go whenever he wants to today by just clicking on the
"Start" button.

When I become the Evil Overlord I'll have every SOAPophiliac do 3
years of system administration in heterogeneous environment before
they're allowed to comment on "ease" of SOAP.

Dima
 
J

Jon Martin Solaas

Bruce said:
Ah. I see now that the OP cross-posted into a Java newsgroup. I hadn't
noticed that at first (the sins of using Google Groups). My apologies
to the Java folk for implying that "binary protocol = .NET"... it was a
problem of context. :)

Exactly. And I just realized it was posted on a .net-group too :) My
point was merely that big bad binary protocol isn't just a dot-net
thingie. RMI and EJB-remoting is just as binary in the Java world.
 
J

Jon Martin Solaas

Stefan said:
Hi,

Well, this is an extremely non-real-word :) benchmark, that would work
for cases where the request takes zero time at the server side, which is
not a common case, or is simply caused by a design flaw.

You say that you get 140 SOAP calls / sec = cca 7 ms per call, and 1600
RMI calls = cca 0.6 ms. But should the request take 10 ms to complete at
the server, the difference would be 17 ms vs. 10.6 ms, less than
two-fold. With a 100 ms request, this would be 107 ms compared to 100.6
ms, a difference that's completely negligible compared to the benefits
provided by SOAP.

Just my 2c.

Or slightly rephrased - If the server takes forever to answer, the
protocol is irrelevant.

And if you consider message size and payload also, suddenly protocol
isn't that irrelevant again. Funny isn't it?
 
J

Jon Martin Solaas

Aquila said:
I plan to use it with AJAX, so the client-side cpu loading isn't
important, and the compression rate should be much higher than 50%
usually (most data transfered will be xml tags...). Besides, if I dont
use SOAP, what else can I choose?? IIOP over HTTP?

Aren't most remoting protocol networkable?
 
M

Mike Gaab

Jon Martin Solaas said:
Or slightly rephrased - If the server takes forever to answer, the
protocol is irrelevant.

And if you consider message size and payload also, suddenly protocol isn't
that irrelevant again. Funny isn't it?

And what about routing, isn't that also a factor?
Isn't it really hard to benchmark something that is not deterministic?
(I know you can run lots of tests and that will tend to flatten some of the
peaks and valleys.)

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top