My asp.net web pages are on IIS web server and it communicates with WCF services(sitting on windows 2008 app server) using basic HTTP binding. The performance of my wcf services doesnt seem to be that good and I want to improve the same.Also, I need to balance on scalability as my site will be having a very high traffic.
HTTP compression,throttling are some of the ways am aware of but have not tried them yet.. Can i use protobuf API...Please suggest...
Protobuf supports more data types than JSON. JSON is limited to certain python objects, and it cannot serialize every python object. Protobuf supports a wider range of data types when compared to JSON. For example, enumerations and methods are supported by Protobuf and not supported by JSON.
Benchmark — stringsIn one – protobufjs was faster, and in the second — JSON was faster. Looking at the schemas, the immediate suspect was the number of strings. We ran the benchmark with this payload (10,000 strings, of length 10 each).
Fortunately, gRPC is encoding agnostic! You can still get a lot of the benefits of gRPC without using Protobuf.
The short answer is "yes"...
The protocol buffers spec itself doesn't provide an RPC stack, but some have been added outside the spec.
Firstly, protobuf-net has hooks for WCF, allowing you to mark operations on your service contract as ProtoBehavior
. This then swaps the regular DataContractSerializer
to use protobuf-net serialization. However, there are some caveats:
[ProtoMember(Order = 1)]
), since it uses these numbers as the field identifiers (protocol buffers uses numeric fields)When used with the basic http transport, this is also compatible with MTOM (if enabled) for maximum througput. Performance of non-trivial messages is largely proportional to their size; you can get an idea of protobuf-net's sizes here.
Alternatively, I'm also working on a bespoke RPC stack. The current build has a working stack over http, but I also plan to enable it on raw TCP/IP when I get chance. I haven't had chance to write it up yet, but I can provide examples on request. Note that to use it most conveniently, you'll want the 3.5 "extensions" dll, too.
Any questions, add a comment or e-mail me (see my profile).
You could also take a look at using a TCP based binding if the WCF service does not need to be exposed outside of the internal network.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With