[{"data":1,"prerenderedAt":914},["ShallowReactive",2],{"home-posts":3},[4,374],{"id":5,"title":6,"body":7,"date":357,"description":358,"draft":359,"extension":360,"image":361,"meta":362,"navigation":363,"path":364,"seo":365,"stem":366,"tags":367,"__hash__":373},"blog\u002Fblog\u002Ffrom-one-server-to-a-network.md","From one Minecraft server to a network",{"type":8,"value":9,"toc":343},"minimark",[10,21,24,29,44,47,50,54,62,87,91,102,105,156,163,167,170,173,176,180,183,186,194,198,207,216,224,227,231,234,245,248,252,265,269,272,275,306,310,316,320,334],[11,12,13,20],"p",{},[14,15,19],"a",{"href":16,"rel":17},"https:\u002F\u002Fminebox.co",[18],"nofollow","Minebox"," v1 launched in 2022 and couldn't hold more than about 150 players. We spent a year rebuilding it as a network, by hand, before AI coding tools. Minebox has since reached 1,000 concurrent players.",[11,22,23],{},"This post explains the problems you hit when one Minecraft server becomes a network of servers, and how we solved each of them.",[25,26,28],"h2",{"id":27},"one-server-one-thread","One server, one thread",[11,30,31,32,37,38,43],{},"A Minecraft server updates its world 20 times per second. Each update, called a ",[14,33,36],{"href":34,"rel":35},"https:\u002F\u002Fminecraft.wiki\u002Fw\u002FTick",[18],"tick",", runs on a single thread: one CPU core does the work for every player, mob and block. When a tick takes longer than its twentieth of a second, the game slows down for everyone. ",[14,39,42],{"href":40,"rel":41},"https:\u002F\u002Fpapermc.io\u002Fsoftware\u002Fpaper",[18],"Paper",", the server software we use, moves some work like chunk loading to other threads, but the game itself stays on one. More cores don't help.",[11,45,46],{},"Minebox v1 ran everything on one server: the spawn and every player's island. Nothing in it could be split across servers. Past about 150 players the server fell behind, slowed down more as players kept joining, and eventually crashed, taking the spawn and every island down with it.",[11,48,49],{},"The only way past that limit was to run the game on many servers.",[25,51,53],{"id":52},"why-not-folia","Why not Folia",[11,55,56,61],{},[14,57,60],{"href":58,"rel":59},"https:\u002F\u002Fpapermc.io\u002Fsoftware\u002Ffolia",[18],"Folia"," is a version of Paper that splits a world into regions and updates them in parallel on several cores. For some servers it's a good alternative to a network. It wasn't one for us:",[63,64,65,69,78],"ul",{},[66,67,68],"li",{},"It didn't exist when we started building the network in 2022. It came out in 2023, when our system was almost done.",[66,70,71,72,77],{},"Plugins have to be adapted for it, because it removes the single thread they're written for. Its own ",[14,73,76],{"href":74,"rel":75},"https:\u002F\u002Fgithub.com\u002FPaperMC\u002FFolia",[18],"README"," says to expect almost no Paper plugins to work, and many of ours didn't.",[66,79,80,81,86],{},"It's still one server on one machine. PaperMC's ",[14,82,85],{"href":83,"rel":84},"https:\u002F\u002Fdocs.papermc.io\u002Ffolia\u002Ffaq",[18],"sizing advice for Folia"," comes from a test server with a few hundred players, and a crash still takes everyone down. A network grows by adding machines.",[25,88,90],{"id":89},"the-shape-of-the-network","The shape of the network",[92,93,98],"pre",{"className":94,"code":96,"language":97},[95],"language-text","                            players\n                               │\n                  ┌────────────┴────────────┐\n                  ▼                         ▼\n              ┌───────┐                 ┌───────┐\n              │proxy 1│                 │proxy 2│\n              └───┬───┘                 └───┬───┘\n                  └────────────┬────────────┘\n                               ▼\n  ┌────────────────────────────────────────────────────────┐\n  │ game servers                                           │\n  │ spawn · islands · PvP · raids · events                 │\n  └────────────────────────────┬───────────────────────────┘\n                               │ gRPC, both ways\n  ┌────────────────────────────┴───────────────────────────┐\n  │ services                                               │\n  │ server registry · players · islands · social · market  │\n  └────────────────────────────┬───────────────────────────┘\n                               │\n  ┌────────────────────────────┴───────────────────────────┐\n  │ database · cache · object storage                      │\n  └────────────────────────────────────────────────────────┘\n","text",[99,100,96],"code",{"__ignoreMap":101},"",[11,103,104],{},"The network has four layers:",[63,106,107,120,126,138],{},[66,108,109,113,114,119],{},[110,111,112],"strong",{},"Proxies"," are where players connect. A proxy, ",[14,115,118],{"href":116,"rel":117},"https:\u002F\u002Fpapermc.io\u002Fsoftware\u002Fvelocity",[18],"Velocity"," in our case, moves players between game servers without disconnecting them. We run two.",[66,121,122,125],{},[110,123,124],{},"Game servers"," run the game. Each one has a type: spawn, islands, PvP, raids or events. Each type runs as many copies as it needs, and most of our fleet is island servers.",[66,127,128,131,132,137],{},[110,129,130],{},"Services"," are programs we wrote in ",[14,133,136],{"href":134,"rel":135},"https:\u002F\u002Fgo.dev",[18],"Go",". They own everything shared across the network: player data, islands, chat, friends, guilds, the market, and the list of running servers.",[66,139,140,143,144,149,150,155],{},[110,141,142],{},"Storage"," is a database (",[14,145,148],{"href":146,"rel":147},"https:\u002F\u002Fwww.postgresql.org",[18],"PostgreSQL",") for structured data, object storage for large files like player data and island worlds, and a cache (",[14,151,154],{"href":152,"rel":153},"https:\u002F\u002Fredis.io",[18],"Redis",") for short-lived data that has to be fast.",[11,157,158,159,162],{},"Every game server and proxy runs the same plugin, ",[99,160,161],{},"mbcore",", which connects it to the services.",[25,164,166],{"id":165},"splitting-the-game","Splitting the game",[11,168,169],{},"In v1, the spawn and the islands were on the same server, so they could only grow together. In the network, the game is split by role into server types, and each type grows on its own.",[11,171,172],{},"Islands needed the biggest change. Each island is its own world, stored outside the servers. When a player visits an island, it's loaded on an island server with free capacity, and unloaded when nobody is left. If the island is already loaded somewhere, the player is sent to that server. An island is locked while it's loaded, so two servers can never load the same one.",[11,174,175],{},"No island belongs to a server. To hold more players, we add island servers.",[25,177,179],{"id":178},"game-servers-dont-own-shared-data","Game servers don't own shared data",[11,181,182],{},"On one server, everything shared lives in memory: a player's inventory, their island, their friends, chat, the economy. On a network, each server only sees its own players, so it can't be the owner of anything shared.",[11,184,185],{},"The rule: game servers run the game, services own the data. A server loads what it needs from the services and saves it back. Chat, friends, parties and guilds are services, so they work the same whatever server or proxy players are on. The market is a service too, so every server sees the same listings.",[11,187,188,189,193],{},"Because servers don't keep anything that isn't saved, any server can be restarted, replaced or added. That's also what lets us deploy updates without disconnecting players, covered in ",[14,190,192],{"href":191},"\u002Fblog\u002Fscaling-minecraft-kubernetes","Scaling a Minecraft server with Kubernetes",".",[25,195,197],{"id":196},"talking-across-the-network","Talking across the network",[11,199,200,201,206],{},"Minecraft servers usually talk to each other with ",[14,202,205],{"href":203,"rel":204},"https:\u002F\u002Fdocs.papermc.io\u002Fpaper\u002Fdev\u002Fplugin-messaging",[18],"plugin messages",", sent through the proxy. A plugin message travels on a player's connection: it needs a player on the sending server, and it only reaches the proxy that player is connected to. With two proxies, half the network can't receive it.",[11,208,209,210,215],{},"We use ",[14,211,214],{"href":212,"rel":213},"https:\u002F\u002Fgrpc.io",[18],"gRPC"," instead, a standard way for programs to call each other over the network:",[63,217,218,221],{},[66,219,220],{},"Game servers and proxies call the services.",[66,222,223],{},"Each game server and proxy also accepts calls, so services can reach them: deliver a chat message, save a player, load an island.",[11,225,226],{},"There's no message broker in between. Services know where every player is, so they call the right server directly.",[25,228,230],{"id":229},"more-than-one-proxy","More than one proxy",[11,232,233],{},"One proxy is one process. It has a capacity limit, and restarting it disconnects everyone. So we run several. That breaks things a single proxy handled on its own, because each proxy only knows its own players:",[63,235,236,239,242],{},[66,237,238],{},"Is my friend online, and on which server?",[66,240,241],{},"How do I move a player who is connected to another proxy?",[66,243,244],{},"How do I stop the same account from logging in twice, through two different proxies?",[11,246,247],{},"The fix is to keep that knowledge outside the proxies. The server each player is on is stored in the database, so any service can find any player. A second login of the same account is refused. To move a player, the network asks the proxies, and the one the player is connected to moves them.",[25,249,251],{"id":250},"knowing-which-servers-exist","Knowing which servers exist",[11,253,254,255,258,259,261,262,264],{},"Servers come and go: they restart, crash, and get added as the network grows. A service called ",[99,256,257],{},"server_manager"," keeps the list. How it runs and stays available is in ",[14,260,192],{"href":191},". Each server registers when it starts, then reports regularly with its state, player count and tick rate. ",[99,263,257],{}," uses that list to decide where players go and where islands load, and removes servers that stop reporting.",[25,266,268],{"id":267},"one-writer-per-player","One writer per player",[11,270,271],{},"The worst bugs in a network come from two servers writing the same player's data. When a player moves from server A to server B, A might still be saving while B has already loaded the player. The result is a duplicated item, or progress rolled back.",[11,273,274],{},"So only one server can write a player's data at a time:",[63,276,277,283,289,295],{},[66,278,279,282],{},[110,280,281],{},"A lock."," Each player's data has a lock in the database naming the one server allowed to save it.",[66,284,285,288],{},[110,286,287],{},"A handoff."," When B loads a player, the network asks A to save and release them first. Only then does B get the lock.",[66,290,291,294],{},[110,292,293],{},"A cache."," A's last save is kept in the cache for a short time, so B doesn't wait for it to reach object storage.",[66,296,297,300,301,193],{},[110,298,299],{},"An epoch."," The lock carries a number that goes up at every handoff, and every save must carry the current number. A server that froze and comes back later still has an old number, so its saves are rejected. This technique is called a ",[14,302,305],{"href":303,"rel":304},"https:\u002F\u002Fmartin.kleppmann.com\u002F2016\u002F02\u002F08\u002Fhow-to-do-distributed-locking.html",[18],"fencing token",[25,307,309],{"id":308},"when-a-server-crashes","When a server crashes",[11,311,312,313,315],{},"A crashed server stops reporting. ",[99,314,257],{}," removes it and releases the locks it held on players and islands. Those players lose what happened since their last save. Everyone on other servers keeps playing. If the crashed server comes back, the epoch stops its old saves from overwriting anything.",[25,317,319],{"id":318},"what-wed-tell-anyone-making-the-same-move","What we'd tell anyone making the same move",[63,321,322,325,328,331],{},[66,323,324],{},"Decide what's shared and move it out of the game servers first. Everything else depends on it.",[66,326,327],{},"Split the game by role, and make the parts that grow, like islands, loadable on any server.",[66,329,330],{},"Don't route anything through the proxy if you want more than one.",[66,332,333],{},"Make every handoff explicit: one writer at a time, with a lock and an epoch.",[11,335,336,337,342],{},"Questions, or a different approach? I'm ",[14,338,341],{"href":339,"rel":340},"https:\u002F\u002Fx.com\u002Fimevlad",[18],"@imevlad"," on X.",{"title":101,"searchDepth":344,"depth":344,"links":345},2,[346,347,348,349,350,351,352,353,354,355,356],{"id":27,"depth":344,"text":28},{"id":52,"depth":344,"text":53},{"id":89,"depth":344,"text":90},{"id":165,"depth":344,"text":166},{"id":178,"depth":344,"text":179},{"id":196,"depth":344,"text":197},{"id":229,"depth":344,"text":230},{"id":250,"depth":344,"text":251},{"id":267,"depth":344,"text":268},{"id":308,"depth":344,"text":309},{"id":318,"depth":344,"text":319},"2026-10-31","Minebox v1 crashed past 150 players on one server. How we rebuilt it as a network of Minecraft servers, proxies and services, and the problems we solved.",false,"md","\u002Fimages\u002Fog\u002Ffrom-one-server-to-a-network.png",{},true,"\u002Fblog\u002Ffrom-one-server-to-a-network",{"title":6,"description":358},"blog\u002Ffrom-one-server-to-a-network",[368,369,370,371,372],"minecraft","architecture","scaling","golang","grpc","ve644Ur7ZfdpPKRVmm-Q9yi7LbAO2kSNnYrEIME2FI0",{"id":375,"title":192,"body":376,"date":357,"description":904,"draft":359,"extension":360,"image":905,"meta":906,"navigation":363,"path":191,"seo":907,"stem":908,"tags":909,"__hash__":913},"blog\u002Fblog\u002Fscaling-minecraft-kubernetes.md",{"type":8,"value":377,"toc":897},[378,392,395,398,402,410,427,441,447,451,454,460,472,478,487,507,510,513,531,669,687,694,754,769,773,776,807,856,869,872,876,888,893],[11,379,380,383,384,389,390,193],{},[14,381,19],{"href":16,"rel":382},[18]," is a persistent Minecraft RPG. It runs as a fleet of single-threaded Minecraft servers on ",[14,385,388],{"href":386,"rel":387},"https:\u002F\u002Fkubernetes.io",[18],"Kubernetes",", behind proxies that move players between them. Why we split it into a network in the first place is in ",[14,391,6],{"href":364},[11,393,394],{},"Kubernetes restarts crashed pods, rolls out new images and keeps replica counts. It doesn't know when a Minecraft server has finished loading its world, whether it has room for another player, or how to move a player to another server without disconnecting them. This post covers how we handle that: the control plane, the in-pod helper, rolling updates, and running the control plane as two replicas.",[11,396,397],{},"A mistake anywhere in this lifecycle can lose player data, for example a pod killed mid-save. This post is about orchestration, not data safety.",[25,399,401],{"id":400},"why-not-agones","Why not Agones",[11,403,404,409],{},[14,405,408],{"href":406,"rel":407},"https:\u002F\u002Fagones.dev",[18],"Agones"," is the standard answer for game servers on Kubernetes. It allocates a server per match and gives the player an address. For session-based games it's a good default.",[11,411,412,413,416,417,416,420,416,423,426],{},"Minebox works differently. Players connect to a proxy, and the proxy moves them between running servers: spawn, islands, PvP, raids. We run a standing fleet of typed servers (",[99,414,415],{},"SPAWN",", ",[99,418,419],{},"ISLAND_BAMBOO",[99,421,422],{},"PVP",[99,424,425],{},"RAID",", …) instead of allocating one per session. We needed a registry and a scheduler with Minecraft-specific rules:",[63,428,429,432,435,438],{},[66,430,431],{},"readiness based on game state, not on an open port",[66,433,434],{},"typed servers",[66,436,437],{},"drains that wait for player saves",[66,439,440],{},"health based on TPS",[11,442,443,444,446],{},"Fitting that into Agones would have meant working against its model. So we wrote ",[99,445,257],{},", a Go service that handles discovery, health checks and scaling for our fleet.",[25,448,450],{"id":449},"server-lifecycle","Server lifecycle",[11,452,453],{},"A server boots, registers, sends heartbeats, drains and unregisters. Everything runs over gRPC inside the cluster.",[92,455,458],{"className":456,"code":457,"language":97},[95],"        game server pod                         proxies\n  ┌─────────────────────────────┐        ┌────────────────────┐\n  │ boot → load world → RUNNING │        │ routes players     │\n  └──────┬───────────────▲──────┘        │ to READY servers   │\n         │               │               └─────────▲──────────┘\n         │ 1. Register   │ 2. reverse channel      │\n         │ 4. Heartbeat  │    (query, drain,       │ 3. pushes every\n         │    (state,    │     transfer)           │    state change\n         │    players,   │                         │\n         │    TPS)       │                         │\n  ┌──────▼───────────────┴─────────────────────────┴──────────┐\n  │            server_manager · 2 replicas · Redis            │\n  │   registry: SPAWN ×3 · ISLAND ×2 · PVP ×1 …               │\n  │   reserves slots · tracks last-seen · alerts on silence   │\n  └───────────────────────────────────────────────────────────┘\n",[99,459,457],{"__ignoreMap":101},[11,461,462,465,466,468,469,471],{},[110,463,464],{},"Registration."," After loading its world, a server registers with ",[99,467,257],{}," with its type, address and state. ",[99,470,257],{}," adds it to the registry and opens a reverse gRPC channel into the server. It uses that channel to query the server, drain it and transfer its players. State changes are pushed to every proxy, so proxies never poll.",[11,473,474,477],{},[110,475,476],{},"Heartbeats."," Each server checks in every few seconds with its state, player count and TPS. When the scheduler sends a player to a server, it reserves the slot immediately instead of waiting for the next heartbeat. Without that, 40 players joining at once would all be sent to the same server. The next heartbeat replaces the reservation with the real count.",[11,479,480,483,484,486],{},[110,481,482],{},"Health."," ",[99,485,257],{}," checks the registry every 3 seconds:",[63,488,489,492,495,501],{},[66,490,491],{},"silent for about 30 seconds: warning and alert",[66,493,494],{},"silent for 60 seconds: removed from routing",[66,496,497,500],{},[99,498,499],{},"STARTING"," servers get a minute before they can be declared dead, because worlds take time to load",[66,502,503,506],{},[99,504,505],{},"DRAINING"," servers don't trigger the warning, because they're expected to go quiet",[11,508,509],{},"Removing a server on the first missed heartbeat would take healthy servers out during a GC pause.",[25,511,512],{"id":512},"convoy",[11,514,515,516,521,522,527,528,530],{},"Kubernetes ",[14,517,520],{"href":518,"rel":519},"https:\u002F\u002Fkubernetes.io\u002Fdocs\u002Fconcepts\u002Fconfiguration\u002Fliveness-readiness-startup-probes\u002F",[18],"probes"," and ",[14,523,526],{"href":524,"rel":525},"https:\u002F\u002Fkubernetes.io\u002Fdocs\u002Fconcepts\u002Fcontainers\u002Fcontainer-lifecycle-hooks\u002F",[18],"lifecycle hooks"," know nothing about worlds, players or saves. Each game server pod includes ",[99,529,512],{},", a small binary that the probes and hooks call:",[92,532,536],{"className":533,"code":534,"language":535,"meta":101,"style":101},"language-yaml shiki shiki-themes min-dark min-dark","readinessProbe:\n  exec: { command: [\"\u002Fopt\u002Fserver\u002Fconvoy\", \"--state=RUNNING\"] }\n  initialDelaySeconds: 60\n  periodSeconds: 5\nlivenessProbe:\n  exec: { command: [\"\u002Fopt\u002Fserver\u002Fconvoy\", \"--check\"] }\n  initialDelaySeconds: 90\n  periodSeconds: 30\n  failureThreshold: 5\n","yaml",[99,537,538,551,585,596,607,615,639,649,659],{"__ignoreMap":101},[539,540,543,547],"span",{"class":541,"line":542},"line",1,[539,544,546],{"class":545},"sCQh8","readinessProbe",[539,548,550],{"class":549},"sOPea",":\n",[539,552,553,556,559,563,566,568,571,575,579,582],{"class":541,"line":344},[539,554,555],{"class":545},"  exec",[539,557,558],{"class":549},":",[539,560,562],{"class":561},"sFR8T"," { ",[539,564,565],{"class":545},"command",[539,567,558],{"class":549},[539,569,570],{"class":561}," [",[539,572,574],{"class":573},"s-3mD","\"\u002Fopt\u002Fserver\u002Fconvoy\"",[539,576,578],{"class":577},"sQKTl",",",[539,580,581],{"class":573}," \"--state=RUNNING\"",[539,583,584],{"class":561},"] }\n",[539,586,588,591,593],{"class":541,"line":587},3,[539,589,590],{"class":545},"  initialDelaySeconds",[539,592,558],{"class":549},[539,594,595],{"class":545}," 60\n",[539,597,599,602,604],{"class":541,"line":598},4,[539,600,601],{"class":545},"  periodSeconds",[539,603,558],{"class":549},[539,605,606],{"class":545}," 5\n",[539,608,610,613],{"class":541,"line":609},5,[539,611,612],{"class":545},"livenessProbe",[539,614,550],{"class":549},[539,616,618,620,622,624,626,628,630,632,634,637],{"class":541,"line":617},6,[539,619,555],{"class":545},[539,621,558],{"class":549},[539,623,562],{"class":561},[539,625,565],{"class":545},[539,627,558],{"class":549},[539,629,570],{"class":561},[539,631,574],{"class":573},[539,633,578],{"class":577},[539,635,636],{"class":573}," \"--check\"",[539,638,584],{"class":561},[539,640,642,644,646],{"class":541,"line":641},7,[539,643,590],{"class":545},[539,645,558],{"class":549},[539,647,648],{"class":545}," 90\n",[539,650,652,654,656],{"class":541,"line":651},8,[539,653,601],{"class":545},[539,655,558],{"class":549},[539,657,658],{"class":545}," 30\n",[539,660,662,665,667],{"class":541,"line":661},9,[539,663,664],{"class":545},"  failureThreshold",[539,666,558],{"class":549},[539,668,606],{"class":545},[11,670,671,674,675,678,679,682,683,686],{},[99,672,673],{},"convoy --state=RUNNING"," asks the local game server for its state and exits ",[99,676,677],{},"0"," only when it's ",[99,680,681],{},"RUNNING",": the world is loaded and the server can take players. The pod only receives traffic after that. The usual Minecraft health check, pinging port ",[99,684,685],{},"25565",", only tells you the port is open.",[11,688,689,690,693],{},"The drain runs as the ",[99,691,692],{},"preStop"," hook:",[92,695,697],{"className":533,"code":696,"language":535,"meta":101,"style":101},"lifecycle:\n  preStop:\n    exec:\n      command: [\"\u002Fopt\u002Fserver\u002Fconvoy\", \"--terminate\", \"--copy-crashes\"]\nterminationGracePeriodSeconds: 300\n",[99,698,699,706,713,720,744],{"__ignoreMap":101},[539,700,701,704],{"class":541,"line":542},[539,702,703],{"class":545},"lifecycle",[539,705,550],{"class":549},[539,707,708,711],{"class":541,"line":344},[539,709,710],{"class":545},"  preStop",[539,712,550],{"class":549},[539,714,715,718],{"class":541,"line":587},[539,716,717],{"class":545},"    exec",[539,719,550],{"class":549},[539,721,722,725,727,729,731,733,736,738,741],{"class":541,"line":598},[539,723,724],{"class":545},"      command",[539,726,558],{"class":549},[539,728,570],{"class":561},[539,730,574],{"class":573},[539,732,578],{"class":577},[539,734,735],{"class":573}," \"--terminate\"",[539,737,578],{"class":577},[539,739,740],{"class":573}," \"--copy-crashes\"",[539,742,743],{"class":561},"]\n",[539,745,746,749,751],{"class":541,"line":609},[539,747,748],{"class":545},"terminationGracePeriodSeconds",[539,750,558],{"class":549},[539,752,753],{"class":545}," 300\n",[11,755,756,757,760,761,764,765,768],{},"Before Kubernetes stops the pod, ",[99,758,759],{},"convoy --terminate"," copies crash dumps to a ",[99,762,763],{},"crash-dumps"," PVC so they survive the pod, then calls ",[99,766,767],{},"Drain"," on the server. The 300-second grace period gives the drain time to move players and save.",[25,770,772],{"id":771},"rolling-updates","Rolling updates",[11,774,775],{},"We roll out new images, config, worlds and plugins without disconnecting players:",[777,778,779,782,794,799,804],"ol",{},[66,780,781],{},"Kubernetes starts a new pod. It loads its world, registers and becomes ready.",[66,783,784,785,787,788,790,791,793],{},"Kubernetes marks an old pod for termination. ",[99,786,759],{}," runs and the server switches to ",[99,789,505],{},". ",[99,792,257],{}," tells the proxies to stop sending new players to it, and the load balancer stops selecting it.",[66,795,796,798],{},[99,797,257],{}," transfers the old pod's players to the new pod. Players stay connected to the proxy the whole time; only the server behind it changes.",[66,800,801,803],{},[99,802,512],{}," waits for the old pod to reach 0 players, waits 15 seconds for saves, and exits. If players remain, it keeps waiting, up to the 300-second grace period.",[66,805,806],{},"The old pod terminates.",[92,808,810],{"className":533,"code":809,"language":535,"meta":101,"style":101},"strategy:\n  type: RollingUpdate\n  rollingUpdate:\n    maxSurge: 10%\n    maxUnavailable: 25%\n",[99,811,812,819,829,836,846],{"__ignoreMap":101},[539,813,814,817],{"class":541,"line":542},[539,815,816],{"class":545},"strategy",[539,818,550],{"class":549},[539,820,821,824,826],{"class":541,"line":344},[539,822,823],{"class":545},"  type",[539,825,558],{"class":549},[539,827,828],{"class":573}," RollingUpdate\n",[539,830,831,834],{"class":541,"line":587},[539,832,833],{"class":545},"  rollingUpdate",[539,835,550],{"class":549},[539,837,838,841,843],{"class":541,"line":598},[539,839,840],{"class":545},"    maxSurge",[539,842,558],{"class":549},[539,844,845],{"class":573}," 10%\n",[539,847,848,851,853],{"class":541,"line":609},[539,849,850],{"class":545},"    maxUnavailable",[539,852,558],{"class":549},[539,854,855],{"class":573}," 25%\n",[11,857,858,859,864,865,868],{},"As a ",[14,860,863],{"href":861,"rel":862},"https:\u002F\u002Fkubernetes.io\u002Fdocs\u002Fconcepts\u002Fworkloads\u002Fcontrollers\u002Fdeployment\u002F#rolling-update-deployment",[18],"Deployment rolling update",", new pods are created before old ones are removed, and a rollout never takes more than 25% of a server type offline. Each Deployment has a ",[99,866,867],{},"restart-group"," label, so we can roll a whole class of servers, such as all islands, as one wave without dropping below the capacity the fleet needs.",[11,870,871],{},"The drain is the slow part. A pod with 20 players takes as long as those 20 players take to move and save. We accept that, because rushing it risks player data.",[25,873,875],{"id":874},"two-replicas","Two replicas",[11,877,878,880,881,884,885,887],{},[99,879,257],{}," runs as two replicas. The registry lives in ",[14,882,154],{"href":152,"rel":883},[18],", and each replica keeps an in-memory copy for routing, synced through pub\u002Fsub. A replica loads the registry before it starts serving, so restarting or deploying ",[99,886,257],{}," doesn't affect players. One replica holds a leader lock in Redis and runs the fleet-wide jobs, like health checks, so each server is checked once.",[11,889,336,890,342],{},[14,891,341],{"href":339,"rel":892},[18],[894,895,896],"style",{},"html pre.shiki code .sCQh8, html code.shiki .sCQh8{--shiki-default:#F8F8F8;--shiki-dark:#F8F8F8}html pre.shiki code .sOPea, html code.shiki .sOPea{--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .sFR8T, html code.shiki .sFR8T{--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .s-3mD, html code.shiki .s-3mD{--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .sQKTl, html code.shiki .sQKTl{--shiki-default:#BBBBBB;--shiki-dark:#BBBBBB}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":101,"searchDepth":344,"depth":344,"links":898},[899,900,901,902,903],{"id":400,"depth":344,"text":401},{"id":449,"depth":344,"text":450},{"id":512,"depth":344,"text":512},{"id":771,"depth":344,"text":772},{"id":874,"depth":344,"text":875},"How Minebox runs Minecraft servers on Kubernetes: a replicated control plane, an in-pod helper for probes and drains, and rolling updates without disconnects.","\u002Fimages\u002Fog\u002Fscaling-minecraft-kubernetes.png",{},{"title":192,"description":904},"blog\u002Fscaling-minecraft-kubernetes",[368,910,371,911,912],"kubernetes","devops","continuous-deployment","9T_PXTJZiMdiepqV8AiZIVDN4Hw_3UXfgwjAVxN-T4c",1793424336398]