-
Notifications
You must be signed in to change notification settings - Fork 30k
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
node: unix sockets are slow in case of lots of small buffers #5095
Comments
What if you explicitly use |
@mscdex this is already in use but it does not change anything by removing it. |
Thanks for bringing this up. I had a similar experience in Node 0.10.36 about 11 months ago, but opted to use STDIO for my project. |
The way currently cork it's being currently done in node_redis is not the most efficient (as it is right now). Basically it calls cork/uncork multiple times during the same synchronous flow, effectively crossing the C++ barrier multiple times. @BridgeAR have you tried calling |
Using nextTick does not change the performance in my tests. It stays in the tolerance range after each test run. There might be a increase that I can't measure well because of the noise but it won't be significant. |
Run the same thing with http://npm.im/0x, and upload the results somewhere, so we can have a look. It might even be OS specific (maybe some tuning in the kernel). Be careful of not running it on OS X, I had some surprises when running stuff on Linux for production. |
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: nodejs#5095
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: #5095 PR-URL: #10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: nodejs#5095 PR-URL: nodejs#10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: nodejs#5095 PR-URL: nodejs#10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: nodejs#5095 PR-URL: nodejs#10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: nodejs#5095 PR-URL: nodejs#10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: #5095 PR-URL: #10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: #5095 PR-URL: #10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: #5095 PR-URL: #10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: #5095 PR-URL: #10677 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
While running the node_redis benchmarks with unix sockets I see a huge performance decrease opposed to TCP while pipelining lots of small buffers (4byte || 4kb) to the stream. The performance will drop to 50% of TCP while benchmarking the small buffers and increase by about 50% by using 4mb buffers opposed to TCP.
Writing strings to the stream stays about the same or increases the performance a tiny bit.
I tried to work out where the difference came from but this is handled in C and I have no clue about C.
As a side note: node_redis mixes buffers and strings while writing buffers to the stream. Strictly only using buffers does not change the outcome though.
Ping @trevnorris
The text was updated successfully, but these errors were encountered: