Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase publish performance of small message ~500% #463

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jul 15, 2020

  1. Increase publish performance by writing all frames in one go

    By writing all 3 frames required for a publish in one go, and only
    locking and flushing the output buffer once we increase the performance
    about 3 times.
    
    Messages that spans over multiple body frames are still written one at a
    time, when messages are that large (>128KB) the locking and flushing is
    not the bottleneck, and it allows us to not allocate a dynamic array for
    each publish and allows us to use a fixed size array instead.
    carlhoerberg committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    27d2766 View commit details
    Browse the repository at this point in the history
  2. Enable Nagle's algorithm to increase publish performance of small mes…

    …sage
    
    By disabling TCP no delay (enable Nagle's algorithm) many small messages
    can be sent in a single TCP packet, we increase the publish rate about
    100% when messages are small.
    
    This will not increase latency in any normal circumstances, but
    theoretically could if for instance one channel is publishing a message,
    and another channel is declaring a queue and then waiting for the CreateOK
    response, then due to a delayed ack from the server a 40ms delay could
    be added to the wait of the Queue CreateOK.
    carlhoerberg committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    f81b916 View commit details
    Browse the repository at this point in the history