CraftBook 3

CraftBook 3

139k Downloads

SelfTriggerThinkEvent causing chunk loading issues and tps loss

LadyCailinBot opened this issue ยท 20 comments

commented

CRAFTBOOK-3260 - Reported by FatherWh0

My server is suffering a high tps loss and looking at the lag tree view timings are pointing to Craftbook's SelfTrigerThinkEvent. These two timings were taken late at night with a near empty server.
https://timings.aikar.co/?id=5bab607753934ed8b3c6a998cec76a8a
https://timings.aikar.co/?id=58fbe86639d84b54a0abc547a9babe99
The important aspect about the second one is that it's taken shortly after a restart and the chunks listed in the chunks view have not been visited by any players. They are, however, loaded with quite a few integrated circuits.
Server: paper 1.11.2 #1045
Craftbook 3.9 snapshot dev #117

commented

Comment by me4502

It appears that a Clock is being used to trigger a redstone contraption that's very slow. It's not actually the clock, but what it's triggering.

commented

Comment by FatherWh0

Do you see any indication of where this contraption might be?

commented

Comment by me4502

No sorry, all that really says that it exists, doesn't tell me where or anything.

commented

Comment by FatherWh0

I found the source of the issue. There were in fact two giant redstone machines powered by mc1421. I appreciate your help here. Any idea why they became self loading? I do have ic.keep-loaded: false. Have those vanilla issues returned?

commented

Comment by me4502

Hmm, even with that issue ICs won't load on server start, they'll wait for their chunk to load initially.

For them to have stopped unloading, the chunk unload event would've had to have stopped being called for some reason

commented

Comment by FatherWh0

This report was taken immediately after a restart before any players had logged in. None of these ST ics are in spawn chunks.
http://pastebin.com/vRuDnsac

commented

Comment by me4502

Have you tried to reproduce without other plugins? They could be loading the other chunks

commented

Comment by FatherWh0

I ran it again with only craftbook and worldedit and got the same results. Fyi, I also tried with mainstream spigot but again the same results. (Knew it would, just had to test)

commented

Comment by me4502

It appears there are some unload bugs in Paper (Possibly Spigot as well), PaperMC/Paper#598

commented

Comment by me4502

Could you please provide CPU profiling such as warmroast?

commented

Comment by FatherWh0

http://prnt.sc/e3ua1t

commented

Comment by me4502

Next test build.

commented

Comment by FatherWh0

With Build #122 timings looks like this.
https://timings.aikar.co/?id=f5a60401cafc440b8a3dbaa801deda7a
I'd call that fixed. I owe a great debt of gratitude to @me4502 for all your help with this! Once again the @sk89q team proves to be the best plugin devs of the mc world.

commented

Comment by me4502

Thanks, and you're welcome :)

commented

Comment by FatherWh0

I tested with paper 1041 and 1044 and got the same results. They are sure that started with 1045 making it appear to be a different issue. Since there were improvements with 1047 I grabbed the latest 1051 but again with the same results.

commented

Comment by me4502

When the server starts, when it says "X chunks for X worlds processed", what does it say?

that should be a relatively small number, for about ~16 chunks per world.

If it's more, the server is returning more than just the loaded chunks, which is what CraftBook is asking for.

commented

Comment by me4502

Try this test build - do whatever causes the chunks to be loaded, and then stop the server. It'll probably be rather spammy.

commented

Comment by FatherWh0

Going back to the test server: [CraftBook] 75 chunk(s) for 3 world(s) processed
http://pastebin.com/LsWMxhEp
With this report: http://pastebin.com/vbPT04rq

commented

Comment by FatherWh0

This from the empty test server stripped of extra plugins.
https://gist.github.com/FatherWh0/8fa73771117d46c8559f16a63460fa9f