Peertube: Is it safe to deploy PeerTube on multiple nodes behind a load balancer?

Created on 9 Oct 2018  路  4Comments  路  Source: Chocobozzz/PeerTube

I am thinking to deploy my instance on multiple nodes, but before I go that route I need to know if the code will be able to handle this case, to place multiple servers running the instance code behind a load balancer, making it use a central Redis server and a central Postgres Database server. The only thing I'm not how it will work is the transcoding, will both servers start transcoding the same video or will one server do the transcoding of the video. Possibly there just needs to be a central transcoding only server for this, right? Or a cluster(multiple nodes) of transcoding servers.

This is the only thing that is stopping me right now from deploying it on multiple server behind a load balancer.

Possibly I could even have the frontend code hosted on S3 as a website and an EC2 instance for the backend, but ideally I would like to be able to have multiple servers so that load is balanced between the servers, then later I can add or remove servers as needed, or configure autoscaling to do that automatically.

Would this be possible with the current codebase? and if not then, what modifications would need to be made in order to run this type of architecture? is it only the transcoder that is the blocker or is there something else I'm missing?

Question

Most helpful comment

Sorry but peertube does not support load balancing. If you plan to have many users, you should consider creating different instances (to promote decentralization).

All 4 comments

Sorry but peertube does not support load balancing. If you plan to have many users, you should consider creating different instances (to promote decentralization).

Two years later, is the answer the same, @Chocobozzz ? Is transcoding the only obstacle? Maybe an upcoming solution of https://github.com/Chocobozzz/PeerTube/issues/947 would solve this then?

Hello,

Yes the answer is the same. There are many obstacles in the peertube core that was not designed to be on multiple nodes. But if you spot peertube limitations at your scale, we can discuss about mitigations/solutions.

Currently we're having an OpenStack architecture with a load balancer but only one PeerTube instance behind. The reason we're using a load balancer is about locking an IP address and be able to destroy and create PeerTube instances without downtime (the relevant storage folders are on a mounted s3 bucket and the database is on a separate server). Here's a draw.io diagram of the current architecture.

Maybe we'll try to separate it a bit more, I'll keep you updated if then.

Update:
Now I found out an issue with my setup. PeerTube counts views based on the user IP address, and with my load balancer PT thinks that the LB is the user. I hope this is possible to solve by forwarding the real user IP in some HTTP header.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XenonFiber picture XenonFiber  路  3Comments

conferences-gesticulees picture conferences-gesticulees  路  3Comments

MikaXII picture MikaXII  路  3Comments

filmaidykai picture filmaidykai  路  3Comments

zilti picture zilti  路  3Comments