Live data from Hacker News

Testing a 1,000 player Minecraft server with Folia

cubxity.dev

131–140 of 166 posts

Re: Testing a 1,000 player Minecraft server with Folia

#131

Earlier quoted context omitted.

That can't be true, minecraft already had multiplayer in 2009. He didn't make it intentionally painful and never said anything like that. I remember there being huge issues with multiplayer but that was mostly because of bad architecture, not intentional.

Correct, I don't think he hesitated even a little bit on adding multiplayer support. The very first announcement of Minecraft's existence mentioned two planned game modes (fortress and team survival) that would require multiplayer and that all gamemodes would support it https://forums.tigsource.com/index.php?topic=6273.0

yep, just to add to that I remember there was a big deal to rearchitect the entire engine to use a client-server architecture even when running singleplayer. This also enabled the "Open to LAN" feature in which you can start a server from your singleplayer world with a single click.

https://web.archive.org/web/20120713082903/http://www.mojang...

Re: Testing a 1,000 player Minecraft server with Folia

#132
post #89
post #41

Earlier quoted context omitted.

Ultima Online is sharded. Biggest shard is ATL, with maybe 150 players.[1] Planetside 2 got up to 2000 or so, and may hold the record for a seamless land world MMO. [1] https://www.reddit.com/r/ultimaonline/comments/tr1r6j/uo_atl...

Shards in UO are called that way because of the lore (gem shattered into shards), and each shard is just a regional server completely isolated from other shards. So they are not very different from Minecraft or Planetside servers. Sharding in other games split the user base based on active load. This is not the case with UO.

On the other hand 150 isn't that many, and many games that do shard their world can also handle 150 players per shard.

Re: Testing a 1,000 player Minecraft server with Folia

#133

I know this isn't the point of Folia's test, but: > During the period when 1,000 players were online, we reached a maximum of ~7.9GB/s heap allocation and our GC was hovering around 2-3GB/s when averaged over a minute. As someone who dealt with soft-realtime telephony stuff, this makes me want to scream in horror. It seems like the platform really hurts the performance here. In an average second with that many player…

Minecraft Java used to allocate over 200MB/s per player when moving, and just 50MB/s when static. A lot of it stems back from Minecraft 1.8, where code was updated to take a BlockPos(float x, float y, float z) class instead of just (float x, float y, float z). Pretty much every single object in the game has to deal with its position. Millions of objects allocated per frame, only to be discarded later. Along with a lo…

Notchian code ran way better than modern MC - even though it used completely obsolete OpenGL 1.1 fixed-function calls.

They've upgraded to OpenGL 3 and shaders now; but the game's memory and CPU usage is through the roof with inconsistent performance and huge lagspikes.

Most of this is caused by utterly spurious and unneeded allocations; stream code on hot paths and complete overengineering and abstractions totally unfit for purpose. By that I mean heavy usage of inheritance and indirection in rendering code, and horrible memory wasting with vertex data. (Most things are full floats even if they could be packed and in some cases, even duplication of the same data due to bad data design)

Re: Testing a 1,000 player Minecraft server with Folia

#134
post #89

Earlier quoted context omitted.

Shards in UO are called that way because of the lore (gem shattered into shards), and each shard is just a regional server completely isolated from other shards. So they are not very different from Minecraft or Planetside servers. Sharding in other games split the user base based on active load. This is not the case with UO.

On the other hand 150 isn't that many, and many games that do shard their world can also handle 150 players per shard.

I think you misunderstand the comment about 150 players. It's not the max. UO is simply not that popular nowadays. Back in the day there were thousands of players online per shard.

Edit: And there are apparently private shards that still have that player count per shard: https://news.ycombinator.com/item?id=36490436

Re: Testing a 1,000 player Minecraft server with Folia

#135

Cool stuff. The possibilities of Minecraft if some optimisation work was done would be amazing. It's demotivating just how rotten the internals of Minecraft are. Bedrock edition has really nice performance but nobody wants to play it.

Bedrock rendering performance is really good. Tick performance? Not so much, the game is riddled with horrible issues such as world fallthrough which don't exist on Java (due to floating-point rounding errors), and I think the default tick distance is something like 4 or 6 chunks. Bedrock looks good, but the simulation itself is just broken. Not to mention the uncanny feeling as previous posters said - they've managed to create a similar game but with a sterilised, odd feeling. It's like watching a bad Disney adaptation of a book.

Re: Testing a 1,000 player Minecraft server with Folia

#136

Earlier quoted context omitted.

There are three competing standards right now: - Fabric (and Quilt), which uses a mixins system, a really flexible modding API that can do client and server modification - Paper (and Purpur, Pufferfish, Folia), which is similar to the old-school Bukkit/Spigot ecosystem and supports an intuitive API for server-side plugins. If you're aiming for >30 concurrent players you really need the sorts of performance patching t…

I want to use Minecraft as a sort of platform for teaching my kid how to code. Which one is the least headache?

Definitely Paper. Working with Fabric often requires you to get your hands dirty at the compiled bytecode level, which is very powerful for mod authors but really increases the floor for "actually building something that's fun to use" in a way that will probably just be very frustrating for new programmers. Forge is focused on client-side modding which is just inherently trickier and requires more awkward APIs. Paper really gets out of your way and lets you program basically whatever you want to do server-side without worrying at all about needing to install mods client-side. I would't worry at all about capabilities—minecraft is an extremely flexible program, especially with the chat commands system, and you can still create cool custom UIs and behaviors without touching client-side code at all.

Re: Testing a 1,000 player Minecraft server with Folia

#137
post #77

Earlier quoted context omitted.

Allocation is typically really cheap, maintaining pools for objects would likely have more overhead. And while collecting garbage takes resources too, it's heavily concurrently, especially in GCs like Shenandoah and ZGC. So instead of more overhead due to pooling on the thread that uses the objects, you have more overhead on a different thread during garbage collection. So while it makes sense to avoid unnecessary al…

Pooling would have been more overhead than allocation + deallocation? Do you have any relevant readings? No idea how to do it in java but a few pointers ought to be enough. You can also omit clearing the memory area between allocations for things that aren't security sensitive, if that is done in java, which I would assume.

For short lived objects, heap allocation is probably about as fast as allocating on the stack. By pooling you can end up moving objects out of the fast eden space into older generations.

I worked on optimising a java library a few years back and one of the bigger speed ups was removing all the object pooling code.

Re: Testing a 1,000 player Minecraft server with Folia

#138

I know this isn't the point of Folia's test, but: > During the period when 1,000 players were online, we reached a maximum of ~7.9GB/s heap allocation and our GC was hovering around 2-3GB/s when averaged over a minute. As someone who dealt with soft-realtime telephony stuff, this makes me want to scream in horror. It seems like the platform really hurts the performance here. In an average second with that many player…

Well, Java isn't really used for perf critical workloads to be fair.

Java is absolutely used for perf critical workloads, hell, I am fairly sure that there are no runtime in existence that would handle that load of memory pressure better - of course the problem is sort of self-made, not every allocation should have to be done in the first place in this case.

But Java is heavily used in high-frequency trading, is the backbone of many cloud infrastructures and it is such a large platform that there are plenty of small niches where it is used and performance is important.

Re: Testing a 1,000 player Minecraft server with Folia

#139

Earlier quoted context omitted.

Minecraft Java used to allocate over 200MB/s per player when moving, and just 50MB/s when static. A lot of it stems back from Minecraft 1.8, where code was updated to take a BlockPos(float x, float y, float z) class instead of just (float x, float y, float z). Pretty much every single object in the game has to deal with its position. Millions of objects allocated per frame, only to be discarded later. Along with a lo…

Notchian code ran way better than modern MC - even though it used completely obsolete OpenGL 1.1 fixed-function calls. They've upgraded to OpenGL 3 and shaders now; but the game's memory and CPU usage is through the roof with inconsistent performance and huge lagspikes. Most of this is caused by utterly spurious and unneeded allocations; stream code on hot paths and complete overengineering and abstractions totally u…

Do you have any source for that? It seems questionable at best. Also, depending on where it is used, Java deals very well with indirect calls, it doesn’t have the same cost as, say, a C++ virtual call.

Re: Testing a 1,000 player Minecraft server with Folia

#140

Just wondering: Is Paper consuming less resources than the vanilla Minecraft server for a few players (1 to 10 players). In other words, is it less costly to operate a Paper server on the cloud?

Absolutely. Depending on your hardware using Paper can be the difference of the server not even starting and a playable game. Paper is an absolutely incredible effort.
Post reply on HN