Any way to double-check that utf-validate and bufferutil are being used? #4134
-
I'm seeing 3x the CPU load between two servers with the same number of users. These servers score identically on single-threaded benchmarks (One is Intel the other is AMD). They both have bufferutil and utf-validate installed. Is there a way for me to check if they are both using the libraries, and what could be anothe reason for the massive performance gap between them? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I ran some profiling and it seems |
Beta Was this translation helpful? Give feedback.
-
I think you can check by going into the $ node
> require('node-gyp-build')(".")
// should print "{ mask: [Function], unmask: [Function] }" If it throws, that means it's the JS implementation that is used instead of the native one. |
Beta Was this translation helpful? Give feedback.
-
Thank you. Seems like it's being used. 97% of the profiling time is spent in C++ code so I guess everything is working as it should. Guess I'm just running into the limits of putting stuff on the wire with socketio. You probably can't answer this, but do you think it's reasonable for the following workload to consume 50% cpu of a single core, on modern hardware?
Very very roughly speaking. |
Beta Was this translation helpful? Give feedback.
I think you can check by going into the
node_modules/bufferutil
directory, and then run:Reference: https://github.com/websockets/bufferutil/blob/330205e62cf079371438c2ddc2082931a703e6a1/index.js#L4
If it throws, that means it's the JS implementation that is used instead of the native one.