Is there a way to tell how loaded a particular Worker is?

I want a simple number in arbitrary units, but uniform in the sense that of any two workers the one with a higher metric is more probably to start lagging/drop frames/introduce artifacts/crash, simply put, demonstrate lack of sufficient CPU resources.

How do i pull or calculate such a number?

Thanks!

No magic. That’s your task :slight_smile:

We provide this:

https://mediasoup.org/documentation/v3/mediasoup/api/#worker-getResourceUsage

Don’t ask me please what those fields mean.

You also have the worker.pid and can use other NPM libs to get process resource usage given a PID.

stime and utime are clearly “sys” and “usr” time which https://linux.die.net/man/1/time would print for the worker process if it was to terminate at that point. which is good enough. thanks!

1 Like