0

クライアントが通知を受信するように登録する二重対応サービスがあります。同じ AppPool に、クライアントがサーバーと通信するために使用する別の通常の Web サービスがあります。この Web サービスに何かを送信すると、接続されているすべてのクライアントに通知がトリガーされます。12、13、またはそれ以上のクライアントが接続されるまで、すべてが正常に機能します。次に、二重チャネルでのサブスクライブ/受信と、他のサービスへの送信の両方が非常に遅くなります。asp.net の互換性を無効にしましたが、Web サービス プロジェクトに global.asax ファイルがありません。これにより、セッションがトリガーされて速度が低下する可能性があります。

私の Web サービスは、Windows Server 2008 上の IIS7 でホストされています。私のクライアントは SL4 を実行していますが、Web サービスは .NET 3.5 でホストされていることに注意してください。

ここに、私の web.config ファイルからの抜粋をいくつか示します。

<bindingExtensions>
<add name="pollingDuplexHttpBinding" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,System.ServiceModel.PollingDuplex, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />      </bindingExtensions> 



<pollingDuplexHttpBinding>
    <binding name="pollingDuplexHttpBindingConfig"/>
  </pollingDuplexHttpBinding> 



 <service name="WcfDuplexService.NotificationService"
           behaviorConfiguration="ServiceBehavior">
                            <!-- Service Endpoints -->
                            <endpoint address=""
              binding="pollingDuplexHttpBinding"
              bindingConfiguration="pollingDuplexHttpBindingConfig"
              contract="WcfDuplexService.INotificationService"
              behaviorConfiguration="ServiceFullEndpointBehavior">
                            </endpoint>
                            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
                    </service>




<!-- Message Service -->
  <service name="WcfDuplexService.MessageService" 
           behaviorConfiguration="ServiceBehavior">
    <endpoint binding="customBinding"
              bindingNamespace="http://csintra.net/MessageService"
              contract="WcfDuplexService.IMessageService"
              bindingConfiguration="binaryHttpBinding"
              behaviorConfiguration="ServiceFullEndpointBehavior">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service> 


<serviceBehaviors>
                            <behavior name="ServiceBehavior">
      <serviceThrottling maxConcurrentCalls="1024" maxConcurrentSessions="1024" maxConcurrentInstances="1024" />
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->

      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
                    </serviceBehaviors> 

前もって感謝します。

4

1 に答える 1

0

以前も同じ問題がありました。

あなたの設定を除いて、あなたが今説明したことはすべて問題ないようです。サービスのバインド構成で、非アクティブ タイムアウト、オープン/クローズ タイムアウトを指定していません。それに応じて設定してください。msdn で何が機能するかを確認できます。

一度に 1 つのインスタンスのみを試してください。ただし、複数の同時実行モデルを使用します。負荷テストの後、私たちのケースではそれがより良いアプローチであることがわかりました。

デュプレックス サービスの負荷テストを行います。負荷テスト中にパフォーマンス カウンターをチェックして、サーバーで何が起こっているかを確認し、RAM/プロセッサに問題があるかどうかを確認してください。IIS ワーカー プロセスは停止していますか? これらのことをチェックしてください。

パフォーマンス カウンターについて Google で検索できます。

WCF トレースを有効にします!!! 内部に飛び出していない問題がある可能性があります。

アプリケーションにカスタム トレースを実装して、何が起こっているかを確認します。(オプションですが、私たちの場合は非常に役に立ちました。)

Duplex サービスのアーキテクチャ/設計を見直します。

msdn の WCF デュプレックス サービス パフォーマンス ガイドラインのガイドラインを参照してください。(非常に役立ちます)

同時実行モード = マルチおよびインスタンス = 1 に設定している場合は、サービスのマルチスレッド モデルを有効にします。

よろしく、

マザール・カリミ

于 2010-10-27T09:55:16.990 に答える