WorldEditListener::onPlayerInteract(PlayerInteractEvent) causing lag spikes
LadyCailinBot opened this issue ยท 5 comments
WORLDEDIT-3231 - Reported by val59000
Hello
I have cyclic lag spikes which make my server freeze for a few seconds. It happens no matter if there are a lot of players or a few players (<10).
I used the timings command of Spigot and isolated a lag spike :
http://timings.aikar.co/?url=9664229
We can see that this is WorldEditListener::onPlayerInteract(PlayerInteractEvent) which is causing a big lag spike.
I have other servers and I couldn't reproduce this issue.
Could you help me figure this out by telling me when onPlayerInteract is called and how I could prevent it from firing too often and thus producing lag spikes ?
Any insight will be greatly appreciated :)
Thanks
Comment by val59000
Another bigger lag spike from WorldEdit listener
http://timings.aikar.co/?url=9670296
Comment by sk89q
Please use WarmRoast (https://github.com/sk89q/warmroast) or JVisualVM (comes with the Java Development Kit) on your server and provide me the results. Timings are not detailed enough.
Though usually, from my experience, permissions plugins have been frequently the problem (mostly PermissionsEx or GroupManager).
Comment by val59000
Unfortunately I cannot reproduce the lag alone on a localhost dedicated server.
The server gets lag when some players are online but it is hosted on mtxServ and I don't have permission to install these programs.
Could you specify your meaning when you say it is caused by permissions plugins ?
Is it some specific permission node that is causing lag, the whole plugin behavior ? Is it fixable with plugin config only ?
Comment by val59000
I have some results but I don't think the worldedit lag is reproduced in it as I was alone on the server : http://87.98.217.10:23000/stack
I don't see any option to make an offline static report of the data though
Comment by sk89q
You would run it for around 5 minutes when the lag happens (and on the affected server), and then use File -> Save As in your browser. If you run it for a really long time, the data sort of gets averaged over the entire time and it may be hard to tell the cause.
As for permissions, I thought this was about WorldGuard earlier. WG checks a lot of permissions frequently, so a slow permissions plugin slows everything down. WorldEdit checks permissions too but not as much, so it may not be applicable here.
I can try to see if I can get a version of WarmRoast that can be utilized as a plugin, but that may take a few days. However, it's pretty hard to pinpoint the cause with data from JVisualVM or WarmRoast.