1

What settings of BasicHttpBinding should i use so that my WCF service fetches and updates data to the SQL server as fast of possible..

Security is not an issue..

Currently my client side config is in this way. It works, but I want to make it faster if possible :-

<system.serviceModel>
   <bindings>
      <customBinding>
         <binding name="BinaryHttpBinding">
            <binaryMessageEncoding />
            <httpTransport />
         </binding>
      </customBinding>
   </bindings>
   <client>
      <endpoint name="httpEndpoint" 
          address="my address"
          binding="customBinding"
          bindingConfiguration="BinaryHttpBinding"
          contract="FLOW5ServiceDLL.IFLOW5WCFService"/>
      <endpoint 
          address="mex"
          binding="mexHttpBinding"
          contract="IMetadataExchange" />
   </client>
</system.serviceModel>
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
srivatsayb
  • 88
  • 9

2 Answers2

3

This depends an awful lot on the context... How many requests are being sent ? What is the size of each? Etc

If you are using http and binary, then you should look at enabling MTOM. This is easy on the basicHttpBinding element. I'm not sure how to do it on a custom binding.

You haven't indicated how you are sending the data; a DataTable is dfferent to a List-of-T, etc.

Personally I've had a lot of success at improving WCF performance using basicHttpBinding + MTOM, but swapping the serializer for protobuf-net (which is usually notably smaller bandwidth than NDCS or DCS); how easy this is to do depends, again, on the context : if you are using assembly sharing at client and server it is usually trivial; if you are using "mex" it takes a little bit more effort.

If you have a "chatty" API (lots of small calls), the first thing to do is consolidate calls to bigger and fewer calls.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • +1 for protobuf hehe. Is absolutely v quick. WCF does cause a lot of overhead we use REST services written in nancy that serialize to protobuf. – albertjan Nov 24 '11 at 19:11
  • @the_ajp I really need to take a look at nancy – Marc Gravell Nov 24 '11 at 19:58
  • I am using DataTables...interesting to see protobuf being adapted to .NET...any links on how i can use it in WCF? – srivatsayb Nov 25 '11 at 04:20
  • @srivatsayb sure, [like so](http://marcgravell.blogspot.com/2009/11/controlling-wcf-protobuf-net-at.html) - but not with DataTable - not really close enough to the core protobuf model (although I do *have* a DataTable encoder for protobuf) – Marc Gravell Nov 25 '11 at 06:04
  • can i somewhere find a step by step process on using protobuf..like steps on how to reference the dll and then change the configuration..i am getting errors when i seemed to do somethings with steps i found on the net.. – srivatsayb Nov 25 '11 at 11:18
  • @srivatsayb that is hard without more context. As I say, it won't love DataTable very much, and it is different depending on how your client is gettings the object model. – Marc Gravell Nov 25 '11 at 13:34
2

I would use netTcpBinding for fast binary transfers if you are inside the same network

check this one as well:

netTcpBinding or wsHttpBinding

Community
  • 1
  • 1
Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • In a number of timings, I've seen netTcp do significantly worse than simpler bindings. All that type meta due to NDCS, presumably. This *can* help, but it is not a magic "this is always better". It is much more scenario specific – Marc Gravell Nov 24 '11 at 18:48
  • I have tried NetTcp but i have run into firewall issues and am not able to fix it...BasicHttp would do for me if it becomes like 15% faster – srivatsayb Nov 25 '11 at 04:13