News for hackers. Stuff that matters.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by skerit on Tuesday June 27, 2023 @03:15AM (#36489830)
> 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 is smaller than you would think.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by Cthulhu_ on Tuesday June 27, 2023 @04:09AM (#36490199)
Well yeah but that's a process that can run independently from player movement and (I guess?) can be a highly asynchronous and paralellised process.

(note: armchair remark, I honestly haven't a clue)

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by tehbeard on Tuesday June 27, 2023 @04:35AM (#36490372)
Not really.

Block entities (those with complex data, like inventories) can be read/interacted with by redstone (a regular-ish set of blocks in terms of data), which can then trigger a piston or dispenser (which changes the world), and said piston or dispenser can then interact with the players movement, pushing them, or hitting them with an arrow, or dispensing water that changes their movement.

Same again for non player entities, but also factor in their AI having to adjust pathing based on the world changing.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by bakugo on Tuesday June 27, 2023 @04:42AM (#36490419)
> can be a highly asynchronous and paralellised process

It really can't, though. Parallelization is the enemy of consistent game mechanics, especially in a complex sandbox game like minecraft. There are tons of things that interact with each other in minecraft's world - if you just tick everything at arbitrary times, those interactions cease to be deterministic and might break entirely unless you write a ton of spaghetti code to deal with every edge case. Redstone in particular is the best example of a mechanic that heavily relies on the synchronous nature of the game logic loop.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by viraptor on Tuesday June 27, 2023 @05:01AM (#36490540)
> 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.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by ghosty141 on Tuesday June 27, 2023 @05:11AM (#36490610)
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.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by zimpenfish on Tuesday June 27, 2023 @05:20AM (#36490668)
> People on such big servers build farms

~Normally, yeah, but Folia is based on Paper which, AFAIK, is known for its unreliability when it comes to the technical aspects of Minecraft (ie redstone and farms.) Even your bog-standard simple item sorter is apparently a bit hit-or-miss on Paper.~

Edit: Possibly outdated info, things sound better re: technical Minecraft support on Paper now according to 'ocelotpotpie.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by ocelotpotpie on Tuesday June 27, 2023 @05:27AM (#36490711)
The hardcore technical folks seem to prefer things that don't alter the vanilla mechanics quite as much as Paper, it's true. But FWIW there are lots of farm and redstone designs that work reliably on Paper.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by zimpenfish on Tuesday June 27, 2023 @05:27AM (#36490718)
> But FWIW there are lots of farm and redstone designs that work reliably on Paper.

Ah, good to know - been a long while since I last tried Paper.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by ghosty141 on Tuesday June 27, 2023 @05:47AM (#36490833)
Its fine for most stuff the average player does. I wouldnt run a redstone computer on it but I personally never had an issue with my farms.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by nottorp on Tuesday June 27, 2023 @10:09AM (#36493030)
> Even your bog-standard simple item sorter is apparently a bit hit-or-miss on Paper.~

My simple sorters have been working just fine(tm) on Paper in the last (>5) few years.

I do hear co players having occasional problems with fancier set ups, but most automation just works.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by veave on Tuesday June 27, 2023 @05:24AM (#36490693)
The kind of mental gymnastics that people do here to justify needing 8 GB of RAM with a turnover of 3 GB per minute to handle 1000 users.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by Rapzid on Tuesday June 27, 2023 @05:34AM (#36490775)
Per second.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by kaba0 on Tuesday June 27, 2023 @08:02AM (#36491660)
It is definitely more than required, but let’s not go to the other end, it is neither a static html page.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by viraptor on Tuesday June 27, 2023 @05:51AM (#36490850)
I wouldn't say "each has to do a lot". There's a few trivial behaviours usually. Especially if you know what behaviours are common, you can optimise entity lists for that.

But that's not even what we're talking about here. This was a short-lived test server with new environment, not huge farms. The super high GC stats we see here are the baseline behaviour. More complex scenarios will push this even more.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by Kuinox on Tuesday June 27, 2023 @08:06AM (#36491684)
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:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by gjsman-1000 on Tuesday June 27, 2023 @11:53AM (#36494606)
Remember Minecraft is written in Java, not C++. The Bedrock version is written C++ but has only experimental, very rough native server software that is almost never used.
Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by ElectricalUnion on Tuesday June 27, 2023 @08:08PM (#36500499)
> Factorio doesn't need that amount of RAM when it routinely handle dozen of thousands of items every tick.

It might not inefficiently allocate all that RAM every tick, but it still has to scan a lot of RAM, and write to a bunch of locations to update the game state.

It loves CPUs with huge caches because of that.

Re:Breaking the Limits: How Folia Made 1,000 Player Minecraf... by hwillis on Tuesday June 27, 2023 @08:55AM (#36492075)
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.