⋅ 7 min read

7 ways to improve Node.js performance at scale

Idorenyin Obong Software engineer with a flair for writing.

Recent posts:

8 Tips To Reduce Unused Javascript

8 tips to reduce unused JavaScript

Knowing how to reduce unused JavaScript can help you save time, optimize performance, and improve efficiency.

Abhinav Anshul
Nov 27, 2023 ⋅ 5 min read
Guide to mobile emulator testing with MiniSim

Guide to mobile emulator testing with MiniSim

MiniSim makes virtual emulator testing easy — learn how to use it to test both Android and iOS apps on macOS in this detailed post.

Emmanuel John
Nov 22, 2023 ⋅ 5 min read
Implementing safe, dynamic localization in TypeScript apps

Implementing safe, dynamic localization in TypeScript apps

After internationalization, you can further localize your apps to make user experiences more friendly. Learn how to do this in TypeScript.

Yan Sun
Nov 21, 2023 ⋅ 6 min read
Using Dev Containers In Vs Code For An Easier Dev Setup Process

Using dev containers with VS Code for an easier dev setup

You can leverage containers to streamline the process of setting up a dev environment. Let’s see how using VS Code and Docker.

Yashodhan Joshi
Nov 21, 2023 ⋅ 11 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