pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.27k stars 1.54k forks source link

Super slow growth #5409

Closed max-xoo closed 1 year ago

max-xoo commented 1 year ago

Issue description

Steps to reproduce the issue

  1. Make a farm
  2. Wait for a seed to grow

OS and versions

Plugins

Crashdump, backtrace or other files

dadodasyra commented 1 year ago

Seems like it's true, I have the same problem, it's really slow as f. But i'm not 100% sure it's related to how many players are connected.

The issue is same with 20 players~, it takes really long time to grows. Here's my timings https://timings.pmmp.io/?id=245434

dktapps commented 1 year ago

Please send your pocketmine.yml

max-xoo commented 1 year ago

Please send your pocketmine.yml

https://pastebin.com/x5grS10n

dadodasyra commented 1 year ago

https://pastebin.com/7NFfC2nb for me

dktapps commented 1 year ago

I'm not able to reproduce this using a fresh pocketmine.yml using melon seeds (as per the video).

max-xoo commented 1 year ago

How many chunks are loaded? The more chunks are loaded the longer it takes to push (but it increases the time very very fast and it increases a lot)

dktapps commented 1 year ago

I think this is almost entirely influenced by player count, not by chunks loaded. You can see here that the default simulation radius is 3 chunks: https://github.com/pmmp/PocketMine-MP/blob/732dac6fc147087c2acf8f60d1a2db5bfc7243a6/resources/pocketmine.yml#L125

This means that it doesn't matter how big your radius is, only how many players there are, since no one has a render distance of less than 3.

The most influential setting in this case is going to be this one: https://github.com/pmmp/PocketMine-MP/blob/732dac6fc147087c2acf8f60d1a2db5bfc7243a6/resources/pocketmine.yml#L123

This value gets divided between all the online players. If the players are clustered in a small area, this is fine, but if they are widely distributed, chunk ticking with 100 players will be only 2.5% of the speed of what it would be with a single player.

This is the same logic as in PM3, so there shouldn't be any difference unless you were already using a customised configuration for this setting in PM3.

enrik0308 commented 1 year ago

Yes I confirm the issue wasn't here on PM3

dadodasyra commented 1 year ago

Same, I was using servers with like 80 players with probably the same config on PM3 and it was not so slow. The thing is that even with 20 players everyone is complaining about it. There's probably something more that this per tick value, or it wasnt working correctly well on PM3. Trust me I can assure you it was not like this before. But I can't really tell you what changed between..

dktapps commented 1 year ago

The only thing that changed is retention of chunkTickList (removed), and that was disabled on PM3 by default anyway. You'd have to go out of your way to enable it.

dktapps commented 1 year ago

If you're up for the risk, you can try the latest next-minor commits. It should be better there.

dktapps commented 1 year ago

Can anyone report whether 4.11.0-BETA2 improves on this?

max-xoo commented 1 year ago

My servers are closed so I can't.

dadodasyra commented 1 year ago

I installed it on my server and.. this is... really bad. In fact crops are growing normally but this has a HUGE performance impact Here's a timings https://timings.pmmp.io/?id=245596

dktapps commented 1 year ago

That's pretty much what I expected. The old code only escapes performance impact by massively slowing down growth and not working properly. The new code mimics vanilla.

In fact the timings report looks pretty good to me. 27% tick time spent on block ticking is quite acceptable IMO.

dadodasyra commented 1 year ago

Eww my bad I thought this was 100% caused by the beta but I have pretty same issue on other servers with the same worlds, the thing is that I really don't understand from where it come. Will continue this discussion on discussion, this issue is not for this and I guess I can't open an issue on this because it lacks of information and is more a support request that an issue. Here's a server without the beta https://timings.pmmp.io/?id=245601

dktapps commented 1 year ago

Yes, I noticed that. Your scheduled block updates issue is probably unrelated to the beta.

That being said, some increase in CPU is to be expected with the new changes, since it's actually working correctly now.

dadodasyra commented 1 year ago

https://timings.pmmp.io/?id=245814 In fact you need to consider "faction1 - Random Chunk Updates", "faction1 - Random Chunk Updates - Chunk Selection" and

dktapps commented 1 year ago

As I said, this is entirely expected.

ShockedPlot7560 commented 1 year ago

After many tests, this problem does not exist anymore with the last update.
The speed of growth has returned to normal.