Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1523

[proton c] API unclear how incoming_capacity and max_frame work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Done
    • proton-c-0.17.0
    • None
    • proton-c
    • None

    Description

      Two settings are available to throttle incoming traffic. These operate in units of bytes:

      • pn_transport_set_max_frame
      • pn_session_set_incoming_capacity

      Suppose a user sets a max_frame to 1 Mbyte and incoming_capacity to 2 Mbytes. How many 200-byte hello-world messages might a user expect to be able to receive before the local incoming-window closes? 10,000? The answer turns out to be 2.

      The logical disconnect is that the user interface incoming_capacity operates in bytes but the AMQP protocol over the wire operates with an Incoming-Window in frames. In the user's case the API assumes full frames and sets Incoming-Window = (incoming_capacity / max_frame), or 2. When the sending peer sends 200-byte messages the actual incoming capacity is 400 bytes and not 2Mbytes.

      The rules (AFAICT) are:

        IF (max_size is specified)
          incoming_window = incoming_capacity / max_size
        ELSE
          incoming_window = 2147473647
        ENDIF
      

      Noting:

      • Incoming capacity is achieved only if the peer sends max_size frames.
      • If max_frame is not set then the incoming_capacity setting is ignored.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chug Charles E. Rolke
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: