magemonkeystudio / fabled

Fabled - A skill casting plugin with custom skill builder
https://fabled.magemonkey.studio
MIT License
59 stars 38 forks source link

[Bug]: Server Lag spikes really bad when a group of enemies (10+) are hit with a damage ability #376

Closed EvosCorner closed 2 years ago

EvosCorner commented 2 years ago

Is there an existing issue for this?

Have you tried to reproduce this without OP?

Current Behavior

What happens is when a damage skill is in contact with a group of enemies (a cluster of 10+ mobs) my server spikes really bad. if I perform a fresh server reset, the abilities work for a few times in this scenario (about once or twice), but after that it goes right back to the server spiking. I removed plugins and added them back in to see if it was a problem with a specific plugin. i tried it on a clean server with ONLY the plugins I require for stuff to work (proskillapi, prorpgitems, mythicmobs was even removed as well) but everything lagged it out. i also tried it on vanilla mobs as well and nothing seems to work.

Expected Behavior

if my ability connects with a small cluster of enemies (10+ group of enemies) they all die instantly

Steps To Reproduce

  1. Cast a damaging skill
  2. hit a group of 10 or so mobs
  3. server lags for longer than a second.

Environment

- Server Software:
- ProSkillAPI Version: 1.1.7.17
- ProMCCore Version: 1.0.3.9
- Plugins:
AdvancedModt, AsyncWorldEdit, AuctionHouse, BlockParticles, Citizens, CrackShot, CrackShotPlus, DeluxeMenus, DropNames, Essentials, GUIHelper, Gunging_Ootilites_Plugin, Hat, HolographicDisplays, HoloMobHealth, LibsDisguises, LuckPerms, MagicCosmetics, MMOItems, ModelEngine, Multiverse-Core, MythicLib, MythicMobs, NameTagEdit*, PhatLoots, PlaceholderAPI, ProMCCore, ProRPGItems, ProSkillAPI, ProtoclLib, Quarsk*, Reach, SetSpawn*, SharkSK*, SKBee, skDragon, Skellett, SkJade, skRayFall, Skript, skript-gui, skript-npc*, skUtilities, SkWaze, SuperVanish, TradeSystem, Vault, WorldEdit, WorldGuard

I understand I have a lot of skript stuff but even when I tested if it was a skript problem (by removing skript and its addons) the issue still occured.

latest.log

No response

Anything else?

Here is a video example of what happens:

https://user-images.githubusercontent.com/34973174/189788399-dfd4b050-a384-40d5-b818-206d37569b41.mp4

Travja commented 2 years ago

Could you gather a timings report for me? And also try it as well with ProRPGItems disabled?

EvosCorner commented 2 years ago

i can do both, but how would you want me to do a timings report? sorry I'm unfamiliar if its a Q&A term of some sort

Travja commented 2 years ago

Spigot has a /timings command. I think it's /timings enable and /timings paste. So enable timings, then do the skill and cause the lag, then paste and send the link.

EvosCorner commented 2 years ago

hey so i tested it w/o prorpgitems and it works? here is my timings report: https://timings.aikar.co/dev/?id=c78cc31e803b44f5a6963a452ae826b5#timings

had very minor lag. nothing to be worried about. that one spike is from an unrelated problem

Travja commented 2 years ago

Do you have a timings with ProRPGItems?

EvosCorner commented 2 years ago

no but i can set that up for you then, one moment

EvosCorner commented 2 years ago

have it finished here. heading to bed atm but hope this helps: https://timings.aikar.co/dev/?id=f8592f904b224a099593019f2c50447c

lordsrubka5 commented 2 years ago

Could also be a combinatin of poorly optimized skill and a weaker cpu no idea which one you have (mostly the first part)

I had the similar issue myself which is why I had to redo half of my skills to be lag free

Travja commented 2 years ago

This is interesting. Those timings actually aren't as illuminating as I would have hoped they would be. It may be good to know what specs your machine is running and, if possible, to see the skill.

Travja commented 2 years ago

Unfortunately, with these timings not being helpful as I would have hoped, I don't know how much we can do. There's probably a fair amount going on that ProRPGItems has to intercept and calculate things. I'd recommend performing some of your own optimizations wherever possible. Apart from that, this will likely be resolved with a proper rewrite of ProRPGItems' damage system... at some point down the road. If you can't find any way to optimize things, we can do some more investigation and see if we can optimize things on our end.

Travja commented 2 years ago

Actually, potentially more valuable would be a report generated with Spark. Drop the jar in your plugins folder, then run /spark profiler to start it, then /spark profiler --stop to generate the report. If you could generate a report from this, that would be a lot more beneficial, I believe.

EvosCorner commented 2 years ago

hey I can do this for you sometime later tonight. ill be at work but I can do this for you soon. Ive been reducing lag for a few days so ill continue to do this

EvosCorner commented 2 years ago

i made a spark profile using both prorpgitems and no prorpgitems: with items installed: https://spark.lucko.me/RwXPD4NTzw WITHOUT items installed: https://spark.lucko.me/nZHy2imC5z

Travja commented 2 years ago

Well after looking over those, if you're not running the latest and greatest ProRPGItems, please download that and give it a try. It looks like there isn't really any lag when ProRPGItems isn't installed. And when it is, it doesn't appear to affect overall performance very much. I do recognize that it does have some impact though, when casting skills. ProRPGItems does a lot to jump in and see what modifications need to be done in an attacking interaction. That being said, I worked with Jamm a while ago to try to optimize a little bit of this since it was also causing him some issues. We worked out a great deal and got it optimized a bit. So if you're not running this optimized version, that could contribute to the issue. Unfortunately, there isn't a ton more I believe we can do there. We could try, but I'd suggest taking a deeper look at your skills and seeing if you can optimize them at all, if you hit this point.

lordsrubka5 commented 2 years ago

Are you running the server on your PC? Because from what I see its on linux using a Desktop class CPU. I cant tell the exact ram you have allocated but that shouldnt matter too much unless its maxed out. Spark shows 2 but that is not the full number. Mine shows 10 when its actually 20GB allocated

Skillapi might be hella unoptimized when it comes to specific mechanics and targetters but you also have to consider that you are using your own pc to host it which means the cpu is already suffering a bit doing normal tasks like your operating system and running client side minecraft.

If you plan to go big I would suggest hosting the server from a different machine with a cpu specifiacally made to run servers. However even with that if the skills are not optimized it will still lag

EvosCorner commented 2 years ago

Well after looking over those, if you're not running the latest and greatest ProRPGItems, please download that and give it a try. It looks like there isn't really any lag when ProRPGItems isn't installed. And when it is, it doesn't appear to affect overall performance very much. I do recognize that it does have some impact though, when casting skills. ProRPGItems does a lot to jump in and see what modifications need to be done in an attacking interaction. That being said, I worked with Jamm a while ago to try to optimize a little bit of this since it was also causing him some issues. We worked out a great deal and got it optimized a bit. So if you're not running this optimized version, that could contribute to the issue. Unfortunately, there isn't a ton more I believe we can do there. We could try, but I'd suggest taking a deeper look at your skills and seeing if you can optimize them at all, if you hit this point.

alright im gonna try newer versions of proRPGitems and see if that works. if there are still problems, im gonna try to uninstall other plugins and try to come up with a replacement


Are you running the server on your PC? Because from what I see its on linux using a Desktop class CPU. I cant tell the exact ram you have allocated but that shouldnt matter too much unless its maxed out. Spark shows 2 but that is not the full number. Mine shows 10 when its actually 20GB allocated

Skillapi might be hella unoptimized when it comes to specific mechanics and targetters but you also have to consider that you are using your own pc to host it which means the cpu is already suffering a bit doing normal tasks like your operating system and running client side minecraft.

If you plan to go big I would suggest hosting the server from a different machine with a cpu specifiacally made to run servers. However even with that if the skills are not optimized it will still lag

no this is a rented server, i do not own this server. I was thinking of switching over to shockbyte soon so i can start using bungeecord due the amount of worlds i need to host (think Wynncraft, but the word is sectioned off into missions). I don't think I would ever host my own personal server/farm due to the amount of money it would cost

Travja commented 2 years ago

Just wondering @EvosCorner if you've seen improvement on newer builds or not.

EvosCorner commented 2 years ago

Just wondering @EvosCorner if you've seen improvement on newer builds or not.

i havent seen improvements in later builds, since I did stop using prorpgitems and I'm only using proskillapi for the classes on my server. I am writing my own armor plugin to handle stats. Sorry I didn't close this earlier.

Travja commented 2 years ago

No worries. So potentially this could still be a problem, but assuming it was just a large combination of things coming together to cause the issues, I won't worry about it for now.

EvosCorner commented 2 years ago

yea at the end of the day it was only my own problems with the two builds, so its probably something on my end I didn't catch. hopefully this is the case tho