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

Extreme lags and ram consumption after island delete/reset and rebuild #2356

Closed
LindAn79 opened this issue May 7, 2024 · 25 comments
Closed
Assignees
Labels
Status: Done This issue has been completed or answered. This pull request has been merged.

Comments

@LindAn79
Copy link

LindAn79 commented May 7, 2024

Expected behavior

i want to delete or reset the island and execute the commands

Observed/Actual behavior

the island was deleted and i can create it again right away but the server lagt very heavy /tps 20, 16, 10, 2, etc...
it takes a very long time for the tps to go up again, 1-2 minutes.
when i look into the console of the server i see that the RAM consumption is extremely high and does not go down again. the problem is permanent until i restart the server. then everything seems to be “normal” again until i want to delete/create an island again.

Translated with DeepL.com (free version) sry for bad english ^^

22
111

Steps/models to reproduce

as stated above, the problem occurs every time you delete/create an island

BentoBox version

i use 1.20.2 with bentobox 2.3.0 and acidisland 1.19.0

yes i have read that you should not use screenschots but where can i find the complete output of the command? there was nothing in the log except that i used the command, sorry
if you tell me where i can find the edition of the order i will gladly send it to you

Screenshot_1

Plugin list

Screenshot_2

Other

i can't say exactly but i suspect that i've only had the problem since i deleted the islandworld once and regenerated it. maybe that's the problem?! but i can't get it back to normal no matter if i delete the database from bentobox or not. do i have to remove anything else?

@LindAn79
Copy link
Author

LindAn79 commented May 7, 2024

I completely deleted bentobox and reinstalled it, but when I installed it I discovered that this version 2.3.0 is probably not compatible with the mc version 1.20.2?! correct? If I use the older version of bentobox, 2.2.0 and ai 1.18.1 then it runs on the server again. Did updating the plugins cause the problem?

Which MC version should I use so that the new bentobox runs best?

@tastybento tastybento self-assigned this May 7, 2024
@tastybento tastybento added the Status: Under investigation Investigating the interest and the feasability of the issue. label May 7, 2024
@tastybento
Copy link
Member

I'd use 1.20.4.

Nothing changed on the code that deletes islands between 2.2.0 and 2.3.0, so I don't know why you'd see that. I've been running the server with 1.20.1 and 1.20.4 and it seems that others are using it okay on 1.20.2, although it's not as popular a server version as 1.20.4:
Screenshot 2024-05-07 at 9 30 27 AM

@LindAn79
Copy link
Author

LindAn79 commented May 7, 2024

2024-05-07-12.log

i got the message when i installed the latest version of bentobox and acidisland from https://download.bentobox.world/
on my mc server 1.20.2.
this has nothing to do with the problem before, with deleting the island.
i wanted to set it up again and then i noticed this with the new version

@BONNe
Copy link
Member

BONNe commented May 7, 2024

Tasty, could it be related to the Copy World Chunks in Acid Island?
It was implemented "recently" and maybe it is causing some memory leaks?

@BONNe
Copy link
Member

BONNe commented May 7, 2024

@LindAn79 how large are your islands? (distance-between-islands value)

@LindAn79
Copy link
Author

LindAn79 commented May 7, 2024

distance-between-islands: 350
protection-range: 300

@tastybento
Copy link
Member

2024-05-07-12.log

i got the message when i installed the latest version of bentobox and acidisland from https://download.bentobox.world/

on my mc server 1.20.2.

this has nothing to do with the problem before, with deleting the island.

i wanted to set it up again and then i noticed this with the new version

This error is caused by MC version incompatibility:

java.lang.IllegalArgumentException: Newer version! Server downgrades are not supported!

I am not sure what would be causing that on your setup, but I'd recommend trying 1.20.4.

@tastybento
Copy link
Member

Tasty, could it be related to the Copy World Chunks in Acid Island?

It was implemented "recently" and maybe it is causing some memory leaks?

Hmm. Maybe. I'd have to run some tests with these island sizes, but it doesn't seem overly big. It could also be something to do with 1.20.2. They skipped over that version really quickly.

@BONNe
Copy link
Member

BONNe commented May 7, 2024

2024-05-07-12.log
i got the message when i installed the latest version of bentobox and acidisland from https://download.bentobox.world/
on my mc server 1.20.2.
this has nothing to do with the problem before, with deleting the island.
i wanted to set it up again and then i noticed this with the new version

This error is caused by MC version incompatibility:

java.lang.IllegalArgumentException: Newer version! Server downgrades are not supported!

I am not sure what would be causing that on your setup, but I'd recommend trying 1.20.4.

that is because you used 1.20.4 to create items in blueprints for some gamemodes :D

@LindAn79
Copy link
Author

LindAn79 commented May 7, 2024

okay, I have now upgraded the server to 1.20.4 but there are problems when I change something in the config with bentobox o.O what's wrong this time?

[22:20:32 ERROR]: [BentoBox] CRITICAL ERROR!*
[22:20:32 ERROR]: [BentoBox] Disabling BentoBox...
[22:20:32 ERROR]: [BentoBox] Cannot invoke "world.bentobox.bentobox.api.localization.BentoBoxLocale.getPrefixes()" because the return value of "java.util.Map.get(Object)" is null
[22:20:32 ERROR]: [BentoBox] *************************************************
[22:20:32 INFO]: [BentoBox] Disabling addons...
[22:20:32 INFO]: [BentoBox] Disabling ControlPanel...
[22:20:32 INFO]: [BentoBox] Addons successfully disabled.
[22:20:32 INFO]: [BentoBox] Removing coops from islands...
[22:20:32 INFO]: [BentoBox] Saving islands - this has to be done sync so it may take a while with a lot of islands...
[22:20:32 INFO]: [BentoBox] Islands saved.
[22:20:32 INFO]: [BentoBox] Closing database.
[22:20:32 WARN]: java.lang.NullPointerException: Cannot invoke "world.bentobox.bentobox.api.localization.BentoBoxLocale.getPrefixes()" because the return value of "java.util.Map.get(Object)" is null
[22:20:32 WARN]: at BentoBox-2.3.0.jar//world.bentobox.bentobox.managers.LocalesManager.getAvailablePrefixes(LocalesManager.java:155)
[22:20:32 WARN]: at BentoBox-2.3.0.jar//world.bentobox.bentobox.api.user.User.replacePrefixes(User.java:500)
[22:20:32 WARN]: at BentoBox-2.3.0.jar//world.bentobox.bentobox.api.user.User.translate(User.java:494)
[22:20:32 WARN]: at BentoBox-2.3.0.jar//world.bentobox.bentobox.api.user.User.getTranslation(User.java:458)
[22:20:32 WARN]: at BentoBox-2.3.0.jar//world.bentobox.bentobox.api.user.User.sendMessage(User.java:569)
[22:20:32 WARN]: at BentoBox-2.3.0.jar//world.bentobox.bentobox.BentoBox.completeSetup(BentoBox.java:256)
[22:20:32 WARN]: at BentoBox-2.3.0.jar//world.bentobox.bentobox.BentoBox.lambda$onEnable$0(BentoBox.java:177)
[22:20:32 WARN]: at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101)
[22:20:32 WARN]: at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:482)
[22:20:32 WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1142)
[22:20:32 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
[22:20:32 WARN]: at java.base/java.lang.Thread.run(Thread.java:840)

@LindAn79
Copy link
Author

LindAn79 commented May 7, 2024

lol okay, I found it... in locale I typed de-DE and not de

@LindAn79
Copy link
Author

LindAn79 commented May 7, 2024

unfortunately the problem still exists! the server is new 1.20.4, bentobox 2.3.0, acid 1.18.2, island created, then deleted, new one created and died, RAM doesn't go down again until restart, same problem as before, unfortunately o.O

Screenshot_1
Screenshot_2
Screenshot_3
Screenshot_4
Screenshot_1
Screenshot_2

@LindAn79
Copy link
Author

LindAn79 commented May 8, 2024

I started a completely fresh server with mc version 1.20.4 with 10 GB of RAM and fewer plugins so that I can rule out all of that, unfortunately the same error. I'm very sure that it's acidisland and bentobox that's causing problems, or what do you think? If you need further information then write to me. I need the plugin, my server is based on it. O.O I would be happy to help with the solution as much as I can.

Screenshot_1

Screenshot_2

Screenshot_3

Screenshot_4

Screenshot_5

Screenshot_6

@tastybento
Copy link
Member

For the above results, can you list the steps did? For example:

  1. Started server
  2. Logged in
  3. Typed /ai to make a new island
  4. Did /ai reset ?

Also, did you use all the defaults?

@LindAn79
Copy link
Author

LindAn79 commented May 8, 2024

in the last case with the new server:
bentobox uploaded with addons
then configs adapted (are included)
Restart, join, renamed the AI command to is, so /is to create the first island
then port to the island then /is reset
then the lags start... see screenshots I posted above

ps: it also starts to lag when I use the delete command and not reset

config_acidisland.zip

@LindAn79
Copy link
Author

LindAn79 commented May 8, 2024

If you want I can also give you access to the new server?! I can also give you OP and FTP access, then you can see for yourself. Write to me privately and I will send you the data. if that helps you reproduce this

@LindAn79
Copy link
Author

LindAn79 commented May 9, 2024

hi, I wanted to ask what the status is? Are you working on the problem or is it not yet reproducible? A short update would be nice, I'll wait :-)

@tastybento
Copy link
Member

Yes, I'm looking at it but this is a hobby and I have IRL obligations for work and things.

Some homework - in the BentoBox config.yml there are settings for island deletion. Try reducing those to do fewer chunk deletions. It should reduce the lag.

delete-speed: 100

Also you can try this setting:

slow-deletion: false

@LindAn79
Copy link
Author

LindAn79 commented May 9, 2024

Everything's fine, it's clear that it's a hobby, which is totally fine, but it would be helpful for me if I could assess how and whether it's being taken care of or whether there's any motivation at all or if I have to look for another solution. As I said, my server is based on this plugin. and unfortunately the 2 tips you gave don't help, I've already tried them and unfortunately they don't help. hmmm... as I said, no stress but some feedback would be nice so I can assess that, thanks :-)

@rudde0
Copy link

rudde0 commented May 11, 2024

I opened spark profiler before using /is reset.

https://spark.lucko.me/1Jwtfoizdd
image

@tastybento
Copy link
Member

What values of the delete-speed setting did you try?

@LindAn79
Copy link
Author

At the moment I have original settings:

paste-speed: 64
delete-speed: 100
slow-deletion: false

I've already tested it with significantly less and that didn't make any difference

paste-speed: 16
delete-speed: 16
slow-deletion: true

@tastybento
Copy link
Member

I just pushed a PR showed improvements in my testing.

This issue came to light because the protected area of the user's island is large. In this case the island size is 600 x 600 and about 2,800 chunks were being regenerated when it was deleted - which is a lot.

The root cause however, is that when deleting chunks of an island, all chunks were being regenerated even if they had never been generated yet. Also, similarly, chunks in the seed world were being generated. So lots of unneeded chunk generation was being done.

This PR only regenerates chunks that need to be regenerated, i.e., they have already been generated. Also, it continuously updates the seed worlds with chunks when they are generated in the main world so that when deletion occurs, they don't have to be generated at that point.

Although this will optimize for the situation where the user doesn't explore much, if a user does go to all the chunks in their island, all of them will need to be regenerated at deletion time, although at least the seed worlds ones will not have to be done.

Some suggestions:

  • Reduce the protection range for the users. You can keep the island distance large if you like to space out the islands, but reducing the area the player can affect will reduce the number of chunks to be regenerated.
  • Lower the number of chunks per deletion tick from 100 to say 50 - this will help reduce load
  • Reduce the view distance of the server - this will reduce the number of chunks being generated both when making new islands and also just from player's looking around and expanding the number of chunks that will need to be deleted later.
  • Consider not deleting islands when they are reset and just leaving them there, this can also be combined with using the Regionator plugin to delete/regenerate chunks async as time goes by.

With all of this, please make backups just in case.

The latest build should be on the ci.bentobox.world server soon.

@tastybento tastybento added Status: Done This issue has been completed or answered. This pull request has been merged. and removed Status: Under investigation Investigating the interest and the feasability of the issue. labels May 11, 2024
@tastybento
Copy link
Member

The correct build is building now...

@LindAn79
Copy link
Author

EXCELLENT! Thank you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done This issue has been completed or answered. This pull request has been merged.
Projects
None yet
Development

No branches or pull requests

4 participants