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

/bs reload takes 7-10 entire seconds and causes lag #106

Open
Diamondback88 opened this issue Jun 7, 2021 · 6 comments
Open

/bs reload takes 7-10 entire seconds and causes lag #106

Diamondback88 opened this issue Jun 7, 2021 · 6 comments

Comments

@Diamondback88
Copy link

Diamondback88 commented Jun 7, 2021

Executing /bs reload causes the server to freeze for 7-10 seconds while BossShop reloads, and then TPS takes a hit from 20 to about 18 or so. Nothing extra prints in console besides "Can't keep up! Is the server overloaded?", etc.

I also only have about 15 shops, and none of them are massive in any way. Not sure why it's taking so long to reload the plugin.

@Blackixx
Copy link
Owner

Blackixx commented Jun 7, 2021

Hm, there are many possible root causes for this issue. What comes to my mind right now: BSP does support many other plugins and does hook into them. For example, it does support other points plugins (like PlayerPoints). Now, those points plugins could store their data in another data base, which might take some time to access, or it could simply not be optimized or there is too much data stored. Now, if BSP accesses points via that points plugin, this will take some time. The same holds true for any other content offered by external plugins. Let's take placeholders, for example: if you have a server count placeholder, for example, or a Mcmmo placeholder or whatever other placeholder, the time it takes for BSP to load the corresponding shop simply depends on the time it takes for those connected plugins to do their stuff. Therefore, depending on what other plugins you use, BSP can be either very fast or also slowed down a lot. BSP by itself should be rather fast, except you use a lot of player skulls/heads: those also can take some time to load.

@cloakfox
Copy link

cloakfox commented Jun 10, 2021

Having same issue, it's because of the player_heads / skulls

Edit: from personal experience and the the items we have in our menu's I think its player heads/skulls.

@Diamondback88
Copy link
Author

I removed the player skulls from the only shop I've edited since I've noticed the reload time getting faster, and the reload still takes the exact same amount of time. Not quite sure how to debug this - is there a plugin debugger?

@Diamondback88
Copy link
Author

Ran a spark profiler - even without the heads here, inside of addShopItem(), Thread.sleep() is taking up 20%(!) of tick.
image

This same thing happens inside of createBuyItem():
image

@Diamondback88
Copy link
Author

Diamondback88 commented Jun 11, 2021

Update: I have determined that any player skull that uses the %name% placeholder to determine the look of the skull is the sole cause of the lag. Removing it in all shops that used it eliminated the lag entirely.

I've tested this on a barebones paper server as well, with no other plugins and no config file changes other than my bossshop shops.

@mercurialmusic
Copy link

Update: I have determined that any player skull that uses the %name% placeholder to determine the look of the skull is the sole cause of the lag. Removing it in all shops that used it eliminated the lag entirely.

I've tested this on a barebones paper server as well, with no other plugins and no config file changes other than my bossshop shops.

Confirming this. Was getting some massive lag on reload and frequent BS plugin crashes, removing that placeholder fixed all my problems. even the %displayname% placeholder is fine, it's specifically %name% causing problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants