Skip to content

AVideo Platform Hardware Requirements

Daniel Neto edited this page May 26, 2024 · 30 revisions

Summary

Minimum Hardware Requirement

The minimum hardware requirement for running AVideo is 4 GB RAM, 4 CPU cores, and 120 GB disk space. For better performance, a CPU with at least 2 cores and 8 GB of RAM is recommended. The platform can handle unlimited simultaneous live streams and users, but hardware limitations depend on bandwidth and video quality.

Recommended Hardware Setup

For optimal performance in my personal setup, I always use the following hardware specifications:

  • RAM: 16 GB
  • Disk: 450 GB SSD
  • CPU: 8 cores

Optimal Performance

For optimal performance, we recommend using our CDN Storage and CDN, which will reduce server load, improve website load times, reduce bandwidth costs, and increase content availability and redundancy. To further improve scalability and performance, you can use multiple live servers, and encoders, and host the database separately.

Server Operational System

We always recommend using LTS releases of Ubuntu. they are designed to be stable platforms that you can stick with for a long time

It is not impossible to install it on other Linux distributions or Windows, but we strongly recommend Ubuntu without any kind of control panel if you want a more fluid installation, for example, do not install cPanel, Plesk, Webmin, VestaCP, etc. Please avoid Debian on Centos, unless you know exactly what you are doing.

Our support is restricted only to Ubuntu without control panels.

Server Software Requirements

In order for you to be able to run the AVideo Platform, there are certain tools that need to be installed on your server. Don't worry, they are all FREE. To have a look at the complete list of required tools, click the link below.

  • Ubuntu 20.04 or 22.04 or a later LTS Version
  • PHP 8+
  • MySQL 5.0+
  • Apache web server 2.x (with mod_rewrite enabled)

Minimum Hardware requirements

We recommend at least 4 GB ram (files up to 2GB), 4 CPU cores, and 120 GB disk

Improve the hardware

Better hardware will be a better performance (of course)

  1. If you want to encode faster, get a better CPU
  2. If you want to encode larger videos, get more RAM
  3. If you want to have many simultaneous users, get more bandwidth

How Many Livestream Can I Make?

  • You can have unlimited and simultaneous live streams.
  • You can have unlimited users connected to each live stream.

The only limitation is your hardware, but we can not tell you what hardware is needed to handle a specific amount of users. It depends on your bandwidth and the quality of the video you are transmitting. But keep in mind you can always add new Live servers and expand your capacity.

But If you plan on using this site for a live broadcast with a large audience, I recommend that you have a dedicated server. Usually, VPSs suspend you because live streams drain a lot of cloud resources.

By default, we use NGINX to stream your live stream without resizing it, so if you broadcast in 1080p, your users will receive 1080p live.

For more details, please read this

Adaptive Bitrates on Livestream

But we also use the Adaptive Bitrates on Livestream, which will consume more of your CPU and less of your bandwidth. The more simultaneous Livestream, the more CPU will consume.

But in my experience, with the Adaptive Bitrates on Livestream a 100 Mbps Network can handle up to 100 simultaneous users. So 1Gbps should handle 1000 Simultaneous users.

if you want details about how to improve your Live Stream try to ask it at https://github.com/arut/nginx-rtmp-module

How should the CPU be?

The CPU is mainly used to encode VOD videos. The faster your processor is faster you will encode your videos. Also, you can have multiple encoders on the same server or in a separate server (we recommend keeping them separated)

We recommend at least 2 CPUs core

How should the RAM be?

There is a script calculation..., your maximum file size can be only 50% of your RAM memory because the script needs to copy files between locations and handles them on the virtual memory.

In Example, if you want to upload a 4GB file you will need to have at least 8 GB Ram on the server otherwise you will have a Memory Leaks - Allowed memory size of # bytes exhausted error.

Disk Storage

Minimum disk Space

It is difficult to say exactly, but we can make some estimates. Your streamer and encoder need some free space to be able to process videos. we recommend at least 10x of the space for the max file size you will submit to your site. for example, if you want to process a 5GB file of a 4K video you need at least 50GB free, for MP4 format and 100 GB of free space, for HLS Format (if you will process only one file at a time). But you also can expand your Storage space any time

Why all of this?

Any file you upload will be encoded in different resolutions depending on what resolution was the original file. For example, I made a test in the worst case as possible, I have uploaded a 4k file that was originally a 40 MB file (2 minutes of a 4k video), and after encoding it is a bundle of 7 different resolutions (2160p 4k, 1440p +FHD, 1080p FDH, 720p HD, 480p, 360p, 240 p). Also, to make sure we are using the most common case, we are expecting the encoder and the streamer are on the same server.

If the encoder is on the same server as the streamer. and the encoder does not automatically delete the file, will stay in your encoder, and the streamer folder it will double your disk usage

image

The original file details

$ ffprobe Elecard_about_Tomsk_part1_HEVC_UHD.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Elecard_about_Tomsk_part1_HEVC_UHD.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
    creation_time   : 2016-03-13T04:37:36.000000Z
  Duration: 00:02:01.97, start: 0.000000, bitrate: 2763 kb/s
    Stream #0:0(unk): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 3840x2160, 2760 kb/s, 25.03 fps, 25 tbr, 90k tbn, 90k tbc (default)
    Metadata:
      creation_time   : 2016-03-13T04:37:36.000000Z
      handler_name    : ISO Video Handler
      vendor_id       : [0][0][0][0]

If you want you can download it here

Final File size on the streamer

After generating all 7 resolutions the final size of this 40 MB file was like this:

  • MP4 final size: 136 MB (3.4 times the original file)
  • HLS final size: 235 MB (5.8 times the original file)

image

If the file is HLS, you also need space for the zip file (zip and unzip process), so we can expect to consume double of the user while it is encoding and transferring.

So we will expect to consume the following disk while is processing:

MP4

  • Streamer = about 136 MB (total 136)
  • Encoder = about 136 MB + 40 MB of the chunked file + 40 MB of the original tmpFile (total 216)
  • While is processing 352 MB of free space is needed (if there is no error) (so 8.8 times the original size)
  • Final size 70 MB/Minute of a 4K video
  • Streamer = about 235 MB + 223 MB for the zip file
  • Encoder = about 235 MB + 40 MB of the chunked file + 40 MB of the original tmpFile + 223 MB for the zip file
  • While is processing 761 GB of free space is needed (if there is no error) (so 19 times the original size)
  • Final size 117 MB/Minute of a 4K video

Of course, the file size consumed can be less than that if your file is not a 4K, you can also limit and choose up to 3 specific resolutions to encode. To do this you MUST set it up in your customizeAdvanced plugin

image

What ports do I need to open?

You will need ports 80, 8080, 443, 8443, 2053, and 1935 to make the default installation

  • 80 for apache HTTP
  • 443 for apache HTTPS
  • 8080 for Nginx HTTP
  • 8443 for Nginx HTTPS
  • 2053 for Sockets
  • 1935 for RTMP connection

What Can I do to Scale my Servers

Bandwidth

Simultaneous users can consume a lot of your bandwidth making slowing down your media delivery. a recommended solution for that is to use a CDN, the benefits of this are:

  • Improving website load times
  • Reducing bandwidth costs
  • Increasing content availability and redundancy

While a CDN does not host content and can't replace the need for proper web hosting, it does help cache content at the network edge, which improves website performance. By utilizing caching to reduce hosting bandwidth, helping to prevent interruptions in service, and improving security, CDNs are a popular choice to relieve some of the major pain points that come with traditional web hosting.

Storage and VOD Videos

VOD videos require you to store them, and sometimes your server gets full and you may need another server to store the videos. if you use the YPTStorage you will be able to add as many servers as you want, also you will use the Storage server bandwidth to deliver the videos to your viewers. Also, you can use S3 and B2 storage for unlimited storage, before deciding the storage type, please read this.

Live Streams

The Livestream some times you need more bandwidth or maybe disk IO, depending on how many lives/users you are running, you can have multiple live servers feeding your Streamer site, please read this

Encoder

You can install and use as many encoders as you want, each encoder will provide you a queue to process one video at a time. we recommend the encoder to be in a separate server, and you can use multiple servers to encode videos. to connect those encoders you will need the Encoder network

Database

We recommend the database to be hosted on the same server as the streamer due to the multiple queries we execute on each request, but you also can host it separately.

image

Clone this wiki locally