none
Obtain Max Buffer Size RRS feed

  • Question

  • Hi,

      I have a WCF that get lots of data from client, I create transmitter mechanism that send collect/split messages/data into buffers and sent to WCF.

    Mean, I define a buffer of 4K bytes, and each call to WCF will send 4k.

    The idea is to be sure that small images will not sent one by one (to save over head of communication, acknowledge....) and split bigger images.

    So my question is:

    1. is there a way to know what is the WCF MAX buffer size that each message can be?, how?

    2. Can change it?

    3. If I know what is the current upload bandwidth, is it possible to change the MAX buffer related to this bandwidth?

    Thanks

    Tuesday, August 20, 2013 11:02 AM

Answers

  • Hi,

    >>1. is there a way to know what is the WCF MAX buffer size that each message can be?, how?

    If you do not set the MaxBufferSize and MaxReceivedMessageSize in the binding configure, then by defalut the MaxReceivedMessageSize is 65536 and the MaxReceivedMessageSize is 65536.

    >>2. Can change it?

    Yes, you can.

    >>3. If I know what is the current upload bandwidth, is it possible to change the MAX buffer related to this bandwidth?

    Yes, you can change it in the binding configure.
    For example you are using the basicHttpBinding, then you can change the MaxBufferSize and MaxReceivedMessageSize and others as you want. Please try to do as following:

    <basicHttpBinding>
      <binding name="BasicHttpBinding_MyApplication" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          maxBufferSize="1000000" maxBufferPoolSize="524288" maxReceivedMessageSize="1000000"
           transferMode="Buffered">
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
       
      </binding>
    </basicHttpBinding>

    Best Regards,
    Amy Peng


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, August 21, 2013 1:00 AM
    Moderator

All replies

  • Hi,

    >>1. is there a way to know what is the WCF MAX buffer size that each message can be?, how?

    If you do not set the MaxBufferSize and MaxReceivedMessageSize in the binding configure, then by defalut the MaxReceivedMessageSize is 65536 and the MaxReceivedMessageSize is 65536.

    >>2. Can change it?

    Yes, you can.

    >>3. If I know what is the current upload bandwidth, is it possible to change the MAX buffer related to this bandwidth?

    Yes, you can change it in the binding configure.
    For example you are using the basicHttpBinding, then you can change the MaxBufferSize and MaxReceivedMessageSize and others as you want. Please try to do as following:

    <basicHttpBinding>
      <binding name="BasicHttpBinding_MyApplication" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          maxBufferSize="1000000" maxBufferPoolSize="524288" maxReceivedMessageSize="1000000"
           transferMode="Buffered">
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
       
      </binding>
    </basicHttpBinding>

    Best Regards,
    Amy Peng


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, August 21, 2013 1:00 AM
    Moderator
  • thanks!
    Wednesday, August 21, 2013 5:07 AM