0

At our workplace, we have a Master-Workers system with multi-threaded features that will run in a distributed network environment

enter image description here

At present, the Master distributes the files to the workers in a very inefficient manner by creating new wcfClients for every message pertaining to a particular file that it needs to assign to a particular worker. To elaborate, a wcfclient is

1-created

2-opened

3-used

4-closed

5-Disposed

for every file that is distributed to a particular worker. It is highly inefficient, and will reduce speed performance.

The files are text files that the Workers will need to process. There will be 1000s of files being sent out every few seconds in a very rapid manner. Please keep in mind that it is in a distributed server network environment. Could someone please tell me how I should handle the creation and use of the WCF clients? To elaborate, I do Not want to keep creating,....,using,...disposing. How can implement the system so that it works quickly and efficiently, and does Not have WCF clients that make faulty connections?

crazyTech
  • 1,379
  • 3
  • 32
  • 67
  • 1
    Does your performance measurements indicate that the memory allocation, waiting for an socket from the pool and the garbage collection are on the hot path? In other words: you've maxed out every other bit on the execution pipeline, both client and server side? Does [PerfView](https://stackoverflow.com/questions/28717007/perfview-analyzing-performance-of-app-including-database-calls) confirm your hot path? What WCF binding are you using? Do know it is possible to re-use an wcf client but only if it is in a non-faulted state. – rene Jul 20 '19 at 07:57
  • I'm using BasicHttpBinding for binding – crazyTech Jul 22 '19 at 13:32
  • 1
    Can't you use a NetTCPBinding: https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/configuring-system-provided-bindings? It uses a binary formatter. It might perform slightly better as it doesn't need to translate much between SOAP/XML and the memory representation. – rene Jul 22 '19 at 13:59

0 Answers0