简体   繁体   English

WCF服务和IIS如何集成在一起,传入请求的体系结构和流程是什么

[英]How is a WCF Service and IIS integrated, what is the architecture and flow for incoming requests

I have been technically testing a WCF service recently and have got to the point where, my lack of understanding is not allowing me to progress forward and find a solution to a timeout problem we see. 我最近一直在技术上测试WCF服务,但是到了我无法理解的程度,我无法继续前进并找到解决超时问题的解决方案。

We are load testing a WCF Service which is hosted on IIS7 on windows server 2008. The system set up to fire the messages actually fires them at an application which is biztalk. 我们正在对Windows Server 2008的IIS7上托管的WCF服务进行负载测试。设置为触发消息的系统实际上是在biztalk应用程序中触发它们的。 Biztalk then process the messages and sends them on to the end point of the WCF Service. Biztalk然后处理消息,并将其发送到WCF服务的端点。 The WCF Serviceis also using .net 2.0 in it's app pool (I guess this means it could actually be 3.0 or 3.5 as these were not full releases? WCF服务还在其应用程序池中使用.net 2.0(我想这实际上可能是3.0或3.5,因为这些不是完整版本?

We fire 40 messages within a seconds and 90% of them become timed out due to the send timeout on the client (biztalk). 我们在一秒钟内触发了40条消息,其中90%的消息由于客户端(biztalk)的发送超时而超时。 We thought at first this was strange because we expected the server's basic http binding receive timeout to trigger first, but it turned out that was set at 10 minutes and the client send timeout was set at 1Min and 30 Secs. 起初我们以为这很奇怪,因为我们期望服务器的基本http绑定接收超时首先触发,但是事实证明,该时间设置为10分钟,客户端发送超时设置为1Min和30秒。

What I understand: 我的理解:

WCF Services have config files which have inside them behaviors and http bindings. WCF服务具有配置文件,其中包含行为和http绑定。 The Server end point we are sending an XML message to is using BasicHtppBindings: Timeouts:Open/Close is 1 Minute, Send and Recieve are 10 minutes. 我们要发送XML消息的服务器端点使用BasicHtppBindings:超时:打开/关闭为1分钟,发送和接收为10分钟。 The server's timeout which we know are involved so far is: sendtimeout: 1 minute. 到目前为止,我们所知道的服务器超时是:sendtimeout:1分钟。

I understand WCF's architecture works by creating an instance of either a channel factory or service host and creates a channel stack which contains the behaviors and binding settings from the config as channels. 我了解WCF的体系结构是通过创建通道工厂或服务主机的实例并创建通道堆栈来创建的,该通道堆栈包含配置中作为通道的行为和绑定设置。 There is a TransportAdaptor which is used to move the xml message once it has been processed through the channel stack. 一旦通过通道堆栈处理了xml消息,就会使用一个TransportAdaptor来移动它。

I understand from IIS that http.sys handles the incoming requests. 我从IIS知道http.sys处理传入的请求。 It passes requests to the workerprocess and when that is busy, it places requests onto the kernel mode queue? 它将请求传递给worker进程,当它繁忙时,将请求放入内核模式队列? I understand there some machine.config settings that can be set to increase this queue/limit this queue? 我知道有一些machine.config设置可以设置以增加此队列/限制此队列?

I also know about how to make an app pool into a webgarden and I have read you can increase the number of threads per core, from the default of 12; 我也知道如何将一个应用程序池变成一个Webgarden,并且我读过您可以增加每个核心的线程数,从默认值12开始; this is don e via a registry setting or a later on in .net a web config change. 这是通过注册表设置或更高版本的.net在Web配置中进行的。

I just read about InstanceContextMode and how it can effect the server's service too... But I'm unsure what that is set to in this case. 我刚刚阅读了InstanceContextMode以及它如何影响服务器的服务...但是我不确定在这种情况下该设置为什么。

We recorded some perforamance counters, .net ones and I noticed the number of current requests minus the (Queued+Disconnected) = 12. Which indicates we are using 1 core? 我们记录了一些性能计数器,.net计数器,我注意到当前请求的数量减去(Queued + Disconnected)=12。这表明我们使用的是1个内核? and the number of threads of on that core is set to 12. 并将该核心上的线程数设置为12。

Can anyone help me for a clearer picture and help piece my knowledge with some extra into something that is more complete? 谁能帮助我获得更清晰的画面,并通过一些额外的知识将我的知识分解为更完整的内容?

The WCF Behavior has a throttle setting. WCF行为具有油门设置。 Here is an example (grabbed from msdn ): 这是一个示例(取自msdn ):

  <service 
    name="Microsoft.WCF.Documentation.SampleService"
    behaviorConfiguration="Throttled" />

..... ..... ..... .....

<behaviors>
  <serviceBehaviors>
    <behavior  name="Throttled">
      <serviceThrottling 
        maxConcurrentCalls="1" 
        maxConcurrentSessions="1" 
        maxConcurrentInstances="1"/>
    </behavior>
  </serviceBehaviors>

By default (if not specified), the service is throttled to 10 concurrent calls. 默认情况下(如果未指定),服务被限制为10个并发调用。

I find that a sensible production setting for high volume clients running short calls is more like 100. Of course it depends on your implementation, but the defualt definitely hurts performance on my test and production systems. 我发现,对于运行短呼叫的大批量客户而言,合理的生产设置更像是100。当然,这取决于您的实现方式,但是默认设置无疑会损害我的测试和生产系统的性能。

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

相关问题 IIS上的WCF传入“不可见”请求问题 - WCF on IIS incoming “invisible” requests issue 在什么时候应使用ESB来管理传入的WCF服务请求? - At what point should ESB be used to manage incoming WCF service requests?H WCF服务是否使用多个线程来处理传入的请求? - Does WCF Service use multiple threads to process incoming requests? 如何在 IIS 7 上发布 WCF 服务 - How to publish WCF service on IIS 7 IIS上托管的WCF服务的输入方法是什么? - What is the entry method for WCF service hosted on IIS? 如何在IIS上配置WCF(svc)服务以仅对HTTPS请求提供服务? - How do I configure my WCF (svc) Service on IIS to serve on HTTPS requests only? WCF服务如何知道用于解密传入安全令牌的证书? - How does a WCF service know what certificate to use to decrypt an incoming security token? 在IIS中托管的WCF有很多打开请求,服务速度很慢 - WCF hosted in IIS has lots of open requests and the service is slow down 一旦将WCF服务托管在IIS中,它将停止发送Web请求 - WCF service stop sending web requests once it's hosted in IIS 对 WAS 托管的 WCF 服务的请求是否经过 IIS 处理管道或……的身份验证? - Are requests to a WCF service hosted by WAS authenticated by IIS processing pipeline or …?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM