Allow for throttled chunk generation as to not disrupt gameplay
douglasg14b opened this issue ยท 6 comments
Allow for chunk generation to be throttled to some degree (as an option, based on chunk generation rate). This can be handy when generating large servers, while still allowing players to play.
I don't assume this to be an easy problem, to be clear. But it would be quite valuable if solved.
This has been brought up and discussed numerous times, and has generally proven to be a non-issue. Chunk generation is largely off the main server thread, so you should see little to no impact on game performance itself. There is also no explicit prioritization in scheduling over player-generated chunks, and as such should not significantly affect gameplay. I would encourage you to try it out for yourself first, as most likely you will run into no problems, but if you do, please join the Discord server for help troubleshooting and to discuss further.
I've been running it for a while now, and expanding the map periodically. I notice that tic-lag is definitely worse when chunks are being generated and players are online. And player generated chunks are brutally slow to generated, which is a large reason for throttling Chunky as more players are on.
Maybe I should have led with that?
Essentially, I have tried it, and have been using it, and have noticed the problem :/
If you are still having issues please use the Discord link above and send me a spark profile of your server as well as any other relevant information so I can better evaluate this and help you.
Would throttling to not overwhelm low powered hardware be a valid reason for this feature? I'm trying to generate chunks but it seems the VPS cannot handle it (CPU and MEM were pinned to max). Perhaps slowing generation would help?
After ~8 minutes of generation:
...
[06:02:56] [Server thread/INFO]: [Chunky] Task running for minecraft:overworld. Processed: 1387 chunks (1.40%), ETA: 6:26:58, Rate: 4.2 cps, Current: 32, 30
[06:02:58] [Server thread/INFO]: [Chunky] Task running for minecraft:overworld. Processed: 1388 chunks (1.40%), ETA: 16:26:05, Rate: 1.7 cps, Current: 33, 30
[06:03:17] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 3761ms or 75 ticks behind
[06:05:15] [Server Watchdog/ERROR]: A single server tick took 61.01 seconds (should be max 0.05)
[06:05:40] [Server Watchdog/ERROR]: Considering it to be crashed, server will forcibly shutdown.
/stop
[06:09:26] [Server thread/INFO]: X lost connection: Disconnected
[06:09:26] [Server thread/INFO]: X left the game
[06:09:27] [Server thread/INFO]: Stopping the server
[06:09:28] [Chunky-minecraft:overworld Thread/INFO]: [Chunky] Task stopped for minecraft:overworld.
...
After some more investigation, it looks like I've solved the problem (at 19% of chunks generated so far). It turns out Docker was running and consuming a lot of RAM leaving only 900 MB available for Minecraft. Secondly, the Java command to run Minecraft/Fabric has the minimum memory to use set to -Xms2G
by default.
Stopping Docker to reclaim another 700 MB of RAM and setting -Xms
to 1G
, the system now has enough resources for chunk generation to not implode Minecraft. It's possible that freeing up enough memory was the only step necessary to resolve the issue.
CPU[||||||||||||||||||||||||||100.0%] Tasks: 46, 113 thr, 60 kthr; 1 running
Mem[|||||||||||||||||||||1.69G/1.86G] Load average: 1.75 1.80 1.80
Swp[||||||||||||||||||| 1.02G/1.86G] Uptime: 43 days, 23:15:25
Yes as mentioned previously, there generally aren't any issues requiring any sort of throttling on the server. Starving your system of memory will definitely cause issues, I think I would have come to a similar conclusion.
For any future concerns, please join the Discord server (link in earlier post, it hasn't changed), would prefer not to bump here as it emails everyone.