Nican on Nostr: Node.js is such a performance metrics nightmare. This is a problem that I feel like ...
Node.js is such a performance metrics nightmare. This is a problem that I feel like only node.js has.
In other application environments, C#/Java/Go/PHP (And even Python to an extent), when a thread is doing some heavy CPU work, other threads in the pool can still handle the remaining work, and not cause any nightmares.
In Node.js though, if you have a single function that blocks the event loop, the whole process is fucked. No other work get done, until the one non-async function gives control back to the event loop.
I just installed Grafana Tempo on our application, and I am seeing large gaps between two SQL calls, and I have literally no idea why there is such a delay. I have no idea what the web server was doing for 500ms until the next SQL call got made.
And the web server is at like 5% CPU usage, so it is not like the there is heavy work going on.
In other application environments, C#/Java/Go/PHP (And even Python to an extent), when a thread is doing some heavy CPU work, other threads in the pool can still handle the remaining work, and not cause any nightmares.
In Node.js though, if you have a single function that blocks the event loop, the whole process is fucked. No other work get done, until the one non-async function gives control back to the event loop.
I just installed Grafana Tempo on our application, and I am seeing large gaps between two SQL calls, and I have literally no idea why there is such a delay. I have no idea what the web server was doing for 500ms until the next SQL call got made.
And the web server is at like 5% CPU usage, so it is not like the there is heavy work going on.