uWebsockets.js server much slower if host wasn't passed to listen #1055
-
Hello dear authors and community. I did some benchmarks last days against uWebsockets server for simple "Hello, World!" example on my MacBook M1 Pro (16GB) using both wrk and bombardier load testing tools. And it may sounds strange, but after dozens of attempts I constantly get much lower throughput when I just use server.lisnen(port, callback) instead of server.listen("0.0.0.0", port, callback). In terms of magnitude that is ~120K/s without passing host and ~180-200K/s for explicit host parameter passing. I also noticed this effect in Bun (built on top of uWebsockets), that passing hostname explicitly make throughput much higher. Is it something related to MacOS or what? I will be grateful for your explanation. P.S the version of uWebsockets is 20.43.0. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
0.0.0.0 is an IPv4 address. So without it you most likely listen over IPv6 which could be slower in your case (for whatever reason) |
Beta Was this translation helpful? Give feedback.
-
no difference on linux |
Beta Was this translation helpful? Give feedback.
0.0.0.0 is an IPv4 address. So without it you most likely listen over IPv6 which could be slower in your case (for whatever reason)