简体   繁体   English

WCF并发模式因为在IIS 6.0中不起作用

[英]WCF Concurrency mode as multiple not working in IIS 6.0

I am a newbies programming WCF in .net. 我是.net中编程WCF的新手。 Recently, I worked on one of the WCF project which responds bytes of image file to the client. 最近,我从事一个WCF项目,该项目将图像文件的字节响应给客户端。 Everything worked fine but the performance. 一切正常,但性能。 Although the service is built on with concurrency mode as parallel, it puts all the requests in queue. 尽管该服务是基于并行的并发模式构建的,但是它将所有请求放入队列中。 Thus, if 5 requests are in queue, the last request has to wait 5X (15 sec instead of 3 sec). 因此,如果队列中有5个请求,则最后一个请求必须等待5倍(15秒而不是3秒)。 The msdn blog: http://social.msdn.microsoft.com/Forums/en/wcf/thread/861ea6f7-6c4e-4c3f-abde-ae60228244ea explains about similar problem. msdn博客: http : //social.msdn.microsoft.com/Forums/en/wcf/thread/861ea6f7-6c4e-4c3f-abde-ae60228244ea解释了类似的问题。 But the solution was not helpful to me. 但是解决方案对我没有帮助。 I would like to thank in advance to you all for any suggestion/help. 我要在此先感谢大家的任何建议/帮助。

Firstly, if at all possible, I recommend using IIS7 on Server 2008+ if at all possible. 首先,如果可能的话,我建议尽可能在Server 2008+上使用IIS7。 Its capabilities far exceed IIS6'. 它的功能远远超过IIS6'。 If you're unable to use IIS7 ... 如果您无法使用IIS7 ...

Be sure you've configured you website hosting your WCF services as a web garden . 确保已将托管WCF服务的网站配置为网络花园 This allows multiple worker processes to process incoming requests. 这允许多个工作进程处理传入的请求。 This overcomnig situations where the ASP.NET thread-pool saturates/blocks, resulting in requests being queued while the single worker process churns through each request in sequence. 这种过度通信的情况是ASP.NET线程池饱和/阻塞,导致请求排队,而单个工作进程按顺序遍历每个请求。

Secondly, as the article you point to states, be sure to boost the number of concurrent threads ASP.NET is configured to handle. 其次,正如您在文章中所指出的那样,请确保增加ASP.NET配置为处理的并发线程数。

Note, if your code is calling into code that serializes work to a single blocking thread (eg COM objects written in VB6 that perform ANY string manipulation), then it doesn't matter how many worker threads you configure - they'll all be serialized down to one thread (since VB6's string routines are single-threaded)! 注意,如果您的代码正在调用将工作序列化为单个阻塞线程的代码(例如,用VB6编写的执行任何字符串操作的COM对象),则配置多少个工作线程都没有关系-它们都将被序列化最多一个线程(因为VB6的字符串例程是单线程的)! This is why the web-garden & multiple worker processes configuration is so important. 这就是为什么Web花园和多工作进程配置如此重要的原因。

HTH. HTH。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM