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

Is Nagle's algorithm disabled? #40

Closed
umar-frag opened this issue Jan 20, 2014 · 4 comments
Closed

Is Nagle's algorithm disabled? #40

umar-frag opened this issue Jan 20, 2014 · 4 comments

Comments

@umar-frag
Copy link

I want Nagle's algorithm disabled on the socket connection. Is it already disabled? If not then how can I access the socket to disable it?

@squaremo
Copy link
Collaborator

It's not disabled at present. I note that other RabbitMQ clients tend to switch it off (e.g., https://github.com/rabbitmq/rabbitmq-java-client/blob/master/src/com/rabbitmq/client/ConnectionFactory.java#L492)

So, I think I shall

  1. Switch it off in sockets; and,
  2. Provide an option (to createConnection etc.) to keep it on

@squaremo
Copy link
Collaborator

OK, fixed in 854b175.

It's not clear that disabling Nagle leads to a performance boost, so I've left it enabled by default. Disable it by providing {noDelay: true} in connection options; e.g.,

var ok = require('amqplib').connect('amqp://localhost', {noDelay: true});

@umar-frag
Copy link
Author

That was quick. Thanks a lot!

@squaremo
Copy link
Collaborator

No problem. It might take a bit longer to make it into a release, since I tend to wait until there's a few enhancements, or critical fixes, before I roll releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants