Putting Thousands Of Minecraft Players On The Same Server

Multi-threading was the common go-to technique for extracting more performance from a machine for several years. These days it’s all about horizontal scaling or adding more virtual machines to a pool of workers. The Minecraft server is still stuck in the past in some ways as it supports neither multi-threading nor horizontal scaling. [Jackson Roberts] decided to change all that by hacking Minecraft to support thousands of players rather than dozens.

Since the server is single-threaded, having more than 100 players on a single server can slow it to a crawl. Some mods try to optimize and speed up the existing server but [Jackson] wanted more. An early proof of concept was to slice the world into separate servers, each holding 64×64 chunks (chunks are what Minecraft defines as a 16x256x16 volume of the world). When crossing a boundary, entities such as players and zombies were transferred from one server to another. While workable, the demo had issues such as parts of the world being inaccessible if a server went down. The boundaries were also jarring as you had to reconnect and couldn’t see players outside your server.

Instead of splitting the world, [Jackson] took the approach to split the players and have some backing store for persisting and broadcasting changes. A proxy sits in front of several Minecraft servers, which each have a connection to a WorldQL server (a spatial database based on Postgres). Each server reports the player’s location to the WorldQL server and receives updates for their loaded locations. When a server comes online, it catches up with the changes stored in WorldQL and starts syncing, allowing servers to auto-scale. There are still a few core game mechanics that aren’t quite ready for prime-time such as NPCs and Redstone, but the progress so far is remarkable.

The code for the Minecraft plugin is up on GitHub, but more is coming in the future. So if you’re interested in something a little more vanilla, why not marvel at the completely playable Pokemon Red inside vanilla Minecraft?

15 thoughts on “Putting Thousands Of Minecraft Players On The Same Server

    1. Non Free?. Yep, them Raspberry Pi’s, SD cards cost money. So does the internet connection and them electrons. (Hint, there IS a free Minecraft version for the pi…and you can find minecraft software for other platforms for less than most people spend on a single beverage in starbucks, which isn’t free, but certainly IS affordable)

      1. All current minecraft mods, extensions, etc are reverse engineering and modification of closed source code.
        Even if its “free”, the source code is still not. Microsoft turns a blind eye to modding, reverse engineering of Minecraft but this can change in the future.

        1. Your argument has switched from “free stuff” to “open source” the two are entirely different and entirely unrelated.
          People do chose to pay for “open source” stuff. People do chose to use “free” versions of a globally accessible and highly moddable , fantastic piece of software.
          Current “free” open source stuff can become closed in future.

          1. Sadly, english language is limited in having single word for two different things, many other languages don’t have this problem. But when people on hacking blog talk about “free” software, they use it as in “free speech”.

        2. From MS’ point of view, too much money is made through third-party providers.
          By moving Mojang accounts to the Xbox network, which is being heavily promoted right now, the company is taking measures to secure revenue streams.

          MS will prefer to take the money by theirselves that third-party providers currently earn on their servers with skins, features, virtual items, etc.
          MC is old, but I’m sure it still is a cash cow.

          Embrace, extend, … – everyone knows it, but too few recognize.

    2. You can get this game (and many others) for free. Ever heard about this thing called computer piracy? It was common in my country because most games and other software was (and still is, sometimes) quite expensive here. By “expensive” I mean 5-10% of minimal monthly wage in 2021. It used to be 10-20%, or more. And more professional software like 3DStudioMax costed 2-4 months of average wages…

      You can also get plenty of free games from legitimate sources. GOG.com, Steam and Epic Games give away games from time to time. Epic gives sometimes top tier games, like, Civilization VI, Cities:Skylines, GTAV and Control…

      My older brother bought me Minecraft back when it was only for Java, so I got free Windows version later. He got it for me because he wanted us to play on servers together, and for me that game was too expensive…

      1. I was thinking should I report your comment for promoting piracy or write you a few words. If someone wants to charge for their software, it is their choice and respect it, software development costs time and money. If you don’t like that choice, well, don’t use their software. There is plenty of free software, you don’t need piracy.

      2. i pirated the game at first. after i saw the masterpiece that it was i bought several copies. now that they are forcing me to set up an ms account to continue playing the game, i think im going back to piracy.

  1. seems like minecraft is a perfect candidate for amdahl’s law. given the way a minecraft world is constructed, it seems like you can do chunk updates in parallel and greatly speed things up. whatever size 2d array of chunks you use, the big issue is handling the boundary chunks and propagating block updates across the boundary when both chunks are being processed by 2 different threads. if a piston shoves a redstone block across the boundary, the chunk data will change but might need to wait for that chunk to be handled before it triggers anything in the next block. i can imagine the nightmare this would cause for redstone builders when their circuits are facing race conditions caused by the chunks updating out of sync. and then technical players will find ways to exploit this for fun and profit.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.