开发者

Concurrency of thread

I have a WCF application (vb) which works fine b开发者_如何学运维ut when a user requests information while the server is doing a call to another user, everybody hangs!


When you configure your service, there are two things you need to configure:

  • InstanceContextMode - which determines how many service instances are created to service the client requests, try use PerCall/PerSession if possible as they allows for the most concurrency.
  • ConcurrencyMode - which determines if each service instance is single-threaded or multi-threaded.

Based on the information you've provided so far, I'd recommend changing these two settings and see if it solves your problem:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall,
                 ConcurrencyMode = ConcurrencyMode.Multiple)]
public class MyService : IMyService { ... }

I put a blog post together of the things I learnt whilst doing some performance work on our WCF services a little while back, maybe it'd be of help:

http://theburningmonk.com/2010/05/wcf-improve-performance-with-greater-concurrency/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜