Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bentobox massive lag spike during island removal due to IA custom blocks that do not exist #2297

Closed
TheLaoming opened this issue Feb 11, 2024 · 16 comments · Fixed by #2353
Closed
Assignees
Labels
blocked this issue is blocked Status: Under investigation Investigating the interest and the feasability of the issue.

Comments

@TheLaoming
Copy link

TheLaoming commented Feb 11, 2024

Expected behavior

It shouldn't lag like this. Version 1.24.1 didn't have this problem.

Observed/Actual behavior

When you invite someone and the chosen player already has his island, massive lag will start due to Itemsadder custom blocks (which are not even here). I'm not even use any custom blocks, there's literally that one AOneblock block.

Steps/models to reproduce

  1. Install Bentobox 1.20.0 or any dev build + Itemsadder
  2. Make any player to create their island
  3. Invite them
  4. 10 sec lag appears beacause of their island removal

BentoBox version

2.0.1-SNAPSHOT-b2557 with generated addons

Plugin list

Plugins (14): AnimatedScoreboard, BentoBox, Bentobox-AOneBlock, BentoBox-Biomes, BentoBox-Level, BentoBox-Visit, BentoBox-Warps, ItemsAdder, LoneLibs, LuckPerms, ProtocolLib, Vault, ViaBackwards, ViaVersion

Other

Using fork of paper Pufferfish 1.20.2, ItemsAdder 3.6.3-beta-5 and LoneLibs 1.0.43.

@HSGamer
Copy link
Contributor

HSGamer commented Feb 13, 2024

Use spark and provide us a spark report.
It would be better for us to investigate the lag.

@tastybento
Copy link
Member

Yes, the issue is that when the island is being deleted, the code tells ItemsAdder that the block is being removed, for each block. We had the same problem with SlimeFun, but I was able to fix it because their API has a way to check for blocks. I think I'll temporarily remove the hook so that there isn't lag at the expense of not deleting IA blocks.

@tastybento tastybento added the Status: Under investigation Investigating the interest and the feasability of the issue. label Feb 13, 2024
@tastybento
Copy link
Member

tastybento commented Feb 13, 2024

The other option is to drastically reduce the number of blocks deleted in one go in the BentoBox config.yml.

Anyway, I'll try and see if this can be optimized.

You can use the snapshot 2.0.1 version.

@TheLaoming
Copy link
Author

Thanks!
Does this also apply to IA furnitures too (especially those using armor stands) or just custom blocks?

@HSGamer
Copy link
Contributor

HSGamer commented Feb 13, 2024

Thanks! Does this also apply to IA furnitures too (especially those using armor stands) or just custom blocks?

Mostly just custom blocks

@TheLaoming
Copy link
Author

I just tested dev build with disabled IA blocks removal, but for some reason it still lags but less than before.
I don't remember this was a problem in 1.24.1. Maybe it's something wrong w 1.20.2 mc version? I was on 1.20.1 before.
spark

@tastybento
Copy link
Member

Try the very latest build on the CI server. I added NMS support for older versions - before, it would only optimize for 1.20.4, so if you were using 1.20.2, then it would be using the Bukkit API to copy and paste blocks.

@tastybento tastybento self-assigned this Feb 18, 2024
@tastybento tastybento added the blocked this issue is blocked label Feb 18, 2024
@tastybento
Copy link
Member

tastybento commented Feb 18, 2024

I asked the dev for some API addition to prevent the lag, but let's see. PluginBugs/Issues-ItemsAdder#3445

@TheLaoming
Copy link
Author

Great! Anyway don't know what's going on, I just updated Bentobox to the latest build and addons too, but there's lag when I invite a player. Looks like I have to stick with no island removal for now.

@TheLaoming
Copy link
Author

TheLaoming commented Feb 21, 2024

Having same issue with purging unowned islands, because I just disabled automatic island removal. It's not really that massive, but probably same lag spike. So currently I have no way how to avoid this lag. Any idea @tastybento ? I've got lag when I purged just 4 islands.

@tastybento
Copy link
Member

I need logs or stats to see where the lag is coming from when you do this. It may be some other location. Can you post a Spark report?

@TheLaoming
Copy link
Author

Here it is, I think it's very similar when I am purging islands.
https://spark.lucko.me/VdiF0IHFpV

@tastybento
Copy link
Member

Hmm forgive me but that seems all okay - 20 tps across the board. Although BentoBox does use CPU, the TPS are not affected (at least according to that report). It looks like the staggering system is working. What do you actually experience in game?

@TheLaoming
Copy link
Author

Trust me, it affects TPS too and it's really not a small lag spike, there is no chance not to notice, because you can't even open chests, drop items etc.
drop
drop2
Just check plugins section in that spark, 98% is crazy, never had more than 20 and it's even measured using a parameter --only-ticks-over 200 which is even more crazy.

@tastybento
Copy link
Member

Okay thanks. Let's see what we can tweak.

@TheLaoming
Copy link
Author

TheLaoming commented Mar 11, 2024

Same problem with 1.20.4, but looks like for example obadmin purge unowned doesn't lag like that, it only takes not even 1 tps. Problem is reset itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked this issue is blocked Status: Under investigation Investigating the interest and the feasability of the issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants