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:

Rxjs Adoption Guide: Overview, Examples, And Alternatives

RxJS adoption guide: Overview, examples, and alternatives

Get to know RxJS features, benefits, and more to help you understand what it is, how it works, and why you should use it.

Emmanuel Odioko
Jul 26, 2024 â‹… 13 min read
Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 â‹… 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 â‹… 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 â‹… 5 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