Tech Off Thread

8 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Web Service - Well Slow

Back to Forum: Tech Off
  • User profile image
    AndyStewart

    Hi Guys

    Heres a question for you we have a arguement going at work where one of the guys says that he can get better performance connecting on straight sockets rather than using web services. Well obviously he will, but we didnt expect the performance to be such a huge difference, if we connect to a web service that retuns the below we can do 150 hits a second, using straight sockets we can get roughtly 700.

    <?xml version="1.0" encoding="utf-8"?>
    <boolean xmlns="http://tempuri.org/">true</boolean>

    This isnt conplicated data any suggestions??


  • User profile image
    Maurits

    Sounds perfectly reasonable to me... TCP/IP has a lot of overhead over a simple local pipe.
    Paradoxically though, in a real-world environment you'll have a lot more data going over the connection.  The overhead of TCP/IP is mostly in setting up the session.  So your five-to-one ratio will drop dramatically as you start sending KB of data over a single connection rather than bytes of data.

  • User profile image
    Rossj

    Andy I'd like to see your stats for about 64k of data, I believe the overhead of serialisation/deserialization and running over HTTP in calling a web service will mean it's nearly always slower than a custom TCP setup.  And yes I know that you don't have to use HTTP but most people do - don't they?

    How about sending 64k worth of strings and see how long it takes to do a couple of thousand calls for each.

  • User profile image
    Maurits

    Rossj wrote:
    And yes I know that you don't have to use HTTP but most people do - don't they?


    Indeed, that's the "web" in "Web service" - otherwise it would just be an "Internet service" Smiley

  • User profile image
    AndyStewart

    Hi Guys

    So is what your saying that the difference will increase the more data sent or it shoulc decrease as the amount of data will componsate for teh serialise/deserialisation?

    I'll look into bigger information later/this afternoon.

    Andy

  • User profile image
    Sk4rlath

    For the most part, Web Services will be slower than a regular TCP/IP connection. But that's not the point of Web Services.

    Correct me if I'm wrong, but the big deal about Web Services is the fact that there's SO much infrastructure out there for HTTP traffic, and most firewalls are cool with that kind of traffic on port 80. Also, they deal with XML payloads, which means you can use XSLT to make it into whatever your program needs.

    The only reason we don't use plain old sockets is because:
    1) They're harder for the average programmer to work with than a Web Service (i.e. I have to package my data payloads into binary streams as well as agree on a protocol).
    2) There's no infrastructure to deal with custom servers like that (companies would have to spend more money).
    3) Not every programming language or system can effectively deal with an arbitrary binary stream (think COBOL).

    So if you're writing a game, use sockets. If you need interop or you're writing a public service, then go Web Service.

  • User profile image
    shreyasonli​ne

    AndyStewart wrote:
    Hi Guys

    Heres a question for you we have a arguement going at work where one of the guys says that he can get better performance connecting on straight sockets rather than using web services. Well obviously he will, but we didnt expect the performance to be such a huge difference, if we connect to a web service that retuns the below we can do 150 hits a second, using straight sockets we can get roughtly 700.
    <?xml version="1.0" encoding="utf-8"?>
    <boolean xmlns="http://tempuri.org/">true</boolean>

    This isnt conplicated data any suggestions??




    Modern Web Servers do more than just deliver a page. It almost runs a application which can be accessed and used from anywhere in the world.

  • User profile image
    AndyStewart

    Heres another question for you microsoft dudes, with the introductionm of indigo will there be any major performance improvements in web services? If theres not how are you planning on making your new message system scale since from knowlegde you will suffer from the same problem asmx has.

    Cheers

    Andy

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.