Live data from Hacker News

How Raygun increased throughput 20x with .NET Core over Node.js

raygun.com

21–30 of 61 posts

Re: How Raygun increased throughput 20x with .NET Core over Node.js

#22
post #14

Earlier quoted context omitted.

Some have already optimised the heck out of their data retrieval and writes.

> Some have already optimised the heck out of their data retrieval and writes Then they have likely not very much to gain from framework speedup either. The fact that raygun could introduce a "asynchronously hand off to our queuing service" says quite clearly that "already optimised data retrieval and writes" is not the case that we are talking about.

Asynchronously dropping something on to a queue, possibly leaves the queue client implementation as the suspect slowing node down.

But assuming that dropping something on to a queue is incredibly fast. Switching how you serve your http requests can increase performance by some multiples because it would be the largest constant in time taken assuming a very fast queue drop.

Although I agree, if your at that point your probably serving all your requests fine anyway.

Re: How Raygun increased throughput 20x with .NET Core over Node.js

#23

The fact that they were only getting 1k reqs/sec with Node gives me concern. It clearly shows something went wrong there very early on at a very fundamental level. By no means is Node the end-all be-all for performance by any measure, but you should definitely be getting much much higher throughput than 1k reqs/sec. Simply booting up a single core http server should net you around 4-5k requests per second. Spin up an…

> The fact that they were only getting 1k reqs/sec with Node gives me concern. It clearly shows something went wrong there very early on at a very fundamental level. Because the program is performing CPU compute for each request. Node is single threaded. It's a shame that the Node project killed off the multithreaded web workers pull request. It sorely needs that functionality. Pools of node processes are a poor subs…

Care to elaborate on why additional node processes are a poor substitute? They are really easy to reason about, and to manage. What are the downsides? Not trolling, really interested in hearing about pros/cons.

Re: How Raygun increased throughput 20x with .NET Core over Node.js

#24
post #8

Earlier quoted context omitted.

"Your web server is not the bottleneck." - Highly depends on your setup. But removing any 3rd party libraries, and external requests. Generally .NET core is faster.

Actually 3rd party libraries and application code is where .NET is likely to be faster unless node lib is wrapping a C library - .NET can easily beat JS an order of magnitude simply by having control of memory layouts and high performance/specialized data structures. Meanwhile JS has crap structures (doesn't even have primitive arrays) and everything is it's dynamic object where you pray the JIT eventually figures ou…

Just to nitpick a bit, JS does have primitive arrays using TypedArray.

Re: How Raygun increased throughput 20x with .NET Core over Node.js

#25
I'm a .NET fan, but it sounds strongly like these guys knew what they were doing on .NET and not so much on node. It's amazing how many of these rewrite stories actually boil down to "and the new version didn't do some incredibly dumb things the old one did".

If you really wanted throughput and large numbers of simultaneous connections, you'd be looking at Erlang, anyway.

Re: How Raygun increased throughput 20x with .NET Core over Node.js

#26

This, and the AgeOfAscent piece it links to, both read like PR pieces commissioned by Microsoft. Both are absent of actual information to really determine what exactly they were testing, or what this means to anyone else's problem space. Because, of course, when you get to the fun of benchmarks there's always a faster options. With .NET Core offering them 20,000 requests per second (on a C3.large), that is a terribly…

It's an MS 'Customer Story' so it is a press release.

Re: How Raygun increased throughput 20x with .NET Core over Node.js

#27

The fact that they were only getting 1k reqs/sec with Node gives me concern. It clearly shows something went wrong there very early on at a very fundamental level. By no means is Node the end-all be-all for performance by any measure, but you should definitely be getting much much higher throughput than 1k reqs/sec. Simply booting up a single core http server should net you around 4-5k requests per second. Spin up an…

> The fact that they were only getting 1k reqs/sec with Node gives me concern. It clearly shows something went wrong there very early on at a very fundamental level. Because the program is performing CPU compute for each request. Node is single threaded. It's a shame that the Node project killed off the multithreaded web workers pull request. It sorely needs that functionality. Pools of node processes are a poor subs…

Looking at my Prometheus stats right now, I've got a Node TCP server doing 12k concurrent connections with 3-5% CPU and 130 MB memory. At least 4 DB queries are done per request, sometimes 10 queries. Raygun either has some nonobvious stuff going on, or Microsoft paid them to write PR fluff. After 6 years with Node it seems odd for their performance to be so bad. They should dive into more technical details to explain what specifically was made faster.

Re: How Raygun increased throughput 20x with .NET Core over Node.js

#29
Obviously they did something terribly wrong in the first place and now are showing off being all right. Netty would probably faster. As there're no details at all, I feel free to just guess :-).

I recently found Node much faster then .NET Core for a very specific scenario:

Elasticsearch - Node / ASP.NET Core (Kestrel) - NGINX - Client

where every connection must be TLS. So, Node / ASP.NET Core have to decrypt traffic from Elasticsearch and encrypt to NGINX. For a minimal workload the whole trip took 50 ms with .NET Core and 20 ms with Node. Obviously there's something wrong with the .NET setup - maybe some setting with Kestrel and TLS.

Anyway, that's my anecdote. And I wouldn't dare writing a block post how node is 2,5 times faster than .NET.

Re: How Raygun increased throughput 20x with .NET Core over Node.js

#30

Earlier quoted context omitted.

Actually 3rd party libraries and application code is where .NET is likely to be faster unless node lib is wrapping a C library - .NET can easily beat JS an order of magnitude simply by having control of memory layouts and high performance/specialized data structures. Meanwhile JS has crap structures (doesn't even have primitive arrays) and everything is it's dynamic object where you pray the JIT eventually figures ou…

Just to nitpick a bit, JS does have primitive arrays using TypedArray.

This is a good point - it's also why you can still optimize JS on microbenchmarks but for real world code where you'd want to use an array of structs in say C# for eg. there's just no JS equivalent other than write obfuscated stuff around typed arrays.
Post reply on HN