Scalability



OpenVidu Pro architecture 🔗

OpenVidu Pro consists of different nodes that work together to offer OpenVidu services in a distributed and scalable way. Currently, OpenVidu Pro has two types of nodes, following a Master-Slave model:

  • OpenVidu Server Pro Node: this is the master node. It takes care of the signaling plane. Manages OpenVidu sessions, forwarding events and messages to clients and distributing the load across the available Media Nodes.

  • Media Nodes: these are the slave nodes, in charge of managing the media plane. For that reason, Media Nodes are the actual bottleneck of the OpenVidu cluster and the ones that determine its capacity: more Media Nodes means more concurrent OpenVidu sessions. Two important aspects of Media Nodes:
    • Each OpenVidu session is currently hosted in one Media Node.
    • Each Media Node can manage multiple OpenVidu sessions.



Pricing of an OpenVidu Pro cluster 🔗

The price of an OpenVidu Pro cluster is rather simple:

You pay 0.0006$ per core per minute in your OpenVidu Pro cluster

There are 3 important aspects to consider:

  1. You only pay for your OpenVidu Pro cluster for the time it is running. Usage will be registered the moment you start your cluster and will stop as soon as you shut your cluster down.
  2. You pay for every available core at any given time: if you cluster grows for one hour, that hour you will pay more. If your cluster decreases the next hour, next hour will be cheaper. Currently all Nodes have the same core per minute price.
  3. Your cluster (specifically your OpenVidu Server Pro Node) needs Internet access at all times. If your specific use case doesn't allow your cluster to have Internet access, please contact us through Commercial page.

In Pricing section you will find a detailed with different use cases of OpenVidu Pro clusters and their associated cost depending on their size and running time



How to deploy your OpenVidu Pro cluster 🔗

Different environments are supported when deploying an OpenVidu Pro cluster. At the current moment you can:

We are currently working to natively support other cloud providers such as Azure, Google Cloud and Digital Ocean the same way we support Amazon. But remember you are still able to deploy OpenVidu Pro wherever you want following the guide of deployment on premises

Kubernetes support will also be available soon. Stay tuned!



Set the number of Media Nodes on startup 🔗

When deploying your OpenVidu Pro cluster, you can set the initial desired number of Media Nodes. Each type of deployment has a way of setting this number. Visit your specific OpenVidu Pro cluster deployment instructions to learn more:



Change the number of Media Nodes on the fly 🔗

You can launch and drop Media Nodes dynamically in two different ways:

From OpenVidu Inspector 🔗

In Cluster page you can launch and drop Media Nodes just by pressing buttons.

With OpenVidu Pro REST API 🔗

You can programmatically launch and drop Media Nodes from your application by consuming OpenVidu Pro REST API.

WARNING: depending on the environment where your OpenVidu Pro cluster is deployed, you must take into account some important aspects regarding the launch and drop of Media Nodes. Visit the specific documentation page for your environment:



OpenVidu Pro cluster events 🔗

OpenVidu Pro provides an specific server-side event that will inform you every time there is a change in the status of the cluster. You can listen to this event by using OpenVidu Webhook (it will also be registered in OpenVidu CDR).

This event is mediaNodeStatusChanged. By listening to it you will have a complete record of your OpenVidu Pro cluster behavior in real time. And of course you can always use OpenVidu Pro REST API to retrieve the status of the whole cluster at any time.

Media Node statuses 🔗

Here are all the possible statuses of a Media Node within an OpenVidu Pro cluster.

  • launching: the Media Node is launching
  • failed: the Media Node failed to launch. This status can be reached from launching status.
  • running: the Media Node is up and running. New sessions can now be established in this Media Node. This status can be reached from launching and waiting-idle-to-terminate statuses.
  • waiting-idle-to-terminate: the Media Node is waiting until the last of its sessions is closed. Once this happens, it will automatically enter terminating status. The Media Node won't accept new sessions during this status. This status can be reached from running status.
  • terminating: the Media Node is shutting down. This status can be reached from running and waiting-idle-to-terminate statuses.
  • terminated: the Media Node is shut down. This status can be reached from terminating status. For OpenVidu Pro clusters running in manual mode (property OPENVIDU_PRO_CLUSTER_MODE set to manual), this status means that the Media Node instance can be safely shut down.



How many users can an OpenVidu Pro cluster handle 🔗

This is probably one of the most important questions when using OpenVidu Pro. The number of Media Nodes you need and the size of each Media Node depends on the answer. Therefore, the price of your OpenVidu Pro cluster also depends on the answer.

That being said, there is no single answer to this question. The load each Media Node can handle depends on many factors:

  • The topology of each OpenVidu Session (1:1, 1:N, N:M)
  • The type of media streams being published to the Session (only audio, only video, audio + video)
  • Whether your Sessions are using advanced features such as recording or audio/video filters

You will need to perform some tests for your specific use case, and adapt the size of your cluster accordingly. OpenVidu team can perform these tests for you as part of their commercial services (contact us through Commercial page to ask for an estimate).

For a quick reference, these are the results of some load tests performed in an OpenVidu Pro cluster deployed on Amazon Web Services with just 1 Media Node. These particular scenario is testing 7-to-7 sessions where every participant sends one audio-video stream (540x360, 30 fps) and receives 6 remote streams (same video). The table states the maximum number of entities that can be established until the Media Node CPU reaches 100% use. Take into account from a pricing point that the number of cores in each column header does not sum up the total number of cores of the cluster (OpenVidu Server Pro Node cores should also be counted).

Here you can find the full article presenting these results.



Current limitations of OpenVidu Pro scalability 🔗

Below are stated the current limitations regarding the scalability of an OpenVidu Pro cluster. All of them are currently in our roadmap, and will be for sure addressed in future releases.

Composed video recording is not scalable 🔗

Right now composed recordings with video are hosted in OpenVidu Server Pro node, which means that launching multiple simultaneous composed recordings may increase the load on this node to a dangerous point. So a necessary change to improve scalability for this particular use case is to get this module out of OpenVidu Server Pro Node.

For the moment, we recommend limiting the number of simultaneous composed recordings with video and using a more powerful machine in OpenVidu Server Pro Node if required. This doesn't affect either individual recordings or composed recordings with audio-only.

Sessions cannot be moved between Media Nodes 🔗

Current scalability features doesn't support dynamic migration of OpenVidu Sessions between Media Nodes. Once a Session is initialized inside a Media Node, it will remain there until it is closed. We will work to support Session migration between Media Nodes to A) improve fault tolerance upon the possibility of a Media Node crashing and B) make easier the scale-down process of your OpenVidu Pro cluster, so you don't have to wait until all Sessions inside a Media Node are closed to drop that Media Node from the cluster.

There is no automatic elasticity yet 🔗

The automated scale-in and scale-out of Media Nodes according to server load is an important feature that OpenVidu Pro will provide in the future. This way you will be able to configure your OpenVidu Pro cluster to automatically launch new Media Nodes when the CPU load of the existing ones reaches certain point, and drop Media Nodes when CPU load decreases.