Multiverse / Multiverse-Core

The original Bukkit Multi-World Plugin!
BSD 3-Clause "New" or "Revised" License
944 stars 298 forks source link

[Bug]: Very long chunk loading times when logging in after a server starts up with paper anti xray engine mode 3 #3051

Closed partydev closed 1 week ago

partydev commented 7 months ago

/mv version -p output

https://paste.gg/p/anonymous/78bec465cf194470b3bc0c31fc357bc5

Server logs

https://gist.github.com/partydev/87222f020f8223fa3bdf89fd6eb3de59

Server Version

This server is running Paper version git-Paper-"905f4e7" (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 905f4e7)
Error obtaining version information
Previous version: git-Paper-"07b956e" (MC: 1.20.4)

Fork of paper up to date with this patch.
https://github.com/PaperMC/Paper/commit/76da4bc683a51057eadfabc6e6694486a20a0d20

Bug Description

When a server starts up for the first time and has engine mode 3 enabled in paper config, it can take up to or more than 30 seconds for a player to finish loading terrain and see the chunks around them.

Steps to reproduce

  1. Download Paper.
  2. Set anti xray engine mode to 3 following their recommended config.
  3. Download Multiverse Core.
  4. Start the server.
  5. Attempt to connect.

Agreements

NeverGrowUp commented 7 months ago

You have 24 world's... I assume you have decent server specs. I note you spawn in world spawn but have set keepspawninmemory set to false. Change this to true. I assume you removed Terra and VoidGen to rule out those as potential issues. There are no errors from multiverse, and no mention of chunks loading, so can only assume between your PC specs and your server specs, is where the issue lies.

partydev commented 7 months ago

You have 24 world's... I assume you have decent server specs. I note you spawn in world spawn but have set keepspawninmemory set to false. Change this to true. I assume you removed Terra and VoidGen to rule out those as potential issues. There are no errors from multiverse, and no mention of chunks loading, so can only assume between your PC specs and your server specs, is where the issue lies.

This issue does not happen when Multiverse is disabled. This issue only happens when both Multiverse and Paper Antixray are enabled as mentioned above.

Server is a dedicated OVH server with 10GB of RAM allocated with a 5600x with 250mbps up bandwidth. Spark profiler shows there is no issue there.

PC is 7900x 64GB memory on a 3070 with 400mbps down. Specs are not the issue. I will not be turning on keep spawn chunks in memory because it is unnecessary chunk loading and has zero impact on resolving this issue as the issue disappears when Multiverse is disabled even though spawn chunks in memory is set to false.

Multiverse is the only enabled plugin as explained in the log file provided. This issue disappears if one of Paper Antixray or Multiverse are disabled. The issue disappears if Multiverse is disabled and Paper Antixray is left enabled. Therefore it is reasonable to conclude Multiverse is the problem here.

partydev commented 7 months ago

Confirmed that with fewer (5) worlds loaded the issue goes away. However, I would expect to be able to load more worlds as the issue does not happen when paper anti-xray is enabled. Band aid fixed for now by preventing joins until 30 seconds after server has started.

benwoo1110 commented 1 week ago

Its just a matter of paper anti-xray needing to process to many chunks from too many worlds. 24 worlds is crazy for a single server. At that point you should consider multiple servers with velocity/bungeecord proxy.

Also no matter how good the pc is, the limitation is the how minercaft server are single threaded in some world related processing. So its prob better to run 2-3 server with 5 worlds each than 1 big server with 24 worlds on the same hardware.