Page 1 of 1

Load Balncing Proxy for Servers

Posted: Wed Jul 26, 2017 5:02 pm
by VITAS
Hi,
as everyone is painfully aware Factorios Serversoftware is singlethreaded.

Instead of rewriting the Server and getting away from a single event loop i suggest building a second program, that acts as a loadbalncing proxy for server processes.

It would achive that by relaying messages between multiple server instances and to/from connected players.
The server instances wont need to handle any complex tasks for players connected to other instances but would only made aware about actions on players connected to it (shooting) and other changes to the level (building/removing of objects, droping/removing of items).
The proxy would do the actual mixinmg of the instances stats into something that contains all players and so on to be transmitted to the clients.

you could think of it as a mix of http reverse proxy LBs (e.g. apache mod_proxy) with multiple backend instances and IRC networks.

Such a Software would allow to scale games across multiple servers and utilize all cores of a machine by running as many instances as there are spare cores.
Also there wouldnt be any need to change existing setups and new setups could even scale dynamicly if needed (and implemented into the proxy)

Re: Load Balncing Proxy for Servers

Posted: Wed Jul 26, 2017 5:21 pm
by Rockstar04
I haven't messed with multiplayer factorio in a while, but the game is still deterministic, meaning all actions need to happen on all servers and clients. What would this solve?

Re: Load Balncing Proxy for Servers

Posted: Wed Jul 26, 2017 7:58 pm
by VITAS
The server instances wont need to handle any complex tasks for players connected to other instances but would only made aware about actions on players connected to it (shooting) and other changes to the level (building/removing of objects, droping/removing of items).
The proxy would do the actual mixinmg of the instances stats into something that contains all players and so on to be transmitted to the clients.
It also frees the instances from maintaining many conenctions and transfering levels,...

Re: Load Balncing Proxy for Servers

Posted: Wed Jul 26, 2017 8:16 pm
by Zeblote
Each of your instances would still have to process the entire world to be deterministic, so you don't gain anything from this.

The world state is too large, has too many dependencies across it to be able to synchronize it in some reasonable way.

Re: Load Balncing Proxy for Servers

Posted: Wed Jul 26, 2017 9:52 pm
by VITAS
If youre correct no Loadbalancer or cluster setup would ever work.

But my post is a suggestion for the developers. They know their code best and can determine if it would work in their instance.