2020-06-10
2011
#node
Idorenyin Obong
19984
Jun 10, 2020 â‹… 7 min read

7 ways to improve Node.js performance at scale

Idorenyin Obong Software engineer with a flair for writing.

Recent posts:

Nx Adoption Guide: Overview, Examples, And Alternatives

Nx adoption guide: Overview, examples, and alternatives

Let’s explore Nx features, use cases, alternatives, and more to help you assess whether it’s the right tool for your needs.

Andrew Evans
Mar 28, 2024 â‹… 9 min read
Understanding Security In React Native Applications

Understanding security in React Native applications

Explore the various security threats facing React Native mobile applications and how to mitigate them.

Wisdom Ekpotu
Mar 27, 2024 â‹… 10 min read
Warp Adoption Guide: Overview, Examples, And Alternatives

warp adoption guide: Overview, examples, and alternatives

The warp web framework for Rust offers many enticing features. Let’s see when and why you should consider using warp in your projects.

Ukeje Goodness
Mar 26, 2024 â‹… 8 min read
Integrating Next Js And Signalr For Enhanced Real Time Web App Capabilities

Integrating Next.js and SignalR to build real-time web apps

In this tutorial, you’ll learn how to integrate Next.js and SignalR to build an enhanced real-time web application.

Clara Ekekenta
Mar 25, 2024 â‹… 8 min read
View all posts

2 Replies to "7 ways to improve Node.js performance at scale"

  1. With respect, zero of these suggestions are how to “improve node.js performance” at scale; they are “some ways of sometimes improving REST APIs sometimes”. With that in mind, you raise some fair points, but stop short of explaining why they are useful
    1. You don’t explain why bundling is useful. Is it to speed up the client? While useful, that’s not “improving node.js performance”. Is it to reduce load on the server by sending smaller files? Maybe.
    2. SSL/TLS is slower and more work for your node.js server, this does not improve performance, but when used with HTTP/2, eh, fair. This left me wondering what performance improvement there was, ram/CPU/perf; a graph or some stats would be nice to back up your claim?
    3. Caching is fair, but once again this is a pretty niche situation where you’re using node.js to serve static files – the proper optimization is to use a dedicated nginx server to host static files, and node.js to handle custom logic
    4. Ultimately your conclusions make sense (consider pagination/filters/graphql), but half of the sentences don’t make sense – you throw in the word “optimize” into every sentence like you’re trying to do SEO
    5. Once again this is very specifically how to scale a web server, NOT a node.js program or increase performance. There are so many things you should first consider before just “throwing more servers on it”, but this section is maybe useful
    6. This really has nothing to do with performance. You clearly know your stuff on it, so maybe write a separate post going into details here, but this is nothing to do with performance, scaling or optimizations
    7. Websockets may improve performance, but only typically in niche situations, and in most cases solve a different problem. If your client is making a few, small requests very infrequently, there’s no point in keeping an active TCP socket open and will instead waste resources on the server
    Though you clearly know some stuff, and you raise a lot of solutions, just not to any of the problems you list. You also dive too deep into topics then leave them hanging. I’d recommend you pick a topic, e.g. caching, or advantages of websockets, or any of them really, and write a full post explaining it. Finally, the title is super misleading – node.js is so much more than building rest APIs for websites, and increasing performance is often none of the things you have listed – you haven’t even defined what sort of performance: speed/ram/CPU/overall cost, etc., which are you trying to solve?

  2. Your words make sense. Thanks for this.

    Question could be, API has some requests and resources are used fully.

    How should one optimize the server, user has no more money to buy anything else?

Leave a Reply