nextcloud / nextcloud-talk-recording

GNU Affero General Public License v3.0
12 stars 3 forks source link

Add clustering support for the recording server #3

Open danxuliu opened 1 year ago

danxuliu commented 1 year ago

How to use GitHub


Currently a single recording server can be configured in Nextcloud. Recording requires quite some CPU power to encode the video, so several recordings in parallel could overload a single server. A cluster of recording servers could be used to overcome that limitation.

In a first version a proxy/load balancer that has the same API (from the Nextcloud server point of view) as the recording server would be added. This proxy/load balancer would be configured in the Nextcloud settings, and it will redirect the recording requests to an specific recording server from those known to the proxy/load balancer. The proxy/load balancer would keep track of which recordings are being done in which server to send the appropriate stop requests.

The recording server could provide an endpoint to know its current load (either as in number of active recordings or based on actual system load) that the proxy/load balancer could use to decide where to place new recordings.

In a more advanced version the proxy/load balancer would also know about other proxy/load balancers and their recordings. This would make possible to set several proxy/load balancers in Nextcloud settings and randomly send the requests to one of them, trying with a different one if the request failed, to avoid a single point of failure if a single proxy/load balancer is configured and is not available.