Live data from Hacker News

Testing a 1,000 player Minecraft server with Folia

cubxity.dev

141–150 of 166 posts

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

#141
post #104

Earlier quoted context omitted.

But each has to do a lot of stuff. People on such big servers build farms with hundreds of mobs dropping thousands of items which then go through redstone sorting systems.

The kind of mental gymnastics that people do here to justify needing 8 GB of RAM with a turnover of 3 GB per ~minute~ second to handle 1000 users.

It is definitely more than required, but let’s not go to the other end, it is neither a static html page.

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

#142

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…

Has anyone already tried to use GraalVM with it? Cool would be trying to do a native compilation and compare the performance

That's a sample size of one, but I did try it once and it ended up being basically the same. HotSpot took a measurable amount of time to reach GraalVM performance (in the minute if memory serves), but once the hot path got JITed, they were basically on par. Since a minecraft server is (usually) a long-lived process, it does not matter in the end.

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

#143

Earlier quoted context omitted.

> Each player loads in a lot of living entities (monsters/animals/...) and block entities (furnaces, redstone, ...) that all need to update. Sure, but that list of entities in the area is close to static (apart from crazy redstone magic). One would expect them to be pooled and not have many allocations for each tick.

But each has to do a lot of stuff. People on such big servers build farms with hundreds of mobs dropping thousands of items which then go through redstone sorting systems.

Thousands of items is small. Factorio doesn't need that amount of RAM when it routinely handle dozen of thousands of items every ticks.

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

#144
post #59
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...

Planetside 2 has them on on huge map, but as soon as more player are nearer in one area the system got problems too. Lags, Jumps and wrong running clocks (different speeds an the map). They shard within a server. But PS2 Networking is really good and optimized, better as most current games, and Planetside 1 + 2 (and parts of the Engine) are 20 years old. Most new games are overwhelmed with 64 Players. PS2 can handle…

Planetside 2 does not have good network code, it's very inaccurate and prone to cheating, I mean when you run at 20hz everything is possible. It's really not a good example of modern "netcode".

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

#145
post #137
post #77

Earlier quoted context omitted.

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.

But that means that the pools still use the GC? If so then I fully agree. But the point of a pool in my mind would be to reuse the memory rather than allocate+deallocate it.

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

#146
post #102

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…

Do you think a minecraft server (and multiplayer game servers in general) can benefit for running on a soft-realtime OS like Linux with the PREEMPT_RT patch? Games often use their tick rate (iterations of the event loop per second) as a quality metric, and an rt OS should favor preemption and low scheduling latency over throughput... so maybe that should give a more fluid experience? But the bottleneck for minecraft…

First, Minecraft would have to actually support multithreaded work properly. Here the issue is just plain throughput / computation. RT usually makes things slower, but more predictable. MC needs to go faster first.

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

#147
post #125

This is interesting. I am interested in multithreading and parallelism. So I have a journal entry to explore which is about deliberately desynchronizing and resynchronizing game loops for performance. * For the number of clients can use epoll or liburing. * Can multiplex multiple sockets per thread my epoll-server does this. * Can split out recv and send across threads so you can send while receiving and receive whil…

> deliberately desynchronizing and resynchronizing game loops for performance. > latch on each thread for partial causality between game loops. This sounds like a recipe for misery. You have to start thinking about ""light cones"" if causality propagates at finite speed. Do all observers in the game universe witness events in the same order? What if they don't? You get a little bit of this with rollback netcode, on t…

Thank you for your reply.

Your comment made me amused because it made me think of a game world where retrocausality was in effect, it would be absurd.

Is the bottleneck for networked games the network of broadcasting updates? Or the CPU usage of updating object states?

Sharding or instancing means you have fewer clients to broadcast stream updates to.

Different game loops interacting with eachother, that's interesting.

How else do you scale a game engine across threads?

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

#148
post #53

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…

> In an average second with that many players, most (all?) of them will not do any action apart from changing their position The world is not static though. Each player loads in a lot of living entities (monsters/animals/...) and block entities (furnaces, redstone, ...) that all need to update. There's some overlap of course, though in a game like Minecraft where there's a near infinite world to explore that overlap…

The world is 100k blocks to a side, with players split up in groups of 20 over the whole thing. Since allocation rose steadily from 35 min and peaked from 47 to 63 minutes, I'm guessing they were spread out pretty widely.

There were 113 regions in one of the pictures- call it 9 players per region, with ~927 live unique chunks (8x8 chunks for 9 players ~=566, plus a 19x19 area around the world origin thats always loaded). From what I can tell a Minecraft block is a bit over 10 kB. So ~10 MB per region.

If each thread is allocating 10 MB for each region on each tick (which the screenshot shows is 8 ticks per second) *that would work out to 8.6 gigabytes per second*. IMO, that's too close to be a coincidence- I'm thinking there are a lot of shared chunks per region, but the threads are copying significant amounts of data by value or they just have an absurd overhead.

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

#149
post #125

Earlier quoted context omitted.

> deliberately desynchronizing and resynchronizing game loops for performance. > latch on each thread for partial causality between game loops. This sounds like a recipe for misery. You have to start thinking about ""light cones"" if causality propagates at finite speed. Do all observers in the game universe witness events in the same order? What if they don't? You get a little bit of this with rollback netcode, on t…

Thank you for your reply. Your comment made me amused because it made me think of a game world where retrocausality was in effect, it would be absurd. Is the bottleneck for networked games the network of broadcasting updates? Or the CPU usage of updating object states? Sharding or instancing means you have fewer clients to broadcast stream updates to. Different game loops interacting with eachother, that's interestin…

> Is the bottleneck for networked games the network of broadcasting updates? Or the CPU usage of updating object states?

Bit of both depending on precisely what's happening.

Ultimately the problem is that, for N "agents" (players or NPCs or active blocks or monsters, etc) in a space, if you're not careful you end up with O(N ^ 2) checks of the form "has X collided/interacted with Y". Octree systems can spread this out, but you're still vulnerable to "what if all the players go to the same spot?"

Instancing lets you back off the worst-case situation by limiting the maximum number of players in a particular spot.

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

#150
post #102

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…

Do you think a minecraft server (and multiplayer game servers in general) can benefit for running on a soft-realtime OS like Linux with the PREEMPT_RT patch? Games often use their tick rate (iterations of the event loop per second) as a quality metric, and an rt OS should favor preemption and low scheduling latency over throughput... so maybe that should give a more fluid experience? But the bottleneck for minecraft…

it all depends on if you want the tick time to equal the wall clock time.
Post reply on HN