1

In a large scale modular web application based on Asp.Net Mvc, I have implemented a WCF self-hosting mechanism to provide communication every modules with each other. This was a good practice for me, because by this mechanism the modules have became independent and there is not any direct references. and the next advantage is external applications or the clients if my customers have been able to access these services through WCF service.

The mechanism is the searching and injecting the services from module by the IoC features and hosting them with BasicHttpBinding binding type.

Also the Endpoints of the serivces are configured in a particular URL plus service name (for example the consider the MyService : http://localhost:8080/Services/MyService)

Imagination the scenario

My concern is performance of communication of the modules inside the app process, which they are the same machine, same process in IIS and differs to the external clients.

Is there any distinction between external clients and internal ones in communication layers, OR NOT they are be treated by the same behavior?

If NO, Which features are need to increase the internal clients performance?

Ali Adlavaran
  • 3,697
  • 2
  • 23
  • 47

1 Answers1

1

When you're talking about external clients, you must keep your services must compatible as you can, so you can use http binding, so clients from different plataforms can consume your services.

But when you'retalking about internal clients, all using .Net, you can handle different. You can use tcp binding to improve your performance, since all clients are internal.

There is a sensible performance difference between a http and tcp clients, you see a benchmark here: http://media.techtarget.com/TheServerSideNET/downloads/DotNet-WebSphere_Web_Services_Benchmark.pdf

So, you can improve your performance doing your service accepting both http and tcp bindings, and setting your internal clients to consume your service over a tcp binding.

Here is also a good link talking about tcp and http bindings:TCP Vs. Http Benchmark

Hope it helps.

Community
  • 1
  • 1
Ricardo Pontual
  • 3,749
  • 3
  • 28
  • 43
  • +1 for TCP binding, keep in mind because of some problems i can't choice different binding types for internal and external clients. both of them should be the same. i tested a service with `BasicHttpBinding` in external and internal place. the results shows internal clients get response 180 times faster than external one (`2 ms/p.r.r`(per.request.response) comparing with `360ms/p.r.r`) ! what layers or stuffs causes falling the performance? – Ali Adlavaran Aug 19 '15 at 12:43
  • It's a difficult question, there is some variables involved, you could even do a trace or network trace to find out what's happening with external calls, but internal clients does not need to resolve your ip, maybe not pass through a firewall, proxy, etc. these things can make your call slower from external clients. – Ricardo Pontual Aug 19 '15 at 13:08