Skip to content

Proxy

The proxy is special because it is aware of certain parts of the game server's internal state: mainly the chunk locations of each player. This allows to do regional broadcasting very efficiently from the game server. Taking compute and I/O off of the game server allows for a massive performance boost as the game server can only vertically scale while the proxy can horizontally scale.

Operation TypeVanilla MinecraftProxy-Based Approach
Global BroadcastServer sends one packet to every playerServer sends one BroadcastGlobal packet to the proxy. The proxy will send a packet to each player.
Channel BroadcastServer sends one packet to each player in a region and manages packets sent when entering/leaving the regionServer sends one BroadcastChannel packet to the proxy. The proxy will send a packet to each player in a region and manage subscribe/unsubscribe packets.
Local/Regional BroadcastServer sends one packet to each player in a regionServer sends one BroadcastLocal packet to the proxy. The proxy will send a packet to each player in a region.
UnicastServer sends one packet to a specific playerServer sends one Unicast packet to the proxy. The proxy will send a packet to a specific player.

Using a proxy is a massive optimization for large player counts. For example, to update player positions in Vanilla Minecraft, the server would need to send every player's position to everyone in the same area as that player. In the worst-case scenario where every player is in the same area, meaning that every player needs to know the position of every other player, the server would need to send n2 packets where n is the number of players. This would lead to a large amount of CPU, memory, and network usage from one server. However, with a proxy-based system, the server would only need to send n packets to each proxy. Although there would still be n2 total packets sent from each proxy, this work is spread out across multiple proxies instead of being done on one server.