none
WCF Buffer Pools: Channel sends versus receives? RRS feed

  • Question

  • Hello,

    I have been researching WCF buffer pools and have been able to find a good amount of content on it (i.e. how they are implemented, how to adjust them, etc, tips and tricks, etc...).  However, after all my research I am left with a point of confusion that I have not been able to clarify from the web content I have come across.  My general confusion at this point is are buffer pools only used with receiving messages (as most of the MSDN channel documentation seems to indicate), or are they also used at some point during sending messages?

    For instance if you look at the MSMQ binding MSDN content for MaxBufferPoolSize it details when receiving messages:
    http://msdn.microsoft.com/en-us/library/system.servicemodel.netmsmqbinding.maxbufferpoolsize.aspx

    If you look at the binding content for NetTcp binding for MaxBufferPoolSize it also implies message receiving (no mention of sending messages when using the binding).
    http://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpbinding.maxbuffersize.aspx

    So do these buffer pool settings make any impact when sending messages, such as when a buffer is required to encode/serialize message contents, or are they really ony used for service/callback scenarios when the channels are receiving/reading messages (i.e receiving a message or a message response)? 

    Thanks!


    • Edited by BotHead Tuesday, March 5, 2013 8:02 PM
    Monday, March 4, 2013 6:55 PM

Answers

All replies

  • Hi,

    From my understanding, the buffer pool you mentioned is work for both receiving message and sending message, whether you use buffered mode to transfer data or not, the serialization and deserialization operations require a cache process, you can set these properties(MaxArrayLength, MaxStringContentLength and MaxBytesPerRead) with ReaderQuotas of the binding, the settings has nothing to do with the buffer pool for receiving or sending message.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, March 6, 2013 3:28 AM
    Moderator
  • Thanks for the response Haixia.  I don't quite understand what the buffer pool would be used for on sending messages if not during encoding/serialization, because as I understand it after that has been done the object is already serialized into a buffer that will be sent.  Is it a new buffer that WCF uses to write all the SOAP envelope contents into including the buffer from the serialized object?  That would make sense I guess.

    Thanks!

    Wednesday, March 6, 2013 3:37 PM
  • Hi,

    The buffer pool I mean is when the WCF processes messages in buffered mode (this is the mode selected by default). As I said above, whetheryou use buffered mode to transfer data or not,the serialization and deserialization operations require a cache process.

    #TransferMode Enumeration

    http://msdn.microsoft.com/en-us/library/system.servicemodel.transfermode.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 8, 2013 1:37 AM
    Moderator