575 karma · joined May 20, 2016
I haven't had the time to add configurations for every server tested (esp. Apache & NGINX) but the main point here is to showcase the Node.js vs. Node.js with µWS perf. difference.
No, no you haven't. This is not a cluster of servers, this is one single thread serving 1 million responses per second. Inside of Node.js.
Sadly I cannot (yet) present the pub/sub benchmarks of deepstream.io vs Socket.IO but I promise you: it will be hilarious.
Other projects that have been shown to outperform Socket.IO include SocketCluster, which use µWS as the default engine.
I would recommend WebSocket++ or libwebsockets (if you are not going with µWebSockets).
Btw, 1.3 GB is for the Node.js addon - the native server does 1 million connections using less than 300 mb of user space memory.
Hint: at 500k ws consumes all memory in my computer and the GC stalls are constant. My system start to freeze and my mouse cursor is no longer responding.
I can have 1 million connections with uws at the same time I'm watching cat clips on youtube, listening to spotify and having my complete IDE up and running.
I've myself been interviewed by Google and yes, you cannot wake up an hour too late and go get a cup of coffee while simultaneously answering the questions in your pajamas (like I did). Sure you need to study some classic CS, but it's not really that overly difficult if you are a natural. They give you this list of subjects on which you are to self assess your skills so that you can get somewhat tailor made questions of what you feel strong in. Just go study basic CS stuff around those questions.
I failed because I did not have all the Big-O complexities and all the Unix syscalls in my head at that particular time, but you sure could go memorize them. It's all about passing those initial very basic tests so that they know you are worth their time - from that point you should get to show yourself a lot more.
But don't take advice from me, I'm not hired by Google.
libwebsockets is targeting the embedded world with a smaller code footprint (libc vs libstdc++). libwebsockets performs very good in memory and CPU time.
It passes all Autobahn tests, meaning it properly handles close frames & pings etc.
Timers are used to force close connections. The C++ HTTP server does not currently time out, but the Node.js HTTP server does, so this is one issue that needs to be fixed, yes.
We are working with SocketCluster to make µWS default in version 5, and I have gotten a lot of help from a lot of people during these months.
Thanks for support, I will be accepting PR's and receiving issues that we need to fix before making any kind of official stable release.
Also, try to ignore the hateful comments - these commenters build their cases on thin air, and if you actually do find anything you want to change - I will accept PR's that can be shown to improve the library.
There is a reason for these not to be enabled by default.
* Unused parameter -> rly? Who gives a damn? * Use of old style cast -> Well I'm old style, get over it. * No previous prototype declaration -> Again, I do this if I want to. * Shadows field -> who cares? No me. * Cast increases required alignment -> Well, obviously the perf cost is not an issue here. * Etc, etc, etc
These are pedantic warnings. However, this is an open source prject and you are free to send me PR's whenever you want.
Thank you, you will be missed. I don't know what to do without you.
You need to realize, that libuv itself was simply too heavyweight for this project. Think about that statement for a while.
This is why I use UNIX syscalls directly, and only use uv_poll_t, not the full-on uv_tcp_t. This is the level of optimizations we are talking about -> when libuv is considered too heavyweight...
When libuv becomes too heavyweight to keep up, having this discussion about how a Python async network library could implement similar performance is just purely ridiculous.
WARNING -> NO OFFENCE
My intentions were not to harm, that was why I said "no offence, but". I cannot more than explain myself. Sorry if I offended anyone (despite explicitly saying "no offence"). Someone should probably censor me, like, a lot.