Horizontally scaling `lightyear` for high-availability
How do we scale lightyear to handle multiple game sessions? If this is not supported yet, I am curious how you plan to implement this in the future
What do you mean by multiple game sessions? A single server handling multiple game rooms?
I think you can already implement this using the NetworkRelevance/Room feature. (or even just using the ReplicationTarget component)
There is also an example for it here: https://github.com/cBournhonesque/lightyear/tree/main/examples/lobby
Amazing! This is definitely helpful for smaller projects and prototyping!
How about horizontal scaling on the server-side, thinking about high-availability and failover to other machines. Having a single machine for a live service multiplayer is not exactly production-grade.
I think the standard is to have N server processes on a machine with N cores, with each server taking charge of one game room.
But for actually deploying your servers I would advise to use Edgegap; there is also a project to easily be able to onboard bevy to Edgegap called https://github.com/RJ/bevygap !
I think the standard is to have N server processes on a machine with N cores, with each server taking charge of one game room.
So there is no open source way as of now to orchestrate the scaling towards multiple machines?
But for actually deploying your servers I would advise to use Edgegap; there is also a project to easily be able to onboard bevy to Edgegap called https://github.com/RJ/bevygap !
I am actually exploring building my own PaaS that is tailored for turn-based games.
Well there is stuff like https://agones.dev/site/ but yes nothing directly integrated with lightyear
I am actually trying to avoid Kubernetes.
Well there is stuff like https://agones.dev/site/
How would we use wtransport with K8 anyway; for instance, there is no proper traefik support for HTTP3 🤷🏼
I have used a Proxmox Cluster with a CEPH storage backend to handle redundancy, the high availability failover is seamless.
Proxmox can be used for free, but has commercial support for those that want it.
My proxmox cluster is 5 server nodes in my home server rack.
(It is somewhat older hardware r720, that I bought used, but you could literally use any PCs, and you can put a cluster together with as little as 3 machines)
While I am still testing and building I do not have to pay for hosting.
I don't really think it would be lightyears responsibility to provide horizontal scaling support since it's just a networking library in the end.. 🤔
@Jieiku while this is definitely something like what I had in mind, it is still not perfect because ongoing sessions would die in case of a failover in this stack.
Am I perhaps missing something? Do you cache the Bevy world on CEPH?
CEPH handles the storage (the storage is redundant across 2 or more machines), and the Proxmox cluster monitors the state of the LXC containers and server nodes. If the server Node went down for any reason then the Proxmox cluster would resume the container(s) on another node. That means any running software within those containers would continue to run as well. I have been using Proxmox for various tasks for the last 7 years or so, but I have not yet launched/released any games. I am just now getting into game development, most of my experience is actually in networking and IT management (business apps, and client services)