none
netNamePipeBinding and MaxConnections on IIS 7.5.7600.16385 RRS feed

  • Question

  • Hello Guys,

    i have a Webfarm with about 200 WCF Services, all communicating with each other, in a hierachically way.

    There are 30.000.000 Messages per hour everything working fine with httpbinding. As Performance optimization i want to disable Load Balancing once a Web-Farm-Node receives a request and at this point i want to switch to NetNamedPipeBinding.

    Using NetNamedPipeBinding causes some Issues and it does not work stable in long Term. When i use the Default Values from the Binding, it gives a "the message could not be dispatched because the service at the endpoint address '{0}' is unavailable for the protocol of the address." Exception

    Default Values:

    var binding = new NetNamedPipeBinding
          {
            TransactionFlow = true,
            MaxReceivedMessageSize = int.MaxValue,
            SendTimeout = new TimeSpan(0, 5, 0, 0),
            ReceiveTimeout = new TimeSpan(0, 5, 0, 0),
            ReaderQuotas = { MaxArrayLength = int.MaxValue, MaxBytesPerRead = int.MaxValue, MaxDepth = int.MaxValue, MaxStringContentLength = int.MaxValue, MaxNameTableCharCount = int.MaxValue }
          };


    Now when i adjust the Values of the Binding, like this:

          var maxBinding = new NetNamedPipeBinding
          {
            MaxConnections = int.MaxValue, 
            MaxBufferPoolSize = int.MaxValue, 
            MaxBufferSize = int.MaxValue, 
            TransactionFlow = true,
            MaxReceivedMessageSize = int.MaxValue,
            SendTimeout = new TimeSpan(0, 5, 0, 0),
            ReceiveTimeout = new TimeSpan(0, 5, 0, 0),
            ReaderQuotas = { MaxArrayLength = int.MaxValue, MaxBytesPerRead = int.MaxValue, MaxDepth = int.MaxValue, MaxStringContentLength = int.MaxValue, MaxNameTableCharCount = int.MaxValue }
          };

    It gives me directly a "System.OutOfMemoryException" but there is enough Physical Memory.

    When i adjust like this:

     const int maxSize = 1024 * 1024 * 30;
    
     var dynamicBinding = new NetNamedPipeBinding
          {
            TransactionFlow = true,
            MaxConnections = 128,
            MaxBufferPoolSize = 0,
            MaxReceivedMessageSize = maxSize,
            SendTimeout = new TimeSpan(0, 5, 0, 0),
            ReceiveTimeout = new TimeSpan(0, 5, 0, 0),
            ReaderQuotas = { MaxArrayLength = maxSize, MaxBytesPerRead = maxSize, MaxDepth = maxSize, MaxStringContentLength = maxSize, MaxNameTableCharCount = maxSize }
          };
    It work fins for some time, but then it gives a "the message could not be dispatched because the service at the endpoint address '{0}' is unavailable for the protocol of the address." Exception








    • Edited by thokar Wednesday, June 3, 2015 10:46 AM
    Tuesday, June 2, 2015 4:54 PM

Answers

  • Hi thokar,

    Based on your description, I know that you have modified the default value for the netNamePipeBinding, I wonder if you have adjusted the value in the client or service side or both side.

    >>System.OutOfMemoryException

    I will recommend use the Stream transfer mode instead of the Buffer transfer mode(default), in the default buffered-transfer mode, a message must be completely delivered before a receiver can read it. In streaming transfer mode, the receiver can begin to process the message before it is completely delivered. The streaming mode is useful when the information that is passed is lengthy and can be processed serially. Streaming mode is also useful when the message is too large to be entirely buffered.
    For how to enable the Stream transfer mode, please try to refer to the following article:
    https://msdn.microsoft.com/en-us/library/ms789010(v=vs.110).aspx .

    >>the message could not be dispatched because the service at the endpoint address '{0}' is unavailable for the protocol of the address

    Please try to enable the WCF Tracing to help find the detailed error information.

    The following configuration taken from MSDN can be applied to enable tracing on your WCF service.

    <configuration>
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true" >
            <listeners>
                 <add name="xml"/>
            </listeners>
          </source>
          <source name="System.ServiceModel.MessageLogging">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
          <source name="myUserTraceSource"
                  switchValue="Information, ActivityTracing">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
            <add name="xml"
                 type="System.Diagnostics.XmlWriterTraceListener"
                 initializeData="Error.svclog" />
        </sharedListeners>
      </system.diagnostics>
    </configuration>
    
    

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 3, 2015 8:25 AM
    Moderator