views:

168

answers:

2

Following on from this question:

http://stackoverflow.com/questions/334472/run-wcf-servicehost-with-multiple-contracts

Are there any performance penalties from running multiple service hosts as suggested in one of the answers?

I am looking at implementing a solution with 4-5 service contracts, and could define one class implementing the contracts as chilltemp's suggestion, or run 4-5 service hosts each hosting one service contract as Chris Porter's suggestion.

I would prefer to run multiple service hosts for a bit more flexibility but I wondered if there was any performance penalty to starting these hosts?

Thanks in advance,
Will

+2  A: 

How are you hosting them? IIS? Windows service? Console app? In almost all cases once the services spin up you are not going to see much performance difference between running them as one service or running them as independent services.

Andrew Hare
+1  A: 

The only advantages that I can see is if one or more contracts has operations that require a ton of processing time. Then separating it into it's own service would allow you to host that one service on a separate machine. Hosting them all on the same machine doesn't seem like something that will yield better results than putting all the contracts into one service.

Although it IS a great idea to split it into multiple services if the contracts aren't very related and/or coupled to each other some kind of way. You'll get better reusability that way.

Terry Donaghe