0

I have a desktop app that uploads 10 jpegs of size 2000 bytes in 1 second via my web service which is hosted under IIS

The Operation Contract is 1 way (ie not duplex) and I use MTOM in the binding.

Will there be any performance gain if I self-hosted it instead under a Windows Service?

Andrew Simpson
  • 6,883
  • 11
  • 79
  • 179
  • I suggest having a look at the answer given by marc_s here http://stackoverflow.com/a/1560784/569662. Basically you need to make a decision based on what your requirements are for response times vs IIS features. – tom redfern Jul 15 '15 at 16:34

2 Answers2

0

There is a question with a interesting analyse about using different bindings for streaming data:

Streaming with WCF and MTOM

Community
  • 1
  • 1
Ricardo Pontual
  • 3,749
  • 3
  • 28
  • 43
  • Hi, thanks for that link. I cannot rely on net.tcp bindings because it is not an intranet application. The bindings I use already I believe are the best I can use. I am more interested in whether hosting the wcf service outside IIS will give me any performance gain – Andrew Simpson Jul 15 '15 at 14:48
  • I got. It won't be relevant performance between different hosts with same bindding, but IIS has more resources to administrate your application, like memory and cpu usage, recycling, etc. – Ricardo Pontual Jul 15 '15 at 14:58
  • @RicardoPontual. IIS has more resources like memory and CPU? So are you saying that a thread running in a w3wp worker process somehow has access to more memory and CPU than a thread running in a windows service? This statement is incorrect and your answer does not address the OP's question – tom redfern Jul 15 '15 at 16:31
  • @TomRedfern no, it's not what I mean, I'm saying that IIS can control of the limit of memory and cpu per application pool, what is more difficult to manage from as windows service for example. – Ricardo Pontual Jul 15 '15 at 16:34
  • OK apologies for misunderstanding – tom redfern Jul 15 '15 at 16:48
  • @TomRedfern no problem, reading my comment, it was not so clear:) – Ricardo Pontual Jul 15 '15 at 17:06
0

You may get improved response times because the ServiceHost will already be loaded into memory and ready to receive calls. This is not true of IIS hosting which may unload the appdomain during times of low traffic. So when a call does come in IIS will need to fire up the ServiceHost before it can process your call.

However, IIS provides you with some useful features such as reliability - a windows service can just crash and remain down for as long as it takes someone to notice.

tom redfern
  • 30,562
  • 14
  • 91
  • 126