Report this

What is the reason for this report?

Nodejs app platform event loop

Posted on June 11, 2022

I currently have a few apps deployed on app platform with NodeJS, some are microservices while others are more front-end.

My question is, how does app platform handle the event loop and traffic.

For example.

App 1 is a crud type app, lets say we are running 2 ‘apps’ for this application, so essentially there are ‘2’ event loops.

Question being, how does app platform know what ‘app’ to send the request to, in regards to what event loop has less in the que? Generally speaking the event loop is not clogged up, but I have noticed sometimes that a ‘request’ may take longer to return the results, leading me to think something is blocking the event loop or there is some congestion there but the odd thing is, there was only one other user at the time of testing, but two ‘apps’ running?

The only thing I can think of is the router may only be looking at resource consumption and because container 1 had low CPU / Memory, it just sent traffic to the same ‘app’ however that app may have more hanging around in the event loop then the idle app.

I hope that make sense, I’m trying to wrap my head around that and how the routing is actually working. I feel like the router should be sending traffic to the instance that has the least connections or traffic to ensure proper balancing but I’m not sure if that is the case.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.