I’ve been gathering information on how to properly setup a mediasoup server. I have a couple of questions:
According to the docs, mediasoup workers run on a single thread. In respect to Nodejs, how do the workers get forked to utilise multiple cores ?
What’s the best way to store routers ? Redis might not work here, since router objects might not be serialisable. Is memory shared between mediasoup workers ?
The mediasoup JS launches a mediasoup-worker subprocess per Worker (JS) instance created via createWorker().
You cannot “store” a worker. You just deal with the Worker.js instance which is a common JavaScript class instance. You handle it in Node as any other object.
There is no shared memory. The Worker.js and it’s mediasoup-worker subprocess communicate one to each other via JSON message over UnixSocket. That’s internal stuff anyway you must not care about.