无法使用AppFabric 1.1调整NetPipe MaxConnections

时间:2013-07-03 01:22:42

标签: wcf appfabric

我有一个Web.API网站,与AppFabric / IIS 8.0中托管的本地WCF WF服务进行通信 - Server 2012

MVC控制器具有对本地.xamlx服务的服务引用

以下是服务配置的ServiceModel部分:

<system.serviceModel>
<bindings>
  <netNamedPipeBinding>
    <binding name="NetNamedPipeBinding.IVoiceService" maxBufferSize="65536" maxConnections="100">
      <security mode="None" />
    </binding>
  </netNamedPipeBinding>
</bindings>
<client>
  <endpoint address="net.pipe://localhost/Main.xamlx" binding="netNamedPipeBinding"
    bindingConfiguration="NetNamedPipeBinding_.IVoiceService"
    contract="Voice.IVoiceService" name="NetNamedPipeBinding.IVoiceService" />
</client>

WCF WF服务模型部分:

  <system.serviceModel>
<bindings>
 <netNamedPipeBinding>
    <binding name="pipeSecurityOff" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" maxReceivedMessageSize="65536">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport protectionLevel="None" />
      </security>
    </binding>
  </netNamedPipeBinding>
</bindings>
<services>
  <service behaviorConfiguration="MEX" name="Main">
    <endpoint address="MEX" binding="mexHttpBinding" contract="IMetadataExchange" />
    <endpoint address="MEX" binding="mexTcpBinding" contract="IMetadataExchange" />
    <endpoint address="" binding="netNamedPipeBinding" bindingConfiguration="pipeSecurityOff" contract="NYRA.IVoiceService" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="MEX">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <sqlWorkflowInstanceStore instanceCompletionAction="DeleteAll" instanceEncodingOption="None" instanceLockedExceptionAction="NoRetry" connectionStringName="ApplicationServerWorkflowInstanceStoreConnectionString" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05" />
      <workflowInstanceManagement authorizedWindowsGroup="AS_Administrators" />
      <workflowUnhandledException action="AbandonAndSuspend" />
      <workflowIdle timeToPersist="00:00:00" timeToUnload="00:00:00" />
      <etwTracking profileName="Troubleshooting Tracking Profile" />
      <serviceThrottling maxConcurrentCalls="256" maxConcurrentSessions="800" maxConcurrentInstances="928" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>

因此,如果您注意到绑定中缺少MaxConnections属性:

<binding name="pipeSecurityOff" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" maxReceivedMessageSize="65536">

如果我打开IIS 8.0并编辑端点,请转到性能选项卡并将最大连接数从10更改为100.它将使用以下命令更新web.config:

<binding transactionFlow="false" maxBufferSize="65536" maxConnections="100" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard" transactionProtocol="OleTransactions" transferMode="Buffered" name="pipeSecurityOff" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">

现在我收到一个错误:

  

此错误(HTTP 500内部服务器错误)表示您访问的网站存在服务器问题,导致网页无法显示。

日志显示:

<Message>There is no compatible TransportManager found for URI 'net.pipe://myuritemp/Main.xamlx/System.ServiceModel.Activities_IWorkflowInstanceManagement'. This may be because you have used an absolute address that points outside of the virtual application, or the binding settings of the endpoint do not match those that have been set by other services or endpoints. Note that all bindings for the same protocol should have the same settings in the same application.</Message>

您似乎应该可以更改此属性: http://msdn.microsoft.com/en-us/library/system.servicemodel.netnamedpipebinding.maxconnections.aspx

为什么在绑定中添加此属性会导致服务器崩溃?如何增加命名管道连接以获得更好的性能?

0 个答案:

没有答案