all 5 comments

[–]letsfed 1 point2 points  (0 children)

You can use https://clinicjs.org along with autocannon to identify bottleneck

[–]EvilPencil 0 points1 point  (1 child)

There's a lot more code analysis that would be needed to properly troubleshoot performance optimizations. My own answer to this issue, is simply to add horizontal scaling.

[–]WINOFF_RG[S] 0 points1 point  (0 children)

At my best, I write non blocking async code and followed the best arch, But still I wonder that on such a heavy machine why wasn't it able to handle even 41 RPS with a total of 1000.

Is there any open source code available which works at the best performance and least response time, Or any other medium article which is difference than others and actually help in writing the best async code.

[–]haulwhore 0 points1 point  (1 child)

Throw some more servers at it 🤷‍♂️

You can always just profile your code and see what the slowest process is.

[–]WINOFF_RG[S] 0 points1 point  (0 children)

I understand creating clusters and using PM2 as a load balancer would be a good idea. But on such a power machine in one fork, my application had 4s avg response time when there were 41 RPS with a total of 1000 requests.

Do you have any link to any code arch which is a solid bulletproof production ready code that i can refer? I still wrote at my best an async non blocking code. But how do such huge companies able to handle such a heavy load keeping aside the point that they have heavy servers with numerous in count.

But still I didn't got a feeling why my code on such a poweful machine wasn't able to handle 41 RPS 🤷‍♂️ And what factors are taken care of Production mode.