BG-Software-LLC / WildChests

Sell chests, auto crafters, storage units, larger chests and more in one plugin!
https://bg-software.com/wildchests/
GNU General Public License v3.0
34 stars 23 forks source link

Potentially high server thread usage #143

Closed mike-544 closed 1 year ago

mike-544 commented 1 year ago

Minecraft's Version

Minecraft Version 1.19.2 (Cannot insert server.jar as its 37MB even when zipped and max allowed to upload is 25MB)

Plugin's Version

WildChests-2022.7-b80.zip

Wildchests version 2022,7-b80

Describe the bug

TPS issues, used spark to get a profile: https://spark.lucko.me/u5FpZ05Ned

I had an issue with this a few weeks ago where it was using up around 61% of the server threat, but in this profile its only using up about 46% which is still a lot for a single plugin.

Advised by Ome_R in discord to make this issue on here

To Reproduce

Players on this server can only have access to the sell chests, auto-collect chests, large chests and storage units. It appears to only really be a visible issue when i have about 15+ players online

Each player is allowed only 15 large chests with the config added in Additional Information, and each player that has a storage unit normally has it connected so a chunk hopper (from another plugin) collects the items, it feeds into a storage unit which then feeds down into large chests. I thought maybe its the constant passing of items into and out of the storage units that might be causing the issue, but im obviously not the right one to make assumptions as i do not know whats actually going on in the plugin itself.

I also have the WildStacker plugin installed

Additional Information

I use it on a farming server with this config: https://pastebin.com/yueA40GY

Spigot Version: (I have no way of editing or changing this, this is controlled by Minehut the server host)

This server is running Paper version git-Paper-215 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 236a296) You are 79 version(s) behind Download the new version at: https://papermc.io/downloads Previous version: git-Paper-131 (MC: 1.19.2)

OmerBenGera commented 1 year ago

What vsrsion of Spigot you use (exact output of /version)? Also, get rid of the config from the issue's body and instead upload it to pastebin and include a link to it here.

mike-544 commented 1 year ago

Done

broken1arrow commented 1 year ago

I can say Minehut or other host are not good option specially when you have 15+ players (when we use host (paid one) it had problems to work with even 3 players with our setup of plugins (could not handle both jobs and mcmmo on same server)).

We try 3 different host and all fail to deliver descent experiences (when we set up own server all problems was solved).

mike-544 commented 1 year ago

The only thing is that when we did not have this plugin installed, we were handling 25-30 players at around 16-18tps. But in this time we have also installed some other plugins, but none that use anywhere near as much as the wildchest plugin seems to. So it might not be entirely the fault of this plugin but it could definitely be the main culprit image

broken1arrow commented 1 year ago

The only thing is that when we did not have this plugin installed, we were handling 25-30 players at around 16-18tps. But in this time we have also installed some other plugins, but none that use anywhere near as much as the wildchest plugin seems to. So it might not be entirely the fault of this plugin but it could definitely be the main culprit image

I not say is not the plugin problem, only say on a host you has limit amount of performance.

But we notes the problem on several plugins had high timings (but not in this scale). But was lagging on the server when you try for example dig.

Perhaps minehut is better host, an the rest some claiming you get good cpu (some you then need chare with 4 other server owners).

mike-544 commented 1 year ago

https://spark.lucko.me/K0KmkO6sSl, another spark profile done today while tps around 16 with 8 players. 55%

OmerBenGera commented 1 year ago

Check out latest dev build, let me know if it's better. Also make sure you take a spark profiler and send it here after you use it :)

mike-544 commented 1 year ago

I will have to wait a few hours for the server to die down as most people afk overnight and i dont want them all to have a go that they got disconnected haha But will let you know as soon as i can, thanks for responding and acting so quick, its much appreciated :)

broken1arrow commented 1 year ago

Check out latest dev build, let me know if it's better. Also make sure you take a spark profiler and send it here after you use it :)

If I interpreters the report right from spark is it your toArray method some are the main issue (from getWildContents()). Your NonNullList cache are not the biggest issue here. For paged container you call getWildContents() several times to convert itemstacks to an array (instead of store the contents directly in an array (I know work with some type of list implementation are easier, but also cost more)).

broken1arrow commented 1 year ago

When I self work with this, i always try keep list in "right" format, so less time consuming task I work with list and then convert it to array and then use the array directly (so i keep the array format in the field only add options how you want access it and save some ms that way).

mike-544 commented 1 year ago

Ok so i have just tested it, and it broke my chunkhopper's that are placed on top of the wildchest chests, and i can no longer use the sell wand i made in skript on any of the wildchest chests. So there are some bigger issues that arose with that dev build

I am using the ChunkHopper plugin made by McDoJr

broken1arrow commented 1 year ago

Ok so i have just tested it, and it broke my chunkhopper's that are placed on top of the wildchest chests, and i can no longer use the sell wand i made in skript on any of the wildchest chests. So there are some bigger issues that arose with that dev build

I am using the ChunkHopper plugin made by McDoJr

do normal hoppers works both below and ontop?

mike-544 commented 1 year ago

No they throw a huge error in console when they try put something into a wildChests chest. Normal chests work fine with hoppers though

error: https://pastebin.com/4a5c5qKg

broken1arrow commented 1 year ago

No they throw a huge error in console when they try put something into a wildChests chest. Normal chests work fine with hoppers though

error: https://pastebin.com/4a5c5qKg

Yeah, i think is because he's change. It will not add any ententes (it will be empty).

OmerBenGera commented 1 year ago

Sorry about that, check out latest dev build

mike-544 commented 1 year ago

Sorry i didnt respond sooner, took a trip and only just got back today. Got this error when placing down storage units : https://pastebin.com/NF2Axusb

Other chests seem to work fine though

OmerBenGera commented 1 year ago

Sorry i didnt respond sooner, took a trip and only just got back today. Got this error when placing down storage units : https://pastebin.com/NF2Axusb

Other chests seem to work fine though

Check out latest dev build, let me know if it works. Also make sure you send me a new spark profiler :)

mike-544 commented 1 year ago

Spark Profile: https://spark.lucko.me/c8HAXPWG9M Everything seemed to work fine, and the usage is much much less but it was also only me online so i could create backups and restore if something went wrong like before (so none were being used except mine, will have to update this when we get our players back on)

I have noticed a new problem however that when i use wildstacker and have a max stack of greater than 64x, it doesn't get picked up properly by the chunkhopper or its not being distributed properly into the large chest. So i had a max stack of 128x, broke 4 chests full of cactus which should fill up 2 pages of the large chest but it only filled up 1 page and a tiny bit of the 2nd. I am unsure of which plugin is at fault as the chunkhoppers work perfectly fine when going into a normal chest (no items lost) but when they go directly into a large chest (or storage unit) the items get lost. Imgur link to vid: https://imgur.com/a/sWtdnNX

broken1arrow commented 1 year ago

Spark Profile: https://spark.lucko.me/c8HAXPWG9M Everything seemed to work fine, and the usage is much much less but it was also only me online so i could create backups and restore if something went wrong like before (so none were being used except mine, will have to update this when we get our players back on)

I have noticed a new problem however that when i use wildstacker and have a max stack of greater than 64x, it doesn't get picked up properly by the chunkhopper or its not being distributed properly into the large chest. So i had a max stack of 128x, broke 4 chests full of cactus which should fill up 2 pages of the large chest but it only filled up 1 page and a tiny bit of the 2nd. I am unsure of which plugin is at fault as the chunkhoppers work perfectly fine when going into a normal chest (no items lost) but when they go directly into a large chest (or storage unit) the items get lost. Imgur link to vid: https://imgur.com/a/sWtdnNX

If your plugin only pick up items to hopper and the hopper self try add items. Should not be issue with chunkhopper . But easy test with normal hopper on top of the chest.

OmerBenGera commented 1 year ago

Spark Profile: https://spark.lucko.me/c8HAXPWG9M Everything seemed to work fine, and the usage is much much less but it was also only me online so i could create backups and restore if something went wrong like before (so none were being used except mine, will have to update this when we get our players back on)

I have noticed a new problem however that when i use wildstacker and have a max stack of greater than 64x, it doesn't get picked up properly by the chunkhopper or its not being distributed properly into the large chest. So i had a max stack of 128x, broke 4 chests full of cactus which should fill up 2 pages of the large chest but it only filled up 1 page and a tiny bit of the 2nd. I am unsure of which plugin is at fault as the chunkhoppers work perfectly fine when going into a normal chest (no items lost) but when they go directly into a large chest (or storage unit) the items get lost. Imgur link to vid: https://imgur.com/a/sWtdnNX

Not related to this issue in any way. Test it on a proper server, spark profiler with only you online is not that useful

mike-544 commented 1 year ago

Sadly because the last updates broke more than they fixed i couldn't trust you enough to test it with people online as it breaks all their chests and makes them unusable. Only way to test it was by doing what i said before where i had to whitelist the server, create a backup and then test it, then restore it back after it fucked things up. If you could test it yourself first and guarantee it would work without messing things up then i would be able to do it while all my players are online, but im not risking doing it while they are for me to then shutdown the server 15 minutes later losing them their progress in that time.

So until i can see other people using it fine or a personal guarantee from you that the next dev build works fine, i cannot provide you with the spark profiler while all the players are online like normal

OmerBenGera commented 1 year ago

Sadly because the last updates broke more than they fixed i couldn't trust you enough to test it with people online as it breaks all their chests and makes them unusable. Only way to test it was by doing what i said before where i had to whitelist the server, create a backup and then test it, then restore it back after it fucked things up. If you could test it yourself first and guarantee it would work without messing things up then i would be able to do it while all my players are online, but im not risking doing it while they are for me to then shutdown the server 15 minutes later losing them their progress in that time.

So until i can see other people using it fine or a personal guarantee from you that the next dev build works fine, i cannot provide you with the spark profiler while all the players are online like normal

I have never managed to replicate the issue on my own, even with the old version. It's not like I am not testing the plugin before pushing an update, it's just that not all the bugs occur on my setup, this is why these are dev builds and this is why you're here to report the bugs, as #144 did for the issue you mention. If you can't test it yourself, that's fine, use the stable build. Anyways, according to #144 , it's fixed.

Let me know what you plan to do so I know if I can close this or not.